aboutsummaryrefslogtreecommitdiff
path: root/ubuntu/aufs-update
blob: d1ac0f97ca0c58197ec08950b46093e17072ce93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash

if [ "$#" -ne 1 ]; then
	echo "Usage: $0 <aufs2-standalone directory>" 1>&2
	exit 1
fi
aufs="$1"

# Get the current tip name
{
	read x url
	read x osha1
} <aufs/BOM

# Update aufs to the latest.
git rm -rf aufs
cp -rp "$aufs/fs/aufs" aufs
#cp -rp "$aufs/include" aufs
cp -rp "$aufs/include/linux"/*.h include/linux
git checkout -f HEAD -- aufs/BOM

# Reinsert the include update.
#sed -i -e '1iEXTRA_CFLAGS += -I$(src)/include' aufs/Makefile

# Find the latest commit.
read x nsha1 <"$aufs/ChangeLog"

# Insert the new commit ID and commit the result.
sed -i -e "s/^COMMIT: .*/COMMIT: $nsha1/" aufs/BOM
git add aufs include/linux
{
	echo "UBUNTU: ubuntu: AUFS -- update to $nsha1"
	echo ""
	awk <"$aufs/ChangeLog" '
		/^commit '"$osha1"'/ 	{ exit }
					{ print "    " $0 }
	'
} | git commit -s -F -