Subject: install/13293: makesrctars tweak
To: None <gnats-bugs@gnats.netbsd.org>
From: None <prlw1@cam.ac.uk>
List: netbsd-bugs
Date: 06/23/2001 20:47:47
>Number:         13293
>Category:       install
>Synopsis:       suggested tweaks to makesrctars
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    install-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jun 23 12:46:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Patrick Welche
>Release:        21 Jun 2001 13:33 GMT
>Organization:
>Environment:
NetBSD-1.5W/i386
>Description:
When you do a make snapshot, binary sets and installation kernels/disks are
built. Thereafter, if you want to package up the source onto your CD, you
may well run usr/src/distrib/sets/makesrctars which packages up the source
in SRCDIR and puts it in DESTDIR/sets. When building the snapshot, the
binaries are installed in DESTDIR, and the binary sets in RELEASEDIR, so it
seems to me that the cosmetic change of DESTDIR -> RELEASEDIR is sensible
from the point of view of clarity. I randomly decided that
RELEASEDIR/source/sets would be a good place to stick the tar files, cf
RELEASEDIR/binary/sets. Now, I haven't thought through building CDs for
mulitple ARCHs, but no doubt it would be trivial for someone in the know.
The next cosmetic change is to read /etc/mk.conf, which is probably where
you would already have defined RELEASEDIR. Adding SRCDIR=/usr/src to
/etc/mk.conf is all I did, but making use of BSDSRCDIR in
share/mk/bsd.own.mk might be a better idea..
>How-To-Repeat:
>Fix:
Index: makesrctars
===================================================================
RCS file: /cvsroot/basesrc/distrib/sets/makesrctars,v
retrieving revision 1.11
diff -p -r1.11 makesrctars
*** makesrctars	2000/08/06 13:22:16	1.11
--- makesrctars	2001/06/23 19:40:36
***************
*** 4,9 ****
--- 4,11 ----
  #
  # Make source code tarballs.
  
+ . /etc/mk.conf
+ 
  GZIP=--best
  export GZIP
  
*************** if [ -z "$SRCDIR" ]; then
*** 12,32 ****
  	exit 1
  fi
  
! if [ -z "$DESTDIR" ]; then
! 	echo DESTDIR must be set
  	exit 1
  fi
  
! if [ -d ${DESTDIR} ]; then
! 	echo "DESTDIR exists."
  	exit 1
  fi
  
  cd $SRCDIR
  
- mkdir ${DESTDIR}
- 
- mkdir ${DESTDIR}/sets
  
  find . \
      \! \( \( -path ./gnu -o -path ./share \) -prune \) \
--- 14,34 ----
  	exit 1
  fi
  
! if [ -z "$RELEASEDIR" ]; then
! 	echo RELEASEDIR must be set
  	exit 1
  fi
+ 
+ TARDIR=${RELEASEDIR}/source/sets
  
! if [ -d ${TARDIR} ]; then
! 	echo "${TARDIR} exists."
  	exit 1
  fi
+ mkdir -p ${TARDIR}
  
  cd $SRCDIR
  
  
  find . \
      \! \( \( -path ./gnu -o -path ./share \) -prune \) \
*************** find . \
*** 36,48 ****
      \! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
  	-print | \
  	sort | pax -w -d -s'|^\.|usr/src|' | gzip \
! 	> ${DESTDIR}/sets/src.tgz
  
  find gnu \
      \! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
  	-print | \
  	sort | pax -w -d -s'|^|usr/src/|' | gzip \
! 	> ${DESTDIR}/sets/gnusrc.tgz
  
  find sys usr.sbin/config usr.sbin/dbsym \
      \( \
--- 38,50 ----
      \! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
  	-print | \
  	sort | pax -w -d -s'|^\.|usr/src|' | gzip \
! 	> ${TARDIR}/src.tgz
  
  find gnu \
      \! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
  	-print | \
  	sort | pax -w -d -s'|^|usr/src/|' | gzip \
! 	> ${TARDIR}/gnusrc.tgz
  
  find sys usr.sbin/config usr.sbin/dbsym \
      \( \
*************** find sys usr.sbin/config usr.sbin/dbsym 
*** 53,69 ****
      ! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
  	-print | \
  	sort | pax -w -d -s'|^|usr/src/|' | gzip \
! 	> ${DESTDIR}/sets/syssrc.tgz
  
  find share \
      \! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
  	-print | \
  	sort | pax -w -d -s'|^|usr/src/|' | gzip \
! 	> ${DESTDIR}/sets/sharesrc.tgz
  
! (cd ${DESTDIR}/sets
   cksum -o1 *.tgz > BSDSUM
   cksum *.tgz > CKSUM
   cksum -o2 *.tgz > SYSVSUM
   md5 *.tgz > MD5)
! chmod 444 ${DESTDIR}/sets/*
--- 55,71 ----
      ! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
  	-print | \
  	sort | pax -w -d -s'|^|usr/src/|' | gzip \
! 	> ${TARDIR}/syssrc.tgz
  
  find share \
      \! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
  	-print | \
  	sort | pax -w -d -s'|^|usr/src/|' | gzip \
! 	> ${TARDIR}/sharesrc.tgz
  
! (cd ${TARDIR}
   cksum -o1 *.tgz > BSDSUM
   cksum *.tgz > CKSUM
   cksum -o2 *.tgz > SYSVSUM
   md5 *.tgz > MD5)
! chmod 444 ${TARDIR}/*
>Release-Note:
>Audit-Trail:
>Unformatted: