]>
Commit | Line | Data |
---|---|---|
64c4757e | 1 | #!/bin/sh |
56eedc1a NB |
2 | arg=$1 |
3 | target=~/public_html/source/mdadm | |
1e0d770c NB |
4 | if [ " $arg" = " test" ] |
5 | then | |
6 | target=/tmp/mdadm-test | |
7 | rm -rf $target | |
8 | mkdir -p $target | |
9 | fi | |
64c4757e NB |
10 | if [ -d $target ] |
11 | then : | |
12 | else echo $target is not a directory | |
13 | exit 2 | |
14 | fi | |
15 | set `grep '^char Version' ReadMe.c ` | |
52826846 | 16 | version=`echo $7 | sed 's/v//'` |
56eedc1a NB |
17 | grep "^.TH MDADM 8 .. v$version" mdadm.8 > /dev/null 2>&1 || |
18 | { | |
b9d77223 N |
19 | echo mdadm.8 does not mention version $version. |
20 | exit 1 | |
21 | } | |
22 | grep "^.TH MDMON 8 .. v$version" mdmon.8 > /dev/null 2>&1 || | |
23 | { | |
24 | echo mdmon.8 does not mention version $version. | |
56eedc1a NB |
25 | exit 1 |
26 | } | |
39c5a909 NB |
27 | rpmv=`echo $version | tr - _` |
28 | grep "^Version: *$rpmv$" mdadm.spec > /dev/null 2>&1 || | |
56eb10c0 | 29 | { |
11a3e71d | 30 | echo mdadm.spec does not mention version $version. |
56eb10c0 NB |
31 | exit 1 |
32 | } | |
56eedc1a NB |
33 | if [ -f ANNOUNCE-$version ] |
34 | then : | |
35 | else | |
e5329c37 | 36 | echo ANNOUNCE-$version does not exist |
56eedc1a NB |
37 | exit 1 |
38 | fi | |
e5329c37 NB |
39 | if grep "^ANNOUNCE-$version\$" inventory |
40 | then : | |
41 | else { cat inventory ; echo ANNOUNCE-$version ; } | sort -o inventory | |
42 | fi | |
56eedc1a | 43 | |
52826846 | 44 | echo version = $version |
9a9dab36 | 45 | base=mdadm-$version.tgz |
56eedc1a NB |
46 | if [ " $arg" != " diff" ] |
47 | then | |
48 | if [ -f $target/$base ] | |
49 | then | |
50 | echo $target/$base exists. | |
51 | exit 1 | |
52 | fi | |
53 | trap "rm $target/$base; exit" 1 2 3 | |
beca3d00 | 54 | ( cd .. ; ln -s mdadm.v2 mdadm-$version ; tar chvf - --exclude=.git --exclude="TAGS" --exclude='*~' --exclude=.patches --exclude='*,v' --exclude='*.o' --exclude mdadm --exclude=mdadm'.[^ch0-9]' --exclude=RCS mdadm-$version ; rm mdadm-$version ) | gzip --best > $target/$base |
56eedc1a NB |
55 | chmod a+r $target/$base |
56 | ls -l $target/$base | |
e5329c37 NB |
57 | if tar tzf $target/$base | sed 's,[^/]*/,,' | sort | diff -u inventory - |
58 | then : correct files found | |
8431b2b2 | 59 | else echo "Extra files, or inventory is out-of-date" |
e5329c37 NB |
60 | rm $target/$base |
61 | exit 1 | |
62 | fi | |
1e0d770c | 63 | rpmbuild -ta $target/$base || exit 1 |
56eedc1a NB |
64 | find /home/neilb/src/RPM -name "*mdadm-$version-*" \ |
65 | -exec cp {} $target/RPM \; | |
8431b2b2 NB |
66 | cp ANNOUNCE-$version $target/ANNOUNCE |
67 | cp ChangeLog $target/ChangeLog | |
1e0d770c NB |
68 | if [ " $arg" != " test" ] |
69 | then | |
70 | scp $target/$base master.kernel.org:/pub/linux/utils/raid/mdadm/mdadm-$version.tar.gz | |
71 | scp $target/ANNOUNCE $target/ChangeLog master.kernel.org:/pub/linux/utils/raid/mdadm/ | |
72 | fi | |
56eedc1a NB |
73 | else |
74 | if [ ! -f $target/$base ] | |
75 | then | |
76 | echo $target/$base does not exist. | |
77 | exit 1 | |
78 | fi | |
beca3d00 | 79 | ( cd .. ; ln -s mdadm.v2 mdadm-$version ; tar chf - --exclude=.git --exclude="TAGS" --exclude='*,v' --exclude='*~' --exclude='*.o' --exclude mdadm --exclude=mdadm'.[^ch0-9]' --exclude=RCS mdadm-$version ; rm mdadm-$version ) | gzip --best > /var/tmp/mdadm-new.tgz |
56eedc1a NB |
80 | mkdir /var/tmp/mdadm-old ; zcat $target/$base | ( cd /var/tmp/mdadm-old ; tar xf - ) |
81 | mkdir /var/tmp/mdadm-new ; zcat /var/tmp/mdadm-new.tgz | ( cd /var/tmp/mdadm-new ; tar xf - ) | |
82 | diff -ru /var/tmp/mdadm-old /var/tmp/mdadm-new | |
83 | rm -rf /var/tmp/mdadm-old /var/tmp/mdadm-new /var/tmp/mdadm-new.tgz | |
84 | fi |