r919 - trunk/kernel/source/kernel-source-2.6.7-2.6.7/debian
Jens Schmalzing
jensen@haydn.debian.org
Tue, 20 Jul 2004 17:55:32 -0600
Author: jensen
Date: 2004-07-20 17:55:28 -0600 (Tue, 20 Jul 2004)
New Revision: 919
Modified:
trunk/kernel/source/kernel-source-2.6.7-2.6.7/debian/rules
Log:
Changed debian/rules to allow for non-digits in revision.
Modified: trunk/kernel/source/kernel-source-2.6.7-2.6.7/debian/rules
===================================================================
--- trunk/kernel/source/kernel-source-2.6.7-2.6.7/debian/rules 2004-07-20 21:21:22 UTC (rev 918)
+++ trunk/kernel/source/kernel-source-2.6.7-2.6.7/debian/rules 2004-07-20 23:55:28 UTC (rev 919)
@@ -11,15 +11,15 @@
export DH_COMPAT=3
# extract the upstream release and the full package version from the changelog
-release := $(shell head -1 debian/changelog | sed 's/^.*(\(.*\)-.*).*$$/\1/')
-version := $(shell head -1 debian/changelog | sed 's/^.*(\(.*\)).*$$/\1/')
+release := $(shell sed -n '1s/^.*(\(.*\)-.*).*$$/\1/p' debian/changelog)
+version := $(shell sed -n '1s/^.*(\(.*\)).*$$/\1/p' debian/changelog)
-# extract the latest Debian revision from the changelog
-revisions := $(shell head -1 debian/changelog | sed 's/^.*(.*-\(.*\)).*$$/\1/')
+# extract all the Debian revisions for this release from the changelog
+revisions := $(shell sed -n 's/^kernel-source-$(release)\ .*(.*-\(.*\)).*$$/\1/p' debian/changelog | tac)
# set the current Debian revision to the latest by default;
# note that for some targets, the two may actually be different.
-revision ?= $(revisions)
+revision ?= $(word $(words $(revisions)),$(revisions))
version.Debian: debian/changelog
sed 's/^[^ ]* (\([^)]*\)).*/\1/; q' $< > $@
@@ -53,7 +53,7 @@
.PHONY: monolith
monolith: stamp-monolith
stamp-monolith: stamp-monolith-prepare \
- $(foreach revision,$(shell seq 1 $(revisions)),stamp-monolith-$(revision))
+ $(foreach revision,$(revisions),stamp-monolith-$(revision))
rm -rf $(DIFFDIR)
stamp-monolith-prepare:
@@ -72,12 +72,13 @@
touch $@
# for the first revision, we diff against the original
-ifeq ($(revision),1)
+ifeq ($(revision),$(firstword $(revisions)))
PREVPACKAGE = $(PACKAGE).orig
prevrelease = $(release)
else
-PREVPACKAGE = $(PACKAGE)-$$(($(revision)-1))
-prevrelease = $(release)-$$(($(revision)-1))
+prerevision = $(shell echo $(revisions) | awk '{ for (i=2;i<=NF;i++) if ($$i == "$(revision)") print $$(i-1) }')
+PREVPACKAGE = $(PACKAGE)-$(prerevision)
+prevrelease = $(release)-$(prerevision)
endif
$(MONODIR)/patch-$(release)-$(revision):