summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Thibault <sthibault@debian.org>2012-12-27 14:37:42 (GMT)
committerSamuel Thibault <sthibault@debian.org>2012-12-27 14:37:42 (GMT)
commitf86a74ff68d1cd366b742d3991c33051989bcf6f (patch)
tree4c1a9253f255f7e5f871b6304699f9ff8d30f188
parentc7f32c0676e1238f0ba93a91e61419f309ecb51b (diff)
downloaddebootstrap-f86a74ff68d1cd366b742d3991c33051989bcf6f.zip
debootstrap-f86a74ff68d1cd366b742d3991c33051989bcf6f.tar.gz
debootstrap-f86a74ff68d1cd366b742d3991c33051989bcf6f.tar.bz2
Revert to using which, but only in non-d-i
which is only if /bin/sh does not exist
-rw-r--r--debian/changelog3
-rw-r--r--functions5
2 files changed, 5 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index f74a38a..bb47d68 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,6 @@
debootstrap (1.0.46) UNRELEASED; urgency=low
- * Find out /bin/sh using `type` instead of `which`, the latter not being
- available in d-i.
+ * Use `which` to find out sh only if /bin/sh does not exist.
-- Samuel Thibault <sthibault@debian.org> Thu, 27 Dec 2012 14:53:43 +0100
diff --git a/functions b/functions
index 682636e..c1e938e 100644
--- a/functions
+++ b/functions
@@ -1299,8 +1299,11 @@ check_sane_mount () {
;;
esac
+ SH=/bin/sh
+ [ -x $SH ] || SH=`which sh`
+
cat > "$1/test-exec" <<EOF
-#! `type sh`
+#! $SH
:
EOF
chmod +x "$1/test-exec"