UBUNTU: Ubuntu-2.6.38-12.51
[linux-flexiantxendom0-natty.git] / ubuntu / aufs-update
1 #!/bin/bash
2
3 if [ "$#" -ne 1 ]; then
4         echo "Usage: $0 <aufs2-standalone directory>" 1>&2
5         exit 1
6 fi
7 aufs="$1"
8
9 # Get the current tip name
10 {
11         read x url
12         read x osha1
13 } <aufs/BOM
14
15 # Update aufs to the latest.
16 git rm -rf aufs
17 cp -rp "$aufs/fs/aufs" aufs
18 #cp -rp "$aufs/include" aufs
19 cp -rp "$aufs/include/linux"/*.h include/linux
20 git checkout -f HEAD -- aufs/BOM
21
22 # Reinsert the include update.
23 #sed -i -e '1iEXTRA_CFLAGS += -I$(src)/include' aufs/Makefile
24
25 # Find the latest commit.
26 read x nsha1 <"$aufs/ChangeLog"
27
28 # Insert the new commit ID and commit the result.
29 sed -i -e "s/^COMMIT: .*/COMMIT: $nsha1/" aufs/BOM
30 git add aufs include/linux
31 {
32         echo "UBUNTU: ubuntu: AUFS -- update to $nsha1"
33         echo ""
34         awk <"$aufs/ChangeLog" '
35                 /^commit '"$osha1"'/    { exit }
36                                         { print "    " $0 }
37         '
38 } | git commit -s -F -