mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
Remove the cpio emulator script.
The users of cpio have their own emulation by now.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -172,4 +172,3 @@ config.status
|
||||
config.mak.autogen
|
||||
config.mak.append
|
||||
configure
|
||||
cpio
|
||||
|
||||
1
Makefile
1
Makefile
@@ -500,7 +500,6 @@ ifneq (,$(findstring MINGW,$(uname_S)))
|
||||
NOEXECTEMPL = .noexec
|
||||
template_dir = ../share/git-core/templates/
|
||||
ETC_GITCONFIG = ../etc/gitconfig
|
||||
SCRIPT_SH += cpio.sh
|
||||
endif
|
||||
ifneq (,$(findstring arm,$(uname_M)))
|
||||
ARM_SHA1 = YesPlease
|
||||
|
||||
60
cpio.sh
60
cpio.sh
@@ -1,60 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Emulates some cpio behavior using GNU tar
|
||||
|
||||
die() {
|
||||
echo >&2 "$@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
null=
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-0) null=--null;;
|
||||
-o) mode=o;;
|
||||
-iuv) ;;
|
||||
-pumd|-pumdl)
|
||||
mode=p
|
||||
dir="$2"
|
||||
shift
|
||||
;;
|
||||
*) die "cpio emulation supports only -0, -o, -iuv, -pumdl";;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
prev=
|
||||
|
||||
filterdirs() {
|
||||
while read f; do
|
||||
if test -d "$f"; then
|
||||
# list only empty directories
|
||||
# here we assume that directories are listed after
|
||||
# its files (aka 'find -depth'), hence, a directory
|
||||
# that is not empty will be a leading sub-string
|
||||
# of the preceding entry
|
||||
case "$prev" in
|
||||
"$f"/* ) ;;
|
||||
*) echo "$f";;
|
||||
esac
|
||||
else
|
||||
echo "$f"
|
||||
fi
|
||||
prev="$f"
|
||||
done
|
||||
}
|
||||
|
||||
case $mode in
|
||||
o)
|
||||
tar --create --file=- $null --files-from=-
|
||||
;;
|
||||
p)
|
||||
test -z "$null" || die "cpio: cannot use -0 in pass-through mode"
|
||||
filterdirs |
|
||||
tar --create --file=- --files-from=- |
|
||||
tar --extract --directory="$dir" --file=-
|
||||
;;
|
||||
*)
|
||||
tar xvf -
|
||||
esac
|
||||
Reference in New Issue
Block a user