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