summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2010-07-23 12:14:53 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2010-07-23 12:14:53 +0200
commit23b4016d58410c30b0054e2c4ecd910a4817d313 (patch)
tree6d4c78628f7e4dedcb65af613a62def3b5d134f0 /scripts
parente9a5858377d78cfb93593df3d86da18fe560649d (diff)
macos x portability patch for cpio
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/cpio14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/cpio b/scripts/cpio
index 7936b727f..597e17d3c 100755
--- a/scripts/cpio
+++ b/scripts/cpio
@@ -1,18 +1,28 @@
#!/usr/bin/env bash
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.
+set -x
+opt=
+user="-R 0:0"
os=$(uname)
case $os in
NetBSD|MirBSD|OpenBSD)
quiet=""
;;
+ Darwin)
+ user="-R root:wheel"
+ quiet=""
+ ;;
*)
quiet="--quiet"
;;
esac
+if [ "$2" = "r" ];then
+ opt=$user
+fi
if [ -x /usr/bin/cpio ];then
- /usr/bin/cpio $quiet "$@"
+ /usr/bin/cpio $quiet $opt "$@"
else
- /bin/cpio $quiet "$@"
+ /bin/cpio $quiet $opt "$@"
fi