Subject: misc/14958: minor improvements to distrib/sets/makesrctars
To: None <gnats-bugs@gnats.netbsd.org>
From: None <apb@cequrux.com>
List: netbsd-bugs
Date: 12/15/2001 17:12:49
>Number:         14958
>Category:       misc
>Synopsis:       minor improvements to distrib/sets/makesrctars
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 15 07:14:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Alan Barrett
>Release:        NetBSD 1.5Y
>Organization:
Not much
>Environment:
>Description:
distrib/sets/makesrctars exits with an error if DESTDIR exists.  The
error seems unnecessary, and the offending "exit 1" is commented out by
the patch below.  It might make more sense to put the tar files into
${RELEASEDIR}/source/sets rather that ${DESTDIR}/sets, but this patch
does not make that change.

Sorting can be done more efficiently with "find -s" than with "find |
sort".

>How-To-Repeat:
Code inspection.
>Fix:
Index: distrib/sets/makesrctars
--- distrib/sets/makesrctars	2000/08/06 13:22:16	1.11
+++ distrib/sets/makesrctars	2001/12/15 15:08:04
@@ -19,7 +19,7 @@
 
 if [ -d ${DESTDIR} ]; then
 	echo "DESTDIR exists."
-	exit 1
+	#exit 1 # not an error
 fi
 
 cd $SRCDIR
@@ -28,23 +28,23 @@
 
 mkdir ${DESTDIR}/sets
 
-find . \
+find -s . \
     \! \( \( -path ./gnu -o -path ./share \) -prune \) \
     \! \( -path ./sys -prune \) \
     \! \( -path ./usr.sbin/config -prune \) \
     \! \( -path ./usr.sbin/dbsym -prune \) \
     \! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
 	-print | \
-	sort | pax -w -d -s'|^\.|usr/src|' | gzip \
+	pax -w -d -s'|^\.|usr/src|' | gzip \
 	> ${DESTDIR}/sets/src.tgz
 
-find gnu \
+find -s gnu \
     \! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
 	-print | \
-	sort | pax -w -d -s'|^|usr/src/|' | gzip \
+	pax -w -d -s'|^|usr/src/|' | gzip \
 	> ${DESTDIR}/sets/gnusrc.tgz
 
-find sys usr.sbin/config usr.sbin/dbsym \
+find -s sys usr.sbin/config usr.sbin/dbsym \
     \( \
 	-path 'sys/arch/*/compile/CVS' -o \
 	-name .keep_me -o \
@@ -52,13 +52,13 @@
     \) \
     ! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
 	-print | \
-	sort | pax -w -d -s'|^|usr/src/|' | gzip \
+	pax -w -d -s'|^|usr/src/|' | gzip \
 	> ${DESTDIR}/sets/syssrc.tgz
 
-find share \
+find -s share \
     \! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
 	-print | \
-	sort | pax -w -d -s'|^|usr/src/|' | gzip \
+	pax -w -d -s'|^|usr/src/|' | gzip \
 	> ${DESTDIR}/sets/sharesrc.tgz
 
 (cd ${DESTDIR}/sets
>Release-Note:
>Audit-Trail:
>Unformatted: