-
Notifications
You must be signed in to change notification settings - Fork 3
/
dounix.sh
executable file
·64 lines (61 loc) · 1.5 KB
/
dounix.sh
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
#!/bin/sh
#
# REQUIRED: ReferenceDir must already exist. It may be created by untaring a
# previous distribution.
#
OldBuild=0
OldVersion=2.11.0.$OldBuild
NewBuild=1
NewVersion=2.11.0.$NewBuild
ChangesDir=mux
ReferenceDir=mux2.11_$OldBuild
DistroDir=mux2.11
NewDir=mux2.11_$NewBuild
patchableFiles=`cat unix/TOC.patchable`
unpatchedFiles=`cat unix/TOC.unpatched`
removeFiles=`cat unix/TOC.removed`
# Build patchfile
#
rm -rf $NewDir $DistroDir
cp -r $ReferenceDir $DistroDir
cp -r $ReferenceDir $NewDir
for i in $patchableFiles;
do
cp $ChangesDir/$i $NewDir/$i
done
for i in $removeFiles;
do
if [ -e $NewDir/$i ]; then
echo Removing: $NewDir/$i
rm $NewDir/$i
fi
done
#diff -Naudr $DistroDir $NewDir > mux-$OldVersion-$NewVersion.unix.patch
makepatch -verbose -diff "diff -Naud" $DistroDir $NewDir > mux-$OldVersion-$NewVersion.unix.patch
if [ -e mux-$OldVersion-$NewVersion.unix.patch.gz ]; then
rm mux-$OldVersion-$NewVersion.unix.patch.gz
fi
gzip -9 mux-$OldVersion-$NewVersion.unix.patch
# Build tarball
#
rm -rf $DistroDir
for i in $unpatchedFiles;
do
cp $ChangesDir/$i $NewDir/$i
done
for i in $removeFiles;
do
if [ -e $NewDir/$i ]; then
echo Removing: $NewDir/$i
rm $NewDir/$i
fi
done
cp -r $NewDir $DistroDir
if [ -e mux-$NewVersion.unix.tar.gz ]; then
rm mux-$NewVersion.unix.tar.gz
fi
tar czf mux-$NewVersion.unix.tar.gz $DistroDir
if [ -e mux-$NewVersion.unix.tar.bz2 ]; then
rm mux-$NewVersion.unix.tar.bz2
fi
tar cjf mux-$NewVersion.unix.tar.bz2 $DistroDir