summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2007-07-31 09:55:34 (GMT)
committerColin Watson <cjwatson@debian.org>2007-07-31 09:55:34 (GMT)
commit974445b92471a9044ae0ecd65357a1ca86f2ab69 (patch)
tree5abe04a3993b9ba183ac78eaa1db2dc4fb5c055b
parent222be15fe07482c02579b89711cba9b2c5ad863d (diff)
downloaddebootstrap-974445b92471a9044ae0ecd65357a1ca86f2ab69.zip
debootstrap-974445b92471a9044ae0ecd65357a1ca86f2ab69.tar.gz
debootstrap-974445b92471a9044ae0ecd65357a1ca86f2ab69.tar.bz2
* Add --version option (closes: #294484).
r48820
-rw-r--r--Makefile7
-rw-r--r--debian/changelog1
-rwxr-xr-xdebootstrap7
3 files changed, 14 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 2754164..9500079 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,9 @@
CC=gcc
CFLAGS=-Wall -W -O2
+# avoid dpkg-dev dependency; fish out the version with sed
+VERSION := $(shell sed 's/.*(\(.*\)).*/\1/; q' debian/changelog)
+
ARCH := $(shell dpkg --print-architecture)
setarchdevs = $(if $(findstring $(ARCH),$(1)),$(2))
@@ -35,7 +38,9 @@ install:
ln -s sid $(DSDIR)/scripts/lenny
install -o root -g root -m 0755 debootstrap.8 $(DESTDIR)/usr/share/man/man8/
- install -o root -g root -m 0755 debootstrap $(DESTDIR)/usr/sbin/
+ sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)/usr/sbin/debootstrap
+ chown root:root $(DESTDIR)/usr/sbin/debootstrap
+ chmod 0755 $(DESTDIR)/usr/sbin/debootstrap
install-allarch: install
install -o root -g root -m 0644 devices-std.tar.gz \
diff --git a/debian/changelog b/debian/changelog
index dc496c7..23da2ef 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,7 @@ debootstrap (1.0.2) UNRELEASED; urgency=low
closes: #314304).
* functions: Stub out /proc setup and add device setup for the Hurd
(thanks, Michael Banck; closes: #314311).
+ * Add --version option (closes: #294484).
-- Joey Hess <joeyh@debian.org> Fri, 20 Jul 2007 16:57:37 -0400
diff --git a/debootstrap b/debootstrap
index 5184b42..ec9dfa0 100755
--- a/debootstrap
+++ b/debootstrap
@@ -1,5 +1,7 @@
#!/bin/sh -e
+VERSION='@VERSION@'
+
unset TMP TEMP TMPDIR || true
###########################################################################
@@ -65,6 +67,7 @@ usage()
echo
cat <<EOF
--help display this help and exit
+ --version display version information and exit
--verbose don't turn off the output of wget
--download-only download packages, but don't perform installation
@@ -105,6 +108,10 @@ if [ $# != 0 ] ; then
usage
exit 0
;;
+ --version)
+ echo "debootstrap $VERSION"
+ exit 0
+ ;;
--boot-floppies)
if [ -n "$USE_DEBIANINSTALLER_INTERACTION" ] ; then
error 1 ARG_BFDI "Can only use one of --boot-floppies and --debian-installer"