NetBSD Problem Report #18710

Received: (qmail 20083 invoked by uid 605); 19 Oct 2002 18:08:22 -0000
Message-Id: <20021019180819.2B11DA@proven.weird.com>
Date: Sat, 19 Oct 2002 14:08:19 -0400 (EDT)
From: woods@weird.com (Greg A. Woods)
Sender: gnats-bugs-owner@netbsd.org
Reply-To: woods@planix.com (Greg A. Woods)
To: gnats-bugs@gnats.netbsd.org
Subject: redo cleanup for pkgtools/pkg_tarup
X-Send-Pr-Version: 3.95

>Number:         18710
>Category:       pkg
>Synopsis:       redo cleanup for pkgtools/pkg_tarup
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 19 18:09:01 +0000 2002
>Closed-Date:    Sat Nov 23 22:47:42 +0000 2002
>Last-Modified:  Sat Nov 23 22:48:00 +0000 2002
>Originator:     Greg A. Woods
>Release:        pkgsrc-current 2002/10/18
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD
>Description:

	re-do cleanups for pkgtools/pkg_tarup

>How-To-Repeat:

>Fix:

cvs diff: Diffing pkgtools/pkg_tarup
Index: pkgtools/pkg_tarup/Makefile
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/pkgtools/pkg_tarup/Makefile,v
retrieving revision 1.7
diff -c -r1.7 Makefile
*** pkgtools/pkg_tarup/Makefile	14 Oct 2002 15:28:43 -0000	1.7
--- pkgtools/pkg_tarup/Makefile	16 Oct 2002 23:54:39 -0000
***************
*** 15,33 ****
  NO_BUILD=	yes
  NO_MTREE=	yes

! # Set SCRIPT_SUBST to substitute "${variable}" to "value" in MESSAGE
! SCRIPT_SUBST+=	AWK=${AWK}				\
! 		ECHO=${ECHO}				\
! 		ID=${ID}				\
! 		PKG_DBDIR=${PKG_DBDIR}			\
! 		PKG_SUFX=${PKG_SUFX}			\
! 		PREFIX=${PREFIX}			\
! 		PKG_TOOLS_BIN=${PKG_TOOLS_BIN}		\
! 		SH=${SH}				\
! 		SU=${SU}

! # XXX this should probably use the @VAR@ form instead of ${VAR}...
! SCRIPT_SUBST_SED=	${SCRIPT_SUBST:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/}

  do-configure:
  	${SED} ${SCRIPT_SUBST_SED}			\
--- 15,32 ----
  NO_BUILD=	yes
  NO_MTREE=	yes

! # Set SCRIPT_SUBST to substitute "@VARIABLE@" with "value"
! SCRIPT_SUBST+=	AWK=${AWK:Q}				\
! 		ECHO=${ECHO:Q}				\
! 		ID=${ID:Q}				\
! 		PKG_DBDIR=${PKG_DBDIR:Q}		\
! 		PKG_SUFX=${PKG_SUFX:Q}			\
! 		PREFIX=${PREFIX:Q}			\
! 		PKG_TOOLS_BIN=${PKG_TOOLS_BIN:Q}	\
! 		SH=${SH:Q}				\
! 		SU=${SU:Q}

! SCRIPT_SUBST_SED=	${SCRIPT_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}

  do-configure:
  	${SED} ${SCRIPT_SUBST_SED}			\
cvs diff: Diffing pkgtools/pkg_tarup/files
Index: pkgtools/pkg_tarup/files/pkg_tarup
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/pkgtools/pkg_tarup/files/pkg_tarup,v
retrieving revision 1.7
diff -c -r1.7 pkg_tarup
*** pkgtools/pkg_tarup/files/pkg_tarup	14 Oct 2002 15:28:43 -0000	1.7
--- pkgtools/pkg_tarup/files/pkg_tarup	16 Oct 2002 23:57:26 -0000
***************
*** 1,4 ****
! #! ${SH}
  #
  # $Id: pkg_tarup,v 1.7 2002/10/14 15:28:43 hubertf Exp $
  #
--- 1,4 ----
! #! @SH@
  #
  # $Id: pkg_tarup,v 1.7 2002/10/14 15:28:43 hubertf Exp $
  #
***************
*** 7,29 ****
  # (c) Copyright 2000-2002 Hubert Feyrer <hubert@feyrer.de>
  #

! PATH=/sbin:/usr/sbin:/bin:/usr/bin:${PREFIX}/sbin:${PREFIX}/bin:${PKG_TOOLS_BIN}

! if [ `${ID} -u` != 0 ]; then
! 	${ECHO} "Becoming root@`/bin/hostname` to create a binary package"
! 	${ECHO} -n "`${ECHO} ${SU} | ${AWK} '{ print $$1 }'` ";\
! 	exec ${SU} root -c "$0 $@"
  fi

! pkgdbdir=${PKG_DBDIR:-${PKG_DBDIR}}
! pkgsufx=${PKG_SUFX:-${PKG_SUFX}}

  PKGREPOSITORY=${PKGREPOSITORY:-/tmp}

  PKG="$1"
  rPKG="`pkg_info -e \"$PKG\"`"

! if [ "$PKG" = "" -o "$rPKG" = "" -o -f "${pkgdbdir}/${rPKG}" ]
  then
       ${ECHO} Usage: $0 installed_pkg
       exit 1
--- 7,39 ----
  # (c) Copyright 2000-2002 Hubert Feyrer <hubert@feyrer.de>
  #

! PREFIX=${PREFIX:-@PREFIX@}

! PATH=/sbin:/usr/sbin:/bin:/usr/bin:${PREFIX}/sbin:${PREFIX}/bin:@PKG_TOOLS_BIN@
! export PATH
! 
! OS=`uname -s`
! 
! awkprog=${AWK:-@AWK@}
! echoprog=${ECHO:-@ECHO@}
! idprog=${ID:-@ID@}
! suprog=${SU:-@SU@}
! 
! if [ `${idprog} -u` != 0 ]; then
! 	${echoprog} "Becoming root@`/bin/hostname` to create a binary package"
! 	${echoprog} -n "`${echoprog} ${suprog} | ${awkprog} '{ print $$1 }'` ";\
! 	exec ${suprog} root -c "$0 $@"
  fi

! pkgdbdir=${PKG_DBDIR:-@PKG_DBDIR@}
! pkgsufx=${PKG_SUFX:-@PKG_SUFX@}

  PKGREPOSITORY=${PKGREPOSITORY:-/tmp}

  PKG="$1"
  rPKG="`pkg_info -e \"$PKG\"`"

! if [ "$PKG" = "" -o "$rPKG" = "" -o -f "${PKG_DBDIR}/${rPKG}" ]
  then
       ${ECHO} Usage: $0 installed_pkg
       exit 1
***************
*** 48,71 ****
  	fi
  }

! check_and_add -c ${pkgdbdir}/${PKG}/+COMMENT
! check_and_add -d ${pkgdbdir}/${PKG}/+DESC
! check_and_add -b ${pkgdbdir}/${PKG}/+BUILD_VERSION
! check_and_add -B ${pkgdbdir}/${PKG}/+BUILD_INFO
! check_and_add -s ${pkgdbdir}/${PKG}/+SIZE_PKG
! check_and_add -S ${pkgdbdir}/${PKG}/+SIZE_ALL
! check_and_add -i ${pkgdbdir}/${PKG}/+INSTALL
! check_and_add -k ${pkgdbdir}/${PKG}/+DEINSTALL
! check_and_add -r ${pkgdbdir}/${PKG}/+REQUIRE
! check_and_add -D ${pkgdbdir}/${PKG}/+DISPLAY
! check_and_add -m ${pkgdbdir}/${PKG}/+MTREE		#NOTYET#

  PLIST=/tmp/+CONTENTS.$$
  sed -n \
      -e '/^@comment MD5:/d' \
      -e '/^@cwd \.$/,$d' \
      -e '/\$NetBSD/,$p' \
!     <${pkgdbdir}/${PKG}/+CONTENTS >$PLIST

  # Duplicate first @cwd (work around pkg_create "feature" ...)
  grep '^@cwd' $PLIST | head -1 >$PLIST.1
--- 58,81 ----
  	fi
  }

! check_and_add -c ${PKG_DBDIR}/${PKG}/+COMMENT
! check_and_add -d ${PKG_DBDIR}/${PKG}/+DESC
! check_and_add -b ${PKG_DBDIR}/${PKG}/+BUILD_VERSION
! check_and_add -B ${PKG_DBDIR}/${PKG}/+BUILD_INFO
! check_and_add -s ${PKG_DBDIR}/${PKG}/+SIZE_PKG
! check_and_add -S ${PKG_DBDIR}/${PKG}/+SIZE_ALL
! check_and_add -i ${PKG_DBDIR}/${PKG}/+INSTALL
! check_and_add -k ${PKG_DBDIR}/${PKG}/+DEINSTALL
! check_and_add -r ${PKG_DBDIR}/${PKG}/+REQUIRE
! check_and_add -D ${PKG_DBDIR}/${PKG}/+DISPLAY
! check_and_add -m ${PKG_DBDIR}/${PKG}/+MTREE		#NOTYET#

  PLIST=/tmp/+CONTENTS.$$
  sed -n \
      -e '/^@comment MD5:/d' \
      -e '/^@cwd \.$/,$d' \
      -e '/\$NetBSD/,$p' \
!     <${PKG_DBDIR}/${PKG}/+CONTENTS >$PLIST

  # Duplicate first @cwd (work around pkg_create "feature" ...)
  grep '^@cwd' $PLIST | head -1 >$PLIST.1
***************
*** 100,114 ****
  exit 0




  mtree file considerations:
   - keeping uncompressed mtree file adds ~10% to the size of /var/db/pkg
   - could gzip file, space saving: 5kb->850b (plus some intelligence to
     uncompress them when needed)
   - not keeping mtree file results in pkgs w/o mtree file (but should work)

  integration:
   - how/where?  I'd prefer not to have yet another pkg_* utility flying
     around, integration into pkg_admin would be nice.  But how merge a
!    shell script into a C executable?
--- 110,132 ----
  exit 0


+ +REQUIRED_BY:
+ 
+  - maybe the squirelling away of +REQUIRED_BY should be done here
+    instead of in the bsd.pkg.mk framework that normally calls this.


  mtree file considerations:
+ 
   - keeping uncompressed mtree file adds ~10% to the size of /var/db/pkg
+ 
   - could gzip file, space saving: 5kb->850b (plus some intelligence to
     uncompress them when needed)
+ 
   - not keeping mtree file results in pkgs w/o mtree file (but should work)

  integration:
+ 
   - how/where?  I'd prefer not to have yet another pkg_* utility flying
     around, integration into pkg_admin would be nice.  But how merge a
!    shell script into a C executable?  REWRITE in C of course!  ;-)
>Release-Note:
>Audit-Trail:

From: woods@weird.com (Greg A. Woods)
To: gnats-bugs@gnats.netbsd.org (NetBSD GNATS submissions and followups),
  pkg-manager@netbsd.org
Cc: netbsd-bugs@NetBSD.ORG (NetBSD Bugs and PR posting List)
Subject: Re: pkg/18710: redo cleanup for pkgtools/pkg_tarup
Date: Sat, 19 Oct 2002 14:53:35 -0400 (EDT)

 Oops!  Ignore the diff in the original PR.  It's wrong diff made in the
 wrong working directory!  That'll teach me for not actually reading the
 diffs!  ;-)


 Index: pkgtools/pkg_tarup/Makefile
 ===================================================================
 RCS file: /cvs/master/m-NetBSD/main/pkgsrc/pkgtools/pkg_tarup/Makefile,v
 retrieving revision 1.7
 diff -c -r1.7 Makefile
 *** pkgtools/pkg_tarup/Makefile	14 Oct 2002 15:28:43 -0000	1.7
 --- pkgtools/pkg_tarup/Makefile	16 Oct 2002 23:54:39 -0000
 ***************
 *** 15,33 ****
   NO_BUILD=	yes
   NO_MTREE=	yes

 ! # Set SCRIPT_SUBST to substitute "${variable}" to "value" in MESSAGE
 ! SCRIPT_SUBST+=	AWK=${AWK}				\
 ! 		ECHO=${ECHO}				\
 ! 		ID=${ID}				\
 ! 		PKG_DBDIR=${PKG_DBDIR}			\
 ! 		PKG_SUFX=${PKG_SUFX}			\
 ! 		PREFIX=${PREFIX}			\
 ! 		PKG_TOOLS_BIN=${PKG_TOOLS_BIN}		\
 ! 		SH=${SH}				\
 ! 		SU=${SU}

 ! # XXX this should probably use the @VAR@ form instead of ${VAR}...
 ! SCRIPT_SUBST_SED=	${SCRIPT_SUBST:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/}

   do-configure:
   	${SED} ${SCRIPT_SUBST_SED}			\
 --- 15,32 ----
   NO_BUILD=	yes
   NO_MTREE=	yes

 ! # Set SCRIPT_SUBST to substitute "@VARIABLE@" with "value"
 ! SCRIPT_SUBST+=	AWK=${AWK:Q}				\
 ! 		ECHO=${ECHO:Q}				\
 ! 		ID=${ID:Q}				\
 ! 		PKG_DBDIR=${PKG_DBDIR:Q}		\
 ! 		PKG_SUFX=${PKG_SUFX:Q}			\
 ! 		PREFIX=${PREFIX:Q}			\
 ! 		PKG_TOOLS_BIN=${PKG_TOOLS_BIN:Q}	\
 ! 		SH=${SH:Q}				\
 ! 		SU=${SU:Q}

 ! SCRIPT_SUBST_SED=	${SCRIPT_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}

   do-configure:
   	${SED} ${SCRIPT_SUBST_SED}			\
 Index: pkgtools/pkg_tarup/files/pkg_tarup
 ===================================================================
 RCS file: /cvs/master/m-NetBSD/main/pkgsrc/pkgtools/pkg_tarup/files/pkg_tarup,v
 retrieving revision 1.7
 diff -c -r1.7 pkg_tarup
 *** pkgtools/pkg_tarup/files/pkg_tarup	14 Oct 2002 15:28:43 -0000	1.7
 --- pkgtools/pkg_tarup/files/pkg_tarup	19 Oct 2002 18:46:08 -0000
 ***************
 *** 1,4 ****
 ! #! ${SH}
   #
   # $Id: pkg_tarup,v 1.7 2002/10/14 15:28:43 hubertf Exp $
   #
 --- 1,4 ----
 ! #! @SH@
   #
   # $Id: pkg_tarup,v 1.7 2002/10/14 15:28:43 hubertf Exp $
   #
 ***************
 *** 7,13 ****
   # (c) Copyright 2000-2002 Hubert Feyrer <hubert@feyrer.de>
   #

 ! PATH=/sbin:/usr/sbin:/bin:/usr/bin:${PREFIX}/sbin:${PREFIX}/bin:${PKG_TOOLS_BIN}

   if [ `${ID} -u` != 0 ]; then
   	${ECHO} "Becoming root@`/bin/hostname` to create a binary package"
 --- 7,23 ----
   # (c) Copyright 2000-2002 Hubert Feyrer <hubert@feyrer.de>
   #

 ! PREFIX=${PREFIX:-@PREFIX@}
 ! 
 ! PATH=/sbin:/usr/sbin:/bin:/usr/bin:${PREFIX}/sbin:${PREFIX}/bin:@PKG_TOOLS_BIN@
 ! export PATH
 ! 
 ! OS=`uname -s`
 ! 
 ! AWK=${AWK:-@AWK@}
 ! ECHO=${ECHO:-@ECHO@}
 ! ID=${ID:-@ID@}
 ! SU=${SU:-@SU@}

   if [ `${ID} -u` != 0 ]; then
   	${ECHO} "Becoming root@`/bin/hostname` to create a binary package"
 ***************
 *** 15,29 ****
   	exec ${SU} root -c "$0 $@"
   fi

 ! pkgdbdir=${PKG_DBDIR:-${PKG_DBDIR}}
 ! pkgsufx=${PKG_SUFX:-${PKG_SUFX}}

   PKGREPOSITORY=${PKGREPOSITORY:-/tmp}

   PKG="$1"
   rPKG="`pkg_info -e \"$PKG\"`"

 ! if [ "$PKG" = "" -o "$rPKG" = "" -o -f "${pkgdbdir}/${rPKG}" ]
   then
        ${ECHO} Usage: $0 installed_pkg
        exit 1
 --- 25,39 ----
   	exec ${SU} root -c "$0 $@"
   fi

 ! PKG_DBDIR=${PKG_DBDIR:-@PKG_DBDIR@}
 ! PKG_SUFX=${PKG_SUFX:-@PKG_SUFX@}

   PKGREPOSITORY=${PKGREPOSITORY:-/tmp}

   PKG="$1"
   rPKG="`pkg_info -e \"$PKG\"`"

 ! if [ "$PKG" = "" -o "$rPKG" = "" -o -f "${PKG_DBDIR}/${rPKG}" ]
   then
        ${ECHO} Usage: $0 installed_pkg
        exit 1
 ***************
 *** 48,71 ****
   	fi
   }

 ! check_and_add -c ${pkgdbdir}/${PKG}/+COMMENT
 ! check_and_add -d ${pkgdbdir}/${PKG}/+DESC
 ! check_and_add -b ${pkgdbdir}/${PKG}/+BUILD_VERSION
 ! check_and_add -B ${pkgdbdir}/${PKG}/+BUILD_INFO
 ! check_and_add -s ${pkgdbdir}/${PKG}/+SIZE_PKG
 ! check_and_add -S ${pkgdbdir}/${PKG}/+SIZE_ALL
 ! check_and_add -i ${pkgdbdir}/${PKG}/+INSTALL
 ! check_and_add -k ${pkgdbdir}/${PKG}/+DEINSTALL
 ! check_and_add -r ${pkgdbdir}/${PKG}/+REQUIRE
 ! check_and_add -D ${pkgdbdir}/${PKG}/+DISPLAY
 ! check_and_add -m ${pkgdbdir}/${PKG}/+MTREE		#NOTYET#

   PLIST=/tmp/+CONTENTS.$$
   sed -n \
       -e '/^@comment MD5:/d' \
       -e '/^@cwd \.$/,$d' \
       -e '/\$NetBSD/,$p' \
 !     <${pkgdbdir}/${PKG}/+CONTENTS >$PLIST

   # Duplicate first @cwd (work around pkg_create "feature" ...)
   grep '^@cwd' $PLIST | head -1 >$PLIST.1
 --- 58,81 ----
   	fi
   }

 ! check_and_add -c ${PKG_DBDIR}/${PKG}/+COMMENT
 ! check_and_add -d ${PKG_DBDIR}/${PKG}/+DESC
 ! check_and_add -b ${PKG_DBDIR}/${PKG}/+BUILD_VERSION
 ! check_and_add -B ${PKG_DBDIR}/${PKG}/+BUILD_INFO
 ! check_and_add -s ${PKG_DBDIR}/${PKG}/+SIZE_PKG
 ! check_and_add -S ${PKG_DBDIR}/${PKG}/+SIZE_ALL
 ! check_and_add -i ${PKG_DBDIR}/${PKG}/+INSTALL
 ! check_and_add -k ${PKG_DBDIR}/${PKG}/+DEINSTALL
 ! check_and_add -r ${PKG_DBDIR}/${PKG}/+REQUIRE
 ! check_and_add -D ${PKG_DBDIR}/${PKG}/+DISPLAY
 ! check_and_add -m ${PKG_DBDIR}/${PKG}/+MTREE		#NOTYET#

   PLIST=/tmp/+CONTENTS.$$
   sed -n \
       -e '/^@comment MD5:/d' \
       -e '/^@cwd \.$/,$d' \
       -e '/\$NetBSD/,$p' \
 !     <${PKG_DBDIR}/${PKG}/+CONTENTS >$PLIST

   # Duplicate first @cwd (work around pkg_create "feature" ...)
   grep '^@cwd' $PLIST | head -1 >$PLIST.1
 ***************
 *** 94,114 ****
   	-p "`pkg_info -qp ${PKG} | ${AWK} 'NR == 1 { print $2; exit }'`" \
   	-P "`pkg_info -qf ${PKG} | ${AWK} '/^@pkgdep/ { print $2 }'`" \
   	-C "`pkg_info -qf ${PKG} | ${AWK} '/^@pkgcfl/ { print $2 }'`" \
 ! 	${PKGREPOSITORY}/${PKG}${pkgsufx}

   rm -f ${PLIST}
   exit 0




   mtree file considerations:
    - keeping uncompressed mtree file adds ~10% to the size of /var/db/pkg
    - could gzip file, space saving: 5kb->850b (plus some intelligence to
      uncompress them when needed)
    - not keeping mtree file results in pkgs w/o mtree file (but should work)

   integration:
    - how/where?  I'd prefer not to have yet another pkg_* utility flying
      around, integration into pkg_admin would be nice.  But how merge a
 !    shell script into a C executable?
 --- 104,132 ----
   	-p "`pkg_info -qp ${PKG} | ${AWK} 'NR == 1 { print $2; exit }'`" \
   	-P "`pkg_info -qf ${PKG} | ${AWK} '/^@pkgdep/ { print $2 }'`" \
   	-C "`pkg_info -qf ${PKG} | ${AWK} '/^@pkgcfl/ { print $2 }'`" \
 ! 	${PKGREPOSITORY}/${PKG}${PKG_SUFX}

   rm -f ${PLIST}
   exit 0


 + +REQUIRED_BY:
 + 
 +  - maybe the squirelling away of +REQUIRED_BY should be done here
 +    instead of in the bsd.pkg.mk framework that normally calls this.


   mtree file considerations:
 + 
    - keeping uncompressed mtree file adds ~10% to the size of /var/db/pkg
 + 
    - could gzip file, space saving: 5kb->850b (plus some intelligence to
      uncompress them when needed)
 + 
    - not keeping mtree file results in pkgs w/o mtree file (but should work)

   integration:
 + 
    - how/where?  I'd prefer not to have yet another pkg_* utility flying
      around, integration into pkg_admin would be nice.  But how merge a
 !    shell script into a C executable?  REWRITE in C of course!  ;-)


 -- 
 								Greg A. Woods

 +1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
 Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>
State-Changed-From-To: open->closed 
State-Changed-By: wiz 
State-Changed-When: Sat Nov 23 14:47:23 PST 2002 
State-Changed-Why:  
Applied the diff -- thanks! 

From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pr/18710 CVS commit: pkgsrc/pkgtools/pkg_tarup
Date: Sun, 24 Nov 2002 00:47:04 +0200 (EET)

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Sat Nov 23 22:47:03 UTC 2002

 Modified Files:
 	pkgsrc/pkgtools/pkg_tarup: Makefile
 	pkgsrc/pkgtools/pkg_tarup/files: pkg_tarup

 Log Message:
 Some cleanups by Greg A. Woods in PR 18710.


 To generate a diff of this commit:
 cvs rdiff -r1.7 -r1.8 pkgsrc/pkgtools/pkg_tarup/Makefile
 cvs rdiff -r1.7 -r1.8 pkgsrc/pkgtools/pkg_tarup/files/pkg_tarup

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.