summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_tarup
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2008-02-12 15:03:28 +0000
committerrillig <rillig@pkgsrc.org>2008-02-12 15:03:28 +0000
commit74342b542b4e8bd4752b64886b7874bfaa46f56e (patch)
tree708922ec2ed968ac6b4ff95383594c5a2de1b3a1 /pkgtools/pkg_tarup
parent697dde5bc69f7b3246b72f33067e5fcf12b98d19 (diff)
downloadpkgsrc-74342b542b4e8bd4752b64886b7874bfaa46f56e.tar.gz
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 (limited to 'pkgtools/pkg_tarup')
-rw-r--r--pkgtools/pkg_tarup/Makefile44
-rw-r--r--pkgtools/pkg_tarup/files/pkg_tarup10
2 files changed, 19 insertions, 35 deletions
diff --git a/pkgtools/pkg_tarup/Makefile b/pkgtools/pkg_tarup/Makefile
index f4b442bcf36..e9dcadea997 100644
--- a/pkgtools/pkg_tarup/Makefile
+++ b/pkgtools/pkg_tarup/Makefile
@@ -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 @@ COMMENT= Generates binary package(s) from installed pkg(s)
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}
-
-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
+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'
+
+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 --git a/pkgtools/pkg_tarup/files/pkg_tarup b/pkgtools/pkg_tarup/files/pkg_tarup
index 878aaa9efec..3c8d638a42a 100644
--- a/pkgtools/pkg_tarup/files/pkg_tarup
+++ b/pkgtools/pkg_tarup/files/pkg_tarup
@@ -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 @@ SU_CMD=${SU_CMD:-@SU_CMD@}
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 ) |