diff options
author | Sven Joachim <svenjoac@gmx.de> | 2017-04-18 16:21:52 (GMT) |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2017-07-24 14:37:20 (GMT) |
commit | 0c4c27b582dbd9b3a994758f3c09fb1338fd9803 (patch) | |
tree | b464b8396b5f0141e935c9e5721a1c55a7ed6f80 /functions | |
parent | 706a45681c5bba5e062a9b02e19f079cacf2a3e8 (diff) | |
download | debootstrap-0c4c27b582dbd9b3a994758f3c09fb1338fd9803.zip debootstrap-0c4c27b582dbd9b3a994758f3c09fb1338fd9803.tar.gz debootstrap-0c4c27b582dbd9b3a994758f3c09fb1338fd9803.tar.bz2 |
Avoid the 'type' shell command
It is not mandatory in POSIX and tus not implemented by posh. Use the
in_path function instead which is taylored for this need.
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -899,7 +899,7 @@ extract_ar_deb_field () { *) error 1 UNKNOWNCONTROLCOMP "Unknown compression type for %s in %s" "$tarball" "$pkg" ;; esac - if type $cat_cmd >/dev/null 2>&1; then + if in_path $cat_cmd >/dev/null 2>&1; then ar -p "$pkg" "$tarball" | $cat_cmd | tar -O -xf - control ./control 2>/dev/null | grep -i "^$field:" | sed -e 's/[^:]*: *//' | head -n 1 @@ -920,7 +920,7 @@ extract_ar_deb_data () { *) error 1 UNKNOWNDATACOMP "Unknown compression type for %s in %s" "$tarball" "$pkg" ;; esac - if type $cat_cmd >/dev/null 2>&1; then + if in_path $cat_cmd >/dev/null 2>&1; then ar -p "$pkg" "$tarball" | $cat_cmd | tar $EXTRACT_DEB_TAR_OPTIONS -xf - else error 1 UNPACKCMDUNVL "Extracting %s requires the %s command, which is not available" "$pkg" "$cat_cmd" @@ -944,7 +944,7 @@ choose_extractor () { if [ -n "$EXTRACTOR_OVERRIDE" ]; then extractor="$EXTRACTOR_OVERRIDE" - elif type dpkg-deb >/dev/null 2>&1; then + elif in_path dpkg-deb >/dev/null 2>&1; then extractor="dpkg-deb" else extractor="ar" |