summaryrefslogtreecommitdiff
path: root/scripts/cpio
blob: bba8186c9c45c0569161bb81a605a42d040b46a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/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.

opt=
user="-R 0:0"
os=$(uname)
case $os in
	NetBSD|MirBSD|OpenBSD)
		cmd="$@ -Mdist"
		;;
	Darwin)
		user="-R root:"
		cmd=$(echo "$@"|sed -e "s#-Hnewc#--format newc#")
		cmd="$cmd --quiet"
		;;
	*)
		cmd="$@ -Mdist --quiet"
		;;
esac
if [ "$2" = "r" ];then
	opt=$user
fi
cmd=$(echo "$cmd"|sed -e "s# r # #")
if [ -x /usr/bin/cpio ];then
	/usr/bin/cpio $cmd $opt
else
	/bin/cpio $cmd $opt
fi