From 974445b92471a9044ae0ecd65357a1ca86f2ab69 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 31 Jul 2007 09:55:34 +0000 Subject: * Add --version option (closes: #294484). r48820 --- Makefile | 7 ++++++- debian/changelog | 1 + debootstrap | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) 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 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 <