| 1 |
#!/bin/bash
|
| 2 |
export TMP="${TMP:-/tmp}"
|
| 3 |
export V="1.7.1"
|
| 4 |
export DEST="${TMP}/rc-scripts-${V}"
|
| 5 |
|
| 6 |
if [[ $1 != "-f" ]] ; then
|
| 7 |
echo "Performing sanity checks (run with -f to skip) ..."
|
| 8 |
|
| 9 |
# Check for leftover conflicts
|
| 10 |
cvsfiles=$(find . -name '.#*')
|
| 11 |
if [[ -n ${cvsfiles} ]] ; then
|
| 12 |
echo "Refusing to package tarball until these files are removed:"
|
| 13 |
echo "$cvsfiles"
|
| 14 |
exit 1
|
| 15 |
fi
|
| 16 |
|
| 17 |
# Check that we're updated
|
| 18 |
cvsroot=$(<CVS/Root)
|
| 19 |
cvsroot=${cvsroot/-mux:/}
|
| 20 |
cvsfiles=$(cvs -d "$cvsroot" update 2>&1 | egrep -v '^(U|P)')
|
| 21 |
if [[ -n ${cvsfiles} ]] ; then
|
| 22 |
echo "Refusing to package tarball until cvs is in sync:"
|
| 23 |
echo "$cvsfiles"
|
| 24 |
exit 1
|
| 25 |
fi
|
| 26 |
fi
|
| 27 |
|
| 28 |
echo "Creating tarball ..."
|
| 29 |
rm -rf ${DEST}
|
| 30 |
install -d -m0755 ${DEST}
|
| 31 |
|
| 32 |
for x in bin etc init.d sbin src rc-lists man ; do
|
| 33 |
cp -ax $x ${DEST}
|
| 34 |
done
|
| 35 |
|
| 36 |
# do not yet package src/core stuff
|
| 37 |
rm -rf ${DEST}/src/core
|
| 38 |
|
| 39 |
# copy net-scripts and remove older stuff
|
| 40 |
install -d -m0755 ${DEST}/lib/rcscripts
|
| 41 |
cp -ax net-scripts/init.d ${DEST}
|
| 42 |
cp -ax net-scripts/net.modules.d ${DEST}/lib/rcscripts
|
| 43 |
cp -ax net-scripts/conf.d ${DEST}/etc
|
| 44 |
ln -sfn net.lo ${DEST}/init.d/net.eth0
|
| 45 |
|
| 46 |
cp ChangeLog ${DEST}
|
| 47 |
|
| 48 |
chown -R root:root ${DEST}
|
| 49 |
chmod 0755 ${DEST}/sbin/*
|
| 50 |
chmod 0755 ${DEST}/init.d/*
|
| 51 |
( cd $TMP/rc-scripts-${V} ; rm -rf `find -iname CVS` )
|
| 52 |
cd $TMP
|
| 53 |
tar cjvf ${TMP}/rc-scripts-${V}.tar.bz2 rc-scripts-${V}
|
| 54 |
rm -rf rc-scripts-${V}
|
| 55 |
|
| 56 |
echo
|
| 57 |
du -b ${TMP}/rc-scripts-${V}.tar.bz2
|