Bug#477587: [PATCH] Re: Bug#477587: Bug#477588: kfreebsd-{6,7}: bashism in debian/rules
tags 477587 + patch
tags 477588 + patch
thanks
FWIW, both “bashisms” work with mksh ☺
Untested diff below:
Index: kfreebsd-6/debian/rules
===================================================================
--- kfreebsd-6/debian/rules (revision 2166)
+++ kfreebsd-6/debian/rules (working copy)
@@ -2,8 +2,6 @@
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
-SHELL = bash
-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
@@ -28,15 +26,14 @@
HEADERS_DIR := kfreebsd-headers-$(version)-$(abiname)
FLAVOR_DIR := flavor-$(version)-$(abiname)
-MAKE := make MACHINE_ARCH=$(cpu) CC=gcc-3.4 WERROR=
+MAKE := make MACHINE_ARCH=$(cpu) CC=gcc-3.4 WERROR=
PATH := $(CURDIR)/config:/usr/lib/freebsd:$(PATH)
control: clean
sed -e "s/@major@/$(major)/g" -e "s/@version@/$(version)/g" -e "s/@abiname@/$(abiname)/g" -e "s/@flavor@/$$flavor/g" \
$(CURDIR)/debian/control.in > $(CURDIR)/debian/control
for arch in `ls $(CURDIR)/debian/arch/` ; do \
- for config in `ls $(CURDIR)/debian/arch/$$arch/ | grep \.config` ; do \
- flavor=$${config/.config/} ; \
+ for flavor in $$(echo $(CURDIR)/debian/arch/$$arch/*.config* | sed 's/\.config//'); do \
test -f $(CURDIR)/debian/arch/$$arch/$$flavor.defines && recommends=`awk '/^Recommends: / {print $$2}' $(CURDIR)/debian/arch/$$arch/$$flavor.defines` ; \
sed -e "s/@major@/$(major)/g" -e "s/@version@/$(version)/g" -e "s/@abiname@/$(abiname)/g" -e "s/@flavor@/$$flavor/g" -e "s/@arch@/$$arch/g" -e "s/@recommends@/$$recommends/g" \
$(CURDIR)/debian/control.flavor.in >> $(CURDIR)/debian/control ; \
@@ -55,7 +52,7 @@
src: src-stamp
src-stamp:
tar xfj $(CURDIR)/src.tar.bz2
-
+
set -e ; find src -type d -name CVS | xargs rm -rf
set -e ; find src -type f | (while read i ; do \
@@ -71,7 +68,7 @@
-e 's,#\( \|\t\)*include\( \|\t\)*\(<\|"\)bpfilter.h\(>\|"\),,g' \
-e 's,#\( \|\t\)*include\( \|\t\)*\(<\|"\)pflog.h\(>\|"\),,g' \
; done)
-
+
set -e ; cd $(CURDIR)/src ; QUILT_PC=$(CURDIR)/.pc QUILT_PATCHES=$(CURDIR)/debian/patches quilt push -a ; cd $(CURDIR)
install debian/gen-ld-u-options src/usr.sbin/config
@@ -81,7 +78,7 @@
build-indep: build-indep-stamp
build-indep-stamp: src
dh_testdir
-
+
cp -af src $(SRC_DIR)
touch build-indep-stamp
@@ -112,7 +109,7 @@
build-arch: $(foreach flavor,$(flavours),build-flavor-$(flavor)-stamp)
build-flavor-%-stamp: src config
cp -af src $(FLAVOR_DIR)-$*
-
+
# Add the abiname and the flavor to the kernel version
sed -i -e 's/^RELEASE=".*"/RELEASE="$(version)-$(abiname)-$*"/g' $(FLAVOR_DIR)-$*/sys/conf/newvers.sh
@@ -132,11 +129,11 @@
touch build-flavor-$*-stamp
install-common-stamp: src
- dh_testdir
+ dh_testdir
dh_testroot
mkdir -p $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR)
cd src \
- && find . -type f -name "*.h" -not -regex ".*modules.*" -not -regex ".*sys/$(cpu)/.*" -exec cp --parents {} $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) \;
+ && find . -type f -name "*.h" -not -regex ".*modules.*" -not -regex ".*sys/$(cpu)/.*" -exec cp --parents {} $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) \;
find $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) -type f -exec chmod 644 {} \;
touch install-common-stamp
@@ -147,7 +144,8 @@
dh_testroot
dh_clean -k -pkfreebsd-image-$(version)-$(abiname)-$*
- mkdir -p $(IMAGE_PACKAGE)-$*/{boot,lib/modules/$(version)-$(abiname)-$*}
+ mkdir -p $(IMAGE_PACKAGE)-$*/boot \
+ $(IMAGE_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*
# make the install target happy
install -o root -g root -m 644 \
@@ -160,7 +158,7 @@
install -o root -g root -m 644 \
$(FLAVOR_DIR)-$*/sys/boot/forth/loader.conf \
$(IMAGE_PACKAGE)-$*/boot/defaults/loader.conf
-
+
# now install the kernel
$(MAKE) -C $(FLAVOR_DIR)-$*/sys/$(cpu)/compile/$(configfile) DESTDIR=$(IMAGE_PACKAGE)-$* install
mv $(IMAGE_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*/kernel $(IMAGE_PACKAGE)-$*/boot/kfreebsd-$(version)-$(abiname)-$*
@@ -179,7 +177,7 @@
# remove device.hints (built into kernel)
rm -f $(IMAGE_PACKAGE)-$*/boot/device.hints
-
+
# override file
mkdir -p $(IMAGE_PACKAGE)-$*/usr/share/lintian/overrides
install -p -o root -g root -m 644 \
@@ -194,13 +192,13 @@
# scripts
sed -e "s/@RELEASE@/$(version)-$(abiname)-$*/g" debian/kfreebsd-image.postinst.in \
> debian/kfreebsd-image-$(version)-$(abiname)-$*.postinst
-
+
# headers package
mkdir -p $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu)
cd $(FLAVOR_DIR)-$*/sys/$(cpu) \
&& find . -type f -name "*.h" -not -regex ".*modules.*" -exec cp --parents {} $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu) \; \
&& cp -d --parents compile/$(configfile)/machine $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu) \
- && cp -d --parents conf/$(configfile) $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu)
+ && cp -d --parents conf/$(configfile) $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu)
find $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu) -type f -exec chmod 644 {} \;
for dir in `ls $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR)/sys` ; do \
ln -s ../../$(HEADERS_DIR)/sys/$$dir $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$$dir ; \
@@ -246,10 +244,9 @@
else
binary-arch:
# We have nothing to do
-endif
+endif
binary: binary-indep binary-arch
.PHONY: clean build build-indep
.PHONY: binary-indep binary-arch binary-indep binary-arch binary
-
Index: kfreebsd-7/debian/rules
===================================================================
--- kfreebsd-7/debian/rules (revision 2166)
+++ kfreebsd-7/debian/rules (working copy)
@@ -2,8 +2,6 @@
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
-SHELL = bash
-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
@@ -27,15 +25,14 @@
HEADERS_DIR := kfreebsd-headers-$(version)-$(abiname)
FLAVOR_DIR := flavor-$(version)-$(abiname)
-MAKE := make MACHINE_ARCH=$(cpu) CC=gcc-4.3 WERROR=
+MAKE := make MACHINE_ARCH=$(cpu) CC=gcc-4.3 WERROR=
PATH := $(CURDIR)/config:/usr/lib/freebsd:$(PATH)
control: clean
sed -e "s/@major@/$(major)/g" -e "s/@version@/$(version)/g" -e "s/@abiname@/$(abiname)/g" -e "s/@flavor@/$$flavor/g" \
$(CURDIR)/debian/control.in > $(CURDIR)/debian/control
for arch in `ls $(CURDIR)/debian/arch/` ; do \
- for config in `ls $(CURDIR)/debian/arch/$$arch/ | grep \.config` ; do \
- flavor=$${config/.config/} ; \
+ for flavor in $$(echo $(CURDIR)/debian/arch/$$arch/*.config* | sed 's/\.config//'); do \
test -f $(CURDIR)/debian/arch/$$arch/$$flavor.defines && recommends=`awk '/^Recommends: / {print $$2}' $(CURDIR)/debian/arch/$$arch/$$flavor.defines` ; \
sed -e "s/@major@/$(major)/g" -e "s/@version@/$(version)/g" -e "s/@abiname@/$(abiname)/g" -e "s/@flavor@/$$flavor/g" -e "s/@arch@/$$arch/g" -e "s/@recommends@/$$recommends/g" \
$(CURDIR)/debian/control.flavor.in >> $(CURDIR)/debian/control ; \
@@ -54,7 +51,7 @@
src: src-stamp
src-stamp:
tar xfj $(CURDIR)/src.tar.bz2
-
+
set -e ; find src -type d -name CVS | xargs rm -rf
set -e ; find src -type f | (while read i ; do \
@@ -70,7 +67,7 @@
-e 's,#\( \|\t\)*include\( \|\t\)*\(<\|"\)bpfilter.h\(>\|"\),,g' \
-e 's,#\( \|\t\)*include\( \|\t\)*\(<\|"\)pflog.h\(>\|"\),,g' \
; done)
-
+
set -e ; cd $(CURDIR)/src ; QUILT_PC=$(CURDIR)/.pc QUILT_PATCHES=$(CURDIR)/debian/patches quilt push -a ; cd $(CURDIR)
install debian/gen-ld-u-options src/usr.sbin/config
grep -v ^__FBSDID src/sys/kern/subr_sbuf.c > src/usr.sbin/config/sbuf.c
@@ -80,7 +77,7 @@
build-indep: build-indep-stamp
build-indep-stamp: src
dh_testdir
-
+
cp -af src $(SRC_DIR)
touch build-indep-stamp
@@ -111,7 +108,7 @@
build-arch: $(foreach flavor,$(flavours),build-flavor-$(flavor)-stamp)
build-flavor-%-stamp: src config
cp -af src $(FLAVOR_DIR)-$*
-
+
# Add the abiname and the flavor to the kernel version
sed -i -e 's/^RELEASE=".*"/RELEASE="$(version)-$(abiname)-$*"/g' $(FLAVOR_DIR)-$*/sys/conf/newvers.sh
@@ -131,11 +128,11 @@
touch build-flavor-$*-stamp
install-common-stamp: src
- dh_testdir
+ dh_testdir
dh_testroot
mkdir -p $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR)
cd src \
- && find . -type f -name "*.h" -not -regex ".*modules.*" -not -regex ".*sys/$(cpu)/.*" -exec cp --parents {} $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) \;
+ && find . -type f -name "*.h" -not -regex ".*modules.*" -not -regex ".*sys/$(cpu)/.*" -exec cp --parents {} $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) \;
find $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) -type f -exec chmod 644 {} \;
touch install-common-stamp
@@ -146,7 +143,8 @@
dh_testroot
dh_clean -k -pkfreebsd-image-$(version)-$(abiname)-$*
- mkdir -p $(IMAGE_PACKAGE)-$*/{boot,lib/modules/$(version)-$(abiname)-$*}
+ mkdir -p $(IMAGE_PACKAGE)-$*/boot \
+ $(IMAGE_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*
# make the install target happy
install -o root -g root -m 644 \
@@ -159,7 +157,7 @@
install -o root -g root -m 644 \
$(FLAVOR_DIR)-$*/sys/boot/forth/loader.conf \
$(IMAGE_PACKAGE)-$*/boot/defaults/loader.conf
-
+
# now install the kernel
$(MAKE) -C $(FLAVOR_DIR)-$*/sys/$(cpu)/compile/$(configfile) DESTDIR=$(IMAGE_PACKAGE)-$* install
mv $(IMAGE_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*/kernel $(IMAGE_PACKAGE)-$*/boot/kfreebsd-$(version)-$(abiname)-$*
@@ -178,7 +176,7 @@
# remove device.hints (built into kernel)
rm -f $(IMAGE_PACKAGE)-$*/boot/device.hints
-
+
# override file
mkdir -p $(IMAGE_PACKAGE)-$*/usr/share/lintian/overrides
install -p -o root -g root -m 644 \
@@ -193,13 +191,13 @@
# scripts
sed -e "s/@RELEASE@/$(version)-$(abiname)-$*/g" debian/kfreebsd-image.postinst.in \
> debian/kfreebsd-image-$(version)-$(abiname)-$*.postinst
-
+
# headers package
mkdir -p $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu)
cd $(FLAVOR_DIR)-$*/sys/$(cpu) \
&& find . -type f -name "*.h" -not -regex ".*modules.*" -exec cp --parents {} $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu) \; \
&& cp -d --parents compile/$(configfile)/machine $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu) \
- && cp -d --parents conf/$(configfile) $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu)
+ && cp -d --parents conf/$(configfile) $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu)
find $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu) -type f -exec chmod 644 {} \;
for dir in `ls $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR)/sys` ; do \
ln -s ../../$(HEADERS_DIR)/sys/$$dir $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$$dir ; \
@@ -245,10 +243,9 @@
else
binary-arch:
# We have nothing to do
-endif
+endif
binary: binary-indep binary-arch
.PHONY: clean build build-indep
.PHONY: binary-indep binary-arch binary-indep binary-arch binary
-
This also clears superfluous whitespace at EOL and EOF.
bye,
//mirabilos
--
[...] if maybe ext3fs wasn't a better pick, or jfs, or maybe reiserfs, oh but
what about xfs, and if only i had waited until reiser4 was ready... in the be-
ginning, there was ffs, and in the middle, there was ffs, and at the end, there
was still ffs, and the sys admins knew it was good. :) -- Ted Unangst über *fs
Reply to: