pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_tarup Updated pkg_tarup to 1.7.1.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/56224dff4dea
branches:  trunk
changeset: 538552:56224dff4dea
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Feb 12 15:03:28 2008 +0000

description:
Updated pkg_tarup to 1.7.1.

Changes since 1.7:
- bail out if the ROOT_USER doesn't exist.
- Made the package Makefile a little shorter.

diffstat:

 pkgtools/pkg_tarup/Makefile        |  42 +++++++++----------------------------
 pkgtools/pkg_tarup/files/pkg_tarup |  10 +++++++-
 2 files changed, 18 insertions(+), 34 deletions(-)

diffs (90 lines):

diff -r 32e4e43a2101 -r 56224dff4dea pkgtools/pkg_tarup/Makefile
--- a/pkgtools/pkg_tarup/Makefile       Tue Feb 12 14:56:41 2008 +0000
+++ b/pkgtools/pkg_tarup/Makefile       Tue Feb 12 15:03:28 2008 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.33 2008/02/06 22:39:43 joerg Exp $
+# $NetBSD: Makefile,v 1.34 2008/02/12 15:03:28 rillig Exp $
 
-DISTNAME=      pkg_tarup-1.7
+DISTNAME=      pkg_tarup-1.7.1
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
 DISTFILES=     # empty
@@ -11,43 +11,21 @@
 PKG_DESTDIR_SUPPORT=   user-destdir
 
 WRKSRC=                ${WRKDIR}
-EXTRACT_ONLY=  # empty
 NO_CHECKSUM=   yes
 NO_BUILD=      yes
 NO_MTREE=      yes
 USE_LANGUAGES= # none
+AUTO_MKDIRS=   yes
 
 # Set SCRIPT_SUBST to substitute "@VARIABLE@" with "value"
-SCRIPT_SUBST+= \
-               ECHO=${ECHO:Q}                          \
-               ECHO_N=${ECHO_N:Q}                      \
-               GREP=${GREP:Q}                          \
-               HEAD=${HEAD:Q}                          \
-               ID=${ID:Q}                              \
-               PKG_DBDIR=${PKG_DBDIR:Q}                \
-               PKG_SUFX=${PKG_SUFX:Q}                  \
-               PREFIX=${PREFIX:Q}                      \
-               PKG_TOOLS_BIN=${PKG_TOOLS_BIN:Q}        \
-               ROOT_USER=${REAL_ROOT_USER:Q}           \
-               SED=${SED:Q}                            \
-               SH=${SH:Q}                              \
-               SU_CMD=${SU_CMD:Q}                      \
-               XARGS=${XARGS:Q}
+SUBST_CLASSES+=        tarup
+SUBST_STAGE.tarup=     do-configure
+SUBST_FILES.tarup=     pkg_tarup pkg_tarup_all pkg_tarup.1
+SUBST_VARS.tarup=      ECHO ECHO_N GREP HEAD ID PKG_DBDIR PKG_SUFX PKG_TOOLS_BIN PREFIX SED SH SU_CMD XARGS
+SUBST_SED.tarup=       -e 's,@ROOT_USER@,${REAL_ROOT_USER},g'
 
-SCRIPT_SUBST_SED=      ${SCRIPT_SUBST:S/=/@!/:S/$/!g/:S/^/ -e s!@/}
-
-INSTALLATION_DIRS=     bin ${PKGMANDIR}/man1
-
-do-configure:
-       ${SED} ${SCRIPT_SUBST_SED}                      \
-                       < ${FILESDIR}/pkg_tarup         \
-                       > ${WRKSRC}/pkg_tarup
-       ${SED} ${SCRIPT_SUBST_SED}                      \
-                       < ${FILESDIR}/pkg_tarup_all     \
-                       > ${WRKSRC}/pkg_tarup_all
-       ${SED} ${SCRIPT_SUBST_SED}                      \
-                       < ${FILESDIR}/pkg_tarup.1   \
-                       > ${WRKSRC}/pkg_tarup.1
+do-extract:
+       cd ${FILESDIR} && cp pkg_tarup pkg_tarup.1 pkg_tarup_all ${WRKSRC}/
 
 do-install:
        ${INSTALL_SCRIPT} ${WRKSRC}/pkg_tarup ${DESTDIR}${PREFIX}/bin
diff -r 32e4e43a2101 -r 56224dff4dea pkgtools/pkg_tarup/files/pkg_tarup
--- a/pkgtools/pkg_tarup/files/pkg_tarup        Tue Feb 12 14:56:41 2008 +0000
+++ b/pkgtools/pkg_tarup/files/pkg_tarup        Tue Feb 12 15:03:28 2008 +0000
@@ -1,6 +1,6 @@
 #! @SH@
 #
-# $Id: pkg_tarup,v 1.21 2008/02/06 22:39:43 joerg Exp $
+# $Id: pkg_tarup,v 1.22 2008/02/12 15:03:29 rillig Exp $
 #
 # Tar up installed package
 #
@@ -26,7 +26,13 @@
 GREP=${GREP:-@GREP@}
 XARGS=${XARGS:-@XARGS@}
 
-if [ `${ID} -u` != `${ID} -u ${ROOT_USER}` ]; then
+root_uid=`${ID} -u ${ROOT_USER} 2>/dev/null`
+if [ "$root_uid" = "" ]; then
+       echo "$0: root user \"${ROOT_USER}\" does not exist." 1>&2
+       exit 1
+fi
+
+if [ `${ID} -u` != "$root_uid" ]; then
        ${ECHO} "Becoming ${ROOT_USER}@`/bin/hostname` to create a binary package"
        ${ECHO_N} "`${ECHO} ${SU_CMD} | ${SED} -e's/[[:space:]].*//'` ";\
        ( for arg in "$@"; do echo \"${arg}\"; done ) |



Home | Main Index | Thread Index | Old Index