slackware-current/source/a/rpm2tgz/patches/0009-Add-c-option-just-as-makepkg-c-y.patch
Patrick J Volkerding 75a4a592e5 Slackware 13.37
Mon Apr 25 13:37:00 UTC 2011
Slackware 13.37 x86_64 stable is released!

Thanks to everyone who pitched in on this release: the Slackware team,
the folks producing upstream code, and linuxquestions.org for providing
a great forum for collaboration and testing.

The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a
dual-sided
32-bit/64-bit x86/x86_64 DVD.  Please consider supporting the Slackware
project by picking up a copy from store.slackware.com.  We're taking
pre-orders now, and offer a discount if you sign up for a subscription.

As always, thanks to the Slackware community for testing, suggestions,
and feedback.  :-)

Have fun!
2018-05-31 22:45:18 +02:00

70 lines
1.9 KiB
Diff

From 7664b10014e4ca5b0f498d5c774653a44fdaf0e1 Mon Sep 17 00:00:00 2001
From: Igor Murzov <igor@gplsoft.org>
Date: Fri, 6 Aug 2010 01:05:41 +0400
Subject: [PATCH 09/09] Add -c option (just as makepkg -c y)
---
rpm2targz | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/rpm2targz b/rpm2targz
index d9d6a8b..f3e51d6 100644
--- a/rpm2targz
+++ b/rpm2targz
@@ -49,6 +49,7 @@ usage() {
echo " -r extract what the rpm's \"requires\" (dependencies)"
echo " as documention to /usr/doc/\$PRGNAM-\$VERSION/"
echo " -d attempt a wellformed slack-desc from the rpm meta data"
+ echo " -c reset all directory permissions to 755 and ownership to root:root."
echo
else
echo "Usage: $0 <file.rpm>"
@@ -98,7 +99,7 @@ if [ "$1" = "" ]; then
usage
fi
-ARGS=$(getopt "hsSndr" $* )
+ARGS=$(getopt "hsSndrc" $* )
set -- ${ARGS}
for i; do
case "$1" in
@@ -122,6 +123,10 @@ for i; do
META_NAME="true"
shift
;;
+ -c)
+ CHOWN="true"
+ shift
+ ;;
--)
shift
break
@@ -223,6 +228,12 @@ for i in $* ; do
sed -ri "s/^/$PRGNAM: /;11q" $TMPDIR/install/slack-desc
fi
+ # Supply -c y to makepkg if asked
+ COPT="n"
+ if [ "$CHOWN" = "true" ]; then
+ COPT="y"
+ fi
+
# If this program was called as "rpm2targz", then repack as a plain
# tar+gz archive. If it was called as "rpm2tgz", use Slackware's
# makepkg to produce the .tgz:
@@ -236,10 +247,10 @@ for i in $* ; do
if [ "$META_NAME" = "true" ]; then
get_meta_data $i
cd $TMPDIR
- /sbin/makepkg -l y -c n $CWD/$PRGNAM-$VERSION-$ARCH-${BUILD}.$EXT
+ /sbin/makepkg -l y -c $COPT $CWD/$PRGNAM-$VERSION-$ARCH-${BUILD}.$EXT
else
cd $TMPDIR
- /sbin/makepkg -l y -c n $CWD/$(basename $i .rpm).$EXT
+ /sbin/makepkg -l y -c $COPT $CWD/$(basename $i .rpm).$EXT
fi
)
else
--
1.7.1