aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-05-04 22:49:14 +0000
committerMike Frysinger <vapier@gentoo.org>2005-05-04 22:49:14 +0000
commitb9256a0d5ec7baae6f3dc8d182b11d67978e2b86 (patch)
tree6c956f396976de0f74d54764161bb39e6e638b66 /bin
parentno g-cpan.pl or manpage to install anymore (diff)
downloadportage-cvs-b9256a0d5ec7baae6f3dc8d182b11d67978e2b86.tar.gz
portage-cvs-b9256a0d5ec7baae6f3dc8d182b11d67978e2b86.tar.bz2
portage-cvs-b9256a0d5ec7baae6f3dc8d182b11d67978e2b86.zip
allow fperms/fowners to be recursive (-R)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/fowners19
-rwxr-xr-xbin/fperms21
2 files changed, 27 insertions, 13 deletions
diff --git a/bin/fowners b/bin/fowners
index d4f8ce3..1d20940 100755
--- a/bin/fowners
+++ b/bin/fowners
@@ -1,15 +1,22 @@
#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/fowners,v 1.6 2004/10/04 13:56:50 vapier Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/fowners,v 1.7 2005/05/04 22:49:14 vapier Exp $
-if [ ${#} -lt 2 ] ; then
- echo "${0}: at least two arguments needed"
+if [ $# -lt 2 ] ; then
+ echo "${0}: at least two arguments needed" 1>&2
exit 1
fi
+OPTS=""
+while [ "${1:0:1}" = "-" ] ; do
+ OPTS="${OPTS} $1"
+ shift
+done
+
OWNER="${1}"
shift
-for FILE in $*; do
- chown "${OWNER}" "${D}${FILE}"
+
+for FILE in "$@" ; do
+ chown ${OPTS} "${OWNER}" "${D}${FILE}"
done
diff --git a/bin/fperms b/bin/fperms
index abde921..131f6a0 100755
--- a/bin/fperms
+++ b/bin/fperms
@@ -1,15 +1,22 @@
#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/fperms,v 1.6 2004/10/04 13:56:50 vapier Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/fperms,v 1.7 2005/05/04 22:49:14 vapier Exp $
-if [ ${#} -lt 2 ] ; then
- echo "${0}: at least two arguments needed"
+if [ $# -lt 2 ] ; then
+ echo "${0}: at least two arguments needed" 1>&2
exit 1
fi
-PERM="${1}"
+OPTS=""
+while [ "${1:0:1}" = "-" ] ; do
+ OPTS="${OPTS} $1"
+ shift
+done
+
+PERM=$1
shift
-for FILE in $*; do
- chmod "${PERM}" "${D}${FILE}"
+
+for FILE in "$@" ; do
+ chmod ${OPTS} "${PERM}" "${D}${FILE}"
done