diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-12-25 01:30:23 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-12-25 01:30:23 +0000 |
commit | 51ebb3d68404941a592e292227ce12f829ceabe7 (patch) | |
tree | ea349bf082eba6aa4cb3b111e331e2bc2cbf4fbf | |
parent | 86909eb90c959a61b8b74980ae25582ba58b879f (diff) |
convert mkr/ckr to shell scripts, use mktemp(1)
-rw-r--r-- | distrib/sets/checkflist | 19 | ||||
-rw-r--r-- | distrib/sets/makeflist | 33 | ||||
-rw-r--r-- | distrib/sets/maketars | 51 | ||||
-rw-r--r-- | etc/Makefile | 4 |
4 files changed, 39 insertions, 68 deletions
diff --git a/distrib/sets/checkflist b/distrib/sets/checkflist index 14aefd9ae18..d1e4f52b54e 100644 --- a/distrib/sets/checkflist +++ b/distrib/sets/checkflist @@ -1,15 +1,14 @@ -#!/bin/csh -f -# $OpenBSD: checkflist,v 1.3 2000/03/01 22:10:08 todd Exp $ +#!/bin/sh -x +# $OpenBSD: checkflist,v 1.4 2001/12/25 01:30:22 deraadt Exp $ - -if (! $?DESTDIR) then +if [ "X${DESTDIR}" = "X" ]; then echo DESTDIR must be set exit 1 -endif +fi -set fsdir=$DESTDIR +TMP=`mktemp /tmp/_ckr.XXXXXX` || exit 1 +trap 'rm -f $TMP' 0 1 15 -csh makeflist >! /tmp/_CHECK.$$ -( cd $fsdir ; find . \( -type d -o -type f -o -type l \) ) | sort | \ - diff /tmp/_CHECK.$$ - -/bin/rm -f /tmp/_CHECK.$$ +sh makeflist > $TMP +( cd $DESTDIR ; find . \( -type d -o -type f -o -type l \) ) | sort | \ + diff $TMP - diff --git a/distrib/sets/makeflist b/distrib/sets/makeflist index 86e8f70cf6f..035440b70e2 100644 --- a/distrib/sets/makeflist +++ b/distrib/sets/makeflist @@ -1,26 +1,15 @@ -#!/bin/csh -f -# $OpenBSD: makeflist,v 1.5 2000/03/01 22:10:08 todd Exp $ +#!/bin/sh +# $OpenBSD: makeflist,v 1.6 2001/12/25 01:30:22 deraadt Exp $ +arch=`machine` -set arch=`machine` -set listsdir=`pwd`/lists +TMP=`mktemp /tmp/_mkr.XXXXXX` || exit 1 +trap 'rm -f $TMP' 0 1 15 -set TMPFILE=/tmp/_LIST.$$ +for i in base comp etc game; do + cat ./lists/$i/mi ./lists/$i/md.${arch} >> $TMP +done +cat ./lists/man/mi ./lists/man/md.${arch} >> $TMP +cat ./lists/misc/mi ./lists/misc/md.${arch} >> $TMP -set lists=(base comp etc game) -# SPECIAL: man misc - -foreach setname ($lists) - cat $listsdir/$setname/mi $listsdir/$setname/md.${arch} >>! $TMPFILE -end - -set setname=man -grep ${arch} $listsdir/man/md_share | \ - cat $listsdir/$setname/mi $listsdir/$setname/md.${arch} - >>! $TMPFILE - -set setname=misc -grep -v ${arch} $listsdir/man/md_share | \ - cat $listsdir/$setname/mi $listsdir/$setname/md.${arch} - >>! $TMPFILE - -sort $TMPFILE -/bin/rm $TMPFILE +sort $TMP diff --git a/distrib/sets/maketars b/distrib/sets/maketars index f1c77a4bdbd..32ed1b9df7a 100644 --- a/distrib/sets/maketars +++ b/distrib/sets/maketars @@ -1,51 +1,34 @@ #!/bin/csh -f -# $OpenBSD: maketars,v 1.12 2000/04/26 02:11:54 deraadt Exp $ +# $OpenBSD: maketars,v 1.13 2001/12/25 01:30:22 deraadt Exp $ -set RELEASE=$1 +RELEASE=$1 -if ( "X${RELEASE}" == "X" ) then +if [ "X${RELEASE}" == "X" ]; then echo "Usage: `basename $0` <OSREVISION>" exit 1 -endif +fi -if (! $?RELEASEDIR) then +if [ "X${RELEASEDIR}" = "X" ]; then echo RELEASEDIR must be set exit 1 -endif +fi -if (! $?DESTDIR) then +if [ "X${DESTDIR}" = "X" ]; then echo DESTDIR must be set exit 1 -endif +fi -set arch=`machine` -set listsdir=`pwd`/lists -set tardir=$RELEASEDIR -set fsdir=$DESTDIR +arch=`machine` +lists=`pwd`/lists +tardir=$RELEASEDIR +fsdir=$DESTDIR cd $fsdir -set lists=(base comp etc game) -# SPECIAL: man misc - -foreach setname ($lists) - echo -n "${setname}: " - cat $listsdir/$setname/mi $listsdir/$setname/md.${arch} | sort | \ - pax -w -d | gzip -9 > ${tardir}/${setname}${RELEASE}.tgz +for i in base comp etc game man misc; do + echo -n "$i: " + cat ${lists}/$i/mi ${lists}/$i/md.${arch} | sort | \ + pax -w -d | gzip -9 > ${tardir}/$i${RELEASE}.tgz echo "done." -end - -set setname=man -echo -n "${setname}: " -grep ${arch} $listsdir/man/md_share | \ - cat $listsdir/$setname/mi $listsdir/$setname/md.${arch} - | sort | \ - pax -w -d | gzip -9 > ${tardir}/${setname}${RELEASE}.tgz -echo "done." - -set setname=misc -echo -n "${setname}: " -grep -v ${arch} $listsdir/man/md_share | \ - cat $listsdir/$setname/mi $listsdir/$setname/md.${arch} - | sort | \ - pax -w -d | gzip -9 > ${tardir}/${setname}${RELEASE}.tgz -echo "done." +done diff --git a/etc/Makefile b/etc/Makefile index 700d82d0ef5..39e2cb80177 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.134 2001/12/24 09:41:31 deraadt Exp $ +# $OpenBSD: Makefile,v 1.135 2001/12/25 01:30:22 deraadt Exp $ TZDIR= /usr/share/zoneinfo LOCALTIME= US/Pacific @@ -254,7 +254,7 @@ release: .else release: distribution snap_pre snap_md cd ${.CURDIR}/../distrib/notes; ${MAKE}; ${MAKE} install - cd ${.CURDIR}/../distrib/sets; csh -f maketars ${OSrev} + cd ${.CURDIR}/../distrib/sets; sh maketars ${OSrev} -cp ${DESTDIR}/snapshot/bsd* ${RELEASEDIR} -cp ${DESTDIR}/snapshot/*boot* ${RELEASEDIR} -cp ${DESTDIR}/snapshot/*BOOT* ${RELEASEDIR} |