]> git.ipfire.org Git - thirdparty/mdadm.git/blame - makedist
imsm: fix spare promotion
[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 {
b9d77223
N
19 echo mdadm.8 does not mention version $version.
20 exit 1
21 }
22grep "^.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
27rpmv=`echo $version | tr - _`
28grep "^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
33if [ -f ANNOUNCE-$version ]
34then :
35else
e5329c37 36 echo ANNOUNCE-$version does not exist
56eedc1a
NB
37 exit 1
38fi
e5329c37
NB
39if grep "^ANNOUNCE-$version\$" inventory
40then :
41else { cat inventory ; echo ANNOUNCE-$version ; } | sort -o inventory
42fi
56eedc1a 43
52826846 44echo version = $version
9a9dab36 45base=mdadm-$version.tgz
56eedc1a
NB
46if [ " $arg" != " diff" ]
47then
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
73else
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
84fi