summaryrefslogtreecommitdiff
path: root/emulators/suse_base
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>1999-05-21 00:09:27 +0000
committertron <tron@pkgsrc.org>1999-05-21 00:09:27 +0000
commitd9cc6fccaa81a845c3fec3e795c1a7a2e67aac9d (patch)
tree7829a87811f709bf3d7a99a79d15d69ec40e909f /emulators/suse_base
parentda5b741336d9208db578e48b529ac181282ec3fb (diff)
downloadpkgsrc-d9cc6fccaa81a845c3fec3e795c1a7a2e67aac9d.tar.gz
Don't extract RPM files to "/tmp" but to target directory directly.
Diffstat (limited to 'emulators/suse_base')
-rw-r--r--emulators/suse_base/Makefile7
-rwxr-xr-xemulators/suse_base/scripts/rpm2pkg.sh59
2 files changed, 41 insertions, 25 deletions
diff --git a/emulators/suse_base/Makefile b/emulators/suse_base/Makefile
index 4eac254831e..cb47011c2df 100644
--- a/emulators/suse_base/Makefile
+++ b/emulators/suse_base/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 1999/05/17 02:24:27 tron Exp $
+# $NetBSD: Makefile,v 1.6 1999/05/21 00:09:27 tron Exp $
DISTNAME= suse_base-6.1
CATEGORIES= emulators
@@ -34,7 +34,8 @@ do-build:
${SCRIPTDIR}/*.sh; do \
${SED} -e 's#@@EMULDIR@@#${EMULDIR}#g' \
-e 's#@@EMULSUBDIR@@#${EMULSUBDIR}#g' \
- -e 's#@@GTAR@@#${GTAR}#g' \
+ -e 's#@@AWK@@#${AWK}#g' \
+ -e 's#@@PAX@@#${PAX}#g' \
-e 's#@@PREFIX@@#${PREFIX}#g' \
<$$FILE >${WRKDIR}/`basename $$FILE`; \
done
@@ -53,7 +54,7 @@ do-install:
${EGREP} -v '${EMULSUBDIR}/(tmp|usr/tmp|var)' >>${PLIST_SRC}
@cd ${EMULDIR} && ${RM} -rf tmp usr/tmp var
${INSTALL_DATA} ${FILESDIR}/ld.so.conf ${EMULDIR}/etc
- @${ECHO} "@dirrm ${EMULSUBDIR}" >>${PLIST_SRC}
+ @${ECHO} "@unexec rm -rf %D/${EMULSUBDIR}" >>${PLIST_SRC}
@${SH} ${INSTALL_FILE} ${PKGNAME} POST-INSTALL
show-shlib-type:
diff --git a/emulators/suse_base/scripts/rpm2pkg.sh b/emulators/suse_base/scripts/rpm2pkg.sh
index 5b7a68846cd..4c561f9d26f 100755
--- a/emulators/suse_base/scripts/rpm2pkg.sh
+++ b/emulators/suse_base/scripts/rpm2pkg.sh
@@ -2,9 +2,12 @@
export PATH=/bin:/usr/bin:@@PREFIX@@/bin
TMPDIR=/tmp/.rpm.$$.`date +%s`
-PLIST=$TMPDIR/PLIST
+LIST=$TMPDIR/LIST
+DIRS=$TMPDIR/DIRS
+FILES=$TMPDIR/FILES
+LINKS=$TMPDIR/LINKS
-if ! rm -rf $PLIST $TMPDIR
+if ! rm -rf $TMPDIR
then
exit 1
fi
@@ -13,34 +16,46 @@ then
exit 1
fi
+touch $LIST
for RPM
do
- rpm2cpio $RPM | (cd $TMPDIR/@@EMULSUBDIR@@; cpio -i -d 2>/dev/null)
+ rpm2cpio $RPM | (cd @@EMULDIR@@; @@PAX@@ -r -v 2>>$LIST)
done
-(cd $TMPDIR
- find @@EMULSUBDIR@@/* -type f | sort
- find @@EMULSUBDIR@@/* -type d | sort | awk '{print("@exec mkdir -p %D/"$1)}'
- find @@EMULSUBDIR@@/* -type l | sort |
- (while read LINK
- do
- set - X `file $LINK`
- if cd `dirname $LINK` && test -f $6
+touch $DIRS $LINKS
+cd @@PREFIX@@
+grep -v ^pax:\ $LIST | @@AWK@@ '{print("@@EMULSUBDIR@@/"$1)}' |
+(while read ENTRY
+ do
+ if [ -L "$ENTRY" ]
+ then
+ set - `file $ENTRY`
+ shift `expr $# - 1`;
+ if cd `dirname $ENTRY` && test -f $1
then
- echo $LINK
+ echo $ENTRY
else
- echo "@exec ln -s $6 %D/$LINK"
- echo "@unexec rm -f %D/$LINK"
+ echo "@exec ln -s $1 %D/$ENTRY" >>$LINKS
+ echo "@unexec rm -f %D/$ENTRY" >>$LINKS
fi
- cd $TMPDIR
- done)
- find @@EMULSUBDIR@@/* -type d | sort -r |
- awk '{print("@unexec rmdir %D/"$1" >/dev/null 2>&1 || true")}') >$PLIST
-
-@@GTAR@@ cCf $TMPDIR - @@EMULSUBDIR@@ | @@GTAR@@ xCf @@PREFIX@@ -
+ cd @@PREFIX@@
+ else
+ if [ -f "$ENTRY" ]
+ then
+ echo "$ENTRY"
+ else
+ if [ -d "$ENTRY" ]
+ then
+ echo "$ENTRY" >>$DIRS
+ fi
+ fi
+ fi
+ done) >$FILES
-cat $PLIST
+cat $FILES
+sort $DIRS | awk '{print("@exec mkdir -p %D/"$1)}'
+cat $LINKS
+sort -r $DIRS | awk '{print("@unexec rmdir %D/"$1" >/dev/null 2>&1 || true")}'
rm -rf $TMPDIR
exit 0
-