blob: 5d2c5e7ace84578c8c3dda46e61dd44173f3ebf8 (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
. $(dirname $0)/functions
vertonumber () {
local VERSIONID=$1
local V1=$(echo $VERSIONID | cut -d. -f1)
local V2=$(echo $VERSIONID | cut -d. -f2)
local V3=$(echo $VERSIONID | cut -d. -f3)
local V="$V1$V2$V3"
echo -n $V
}
NEW_VERSION_MAIN=$(latest $(curl ftp://ftp.netbsd.org/pub/NetBSD/misc/ipsec-tools/ | cut -d' ' -f13,14 | cut -d' ' -f2))
NEW_VERSION=$(latest $(curl ftp://ftp.netbsd.org/pub/NetBSD/misc/ipsec-tools/$NEW_VERSION_MAIN/ | grep 'ipsec-tools' | cut -d '-' -f9 | cut -d '.' -f1,2,3))
echo "NEW_VERSION = $NEW_VERSION"
checkout platform/external/ipsec-tools
cd $SRC/platform/external/ipsec-tools
if git branch -a |grep -q linaro-upstream-$NEW_VERSION; then
ok "ipsec-tools is up to date."
exit 0
fi
git checkout -b linaro-upstream-work-$TIMESTAMP aosp/master
AOSPVER=$(grep Version: README.version | cut -d ' ' -f2)
echo "AOSPVER = $AOSPVER"
AOSPVER_MAIN=$(echo "$AOSPVER" | cut -d'.' -f1,2)
if [ "$(vertonumber $NEW_VERSION)" -le "$(vertonumber $AOSPVER)" ]; then
notice "ipsec-tools is up to date in AOSP master, copying its work"
else
notice "Updating ipsec-tools to $NEW_VERSION"
rm -f Android.patch
cd $SRC/platform/external
wget ftp://ftp.netbsd.org/pub/NetBSD/misc/ipsec-tools/$AOSPVER_MAIN/ipsec-tools-$AOSPVER.tar.gz
tar -zxf ipsec-tools-$AOSPVER.tar.gz
rm -rf ipsec-tools-$AOSPVER/src/setkey
# diff -rubN ipsec-tools-$AOSPVER/src ipsec-tools/src > ipsec-tools/Android.patch
rm -rf ipsec-tools-$AOSPVER.tar.gz ipsec-tools-$AOSPVER
wget ftp://ftp.netbsd.org/pub/NetBSD/misc/ipsec-tools/$NEW_VERSION_MAIN/ipsec-tools-$NEW_VERSION.tar.gz
tar -zxf ipsec-tools-$NEW_VERSION.tar.gz
rm -rf ipsec-tools-$NEW_VERSION/src/setkey
cd ipsec-tools
for i in *; do
if [ -e ../ipsec-tools-$NEW_VERSION/$i ]; then
cp -f ../ipsec-tools-$NEW_VERSION/$i .
fi
done
cd $SRC/platform/external
rm -rf ipsec-tools/src
mv ipsec-tools-$NEW_VERSION/src ipsec-tools/src
rm -rf ipsec-tools-$NEW_VERSION.tar.gz
rm -rf ipsec-tools-$NEW_VERSION
cd $SRC/platform/external/ipsec-tools
if patch -p0 < Android.patch; then
rm Android.patch
notice "Auto-updated ipsec-tools to $NEW_VERSION."
git commit -asm "Update to ipsec-tools $NEW_VERSION"
git clean -d -f -x
else
sed -i -e 's/'$AOSPVER'/'$NEW_VERSION'/g' README.version
error "Couldn't auto-update pcre - patch failed to apply."
error "Please fix manually and commit to a branch called"
error "linaro-upstream-$NEW_VERSION."
exit 1
fi
fi
#git push origin linaro-upstream-work-$TIMESTAMP:linaro-upstream-$NEW_VERSION
#git pull
#git checkout -b linaro-upstream-$NEW_VERSION origin/linaro-upstream-$NEW_VERSION
#git branch -D linaro-upstream-work-$TIMESTAMP
pwd
|