Bug#309596: tetex-base: FTBFS in experimental: Endless loop.
Hilmar Preusse <hille42@web.de> wrote:
> Next log. Hope it is useful. I've put your debug log into rules and
> rules.in. The commonstuff_update I've removed only from rules.in. I
> firstly executed the clean target and after it ended the binary
> target.
Perfect, thanks. So, it doesn't loop anymore. It appears that the weird
behaviour was caused by the use of a phony target as a prerequesite of a
real target.
The attached patch defines a sort of Make macro called
update_commonstuff, that does what the phony target commonstuff_update
did, but is called only in the clean and debian/rules targets. There is
still a commonstuff_update phony target in case you want to invoke it
from the command-line, but it is not a prerequesite of a real target
anymore.
--- tetex-base-3.0/debian/rules.in 2005-05-20 20:10:14.000000000 +0200
+++ tetex-base-3.0.flo/debian/rules.in 2005-05-20 20:14:36.000000000 +0200
@@ -25,9 +25,8 @@
debian/common.functions
eperl_sourcefiles=debian/variables debian/COPYRIGHT.scripts \
debian/common.variables debian/common.functions
-timepattern=.*[[:alpha:]]*[[:space:]]*[[:digit:]] \([[:digit:].]*\) \.\./.*
real_common_variables=../../tetex-common/common.variables
-real_common_functions=../../tetex-common/common.functions.in
+real_common_functions_in=../../tetex-common/common.functions.in
SHELL = /bin/bash
@@ -52,8 +51,41 @@
# Main targets
###############
+# common.variables and common.functions are shared between the tetex-base and
+# tetex-bin source packages. If you want to use this mechanism, check out the
+# tetex-common tree and put it two directories above the package directory.
+# I use ~/src/Packages/tetex-common together with
+# ~/src/Packages/tetex-base/tetex-base-$version/.
+define update_commonstuff
+test -e $(real_common_variables) && \
+ test $(real_common_variables) -nt debian/common.variables && \
+ cp $(real_common_variables) debian/ || true
+
+test -e $(real_common_functions_in) && \
+ test $(real_common_functions_in) -nt debian/common.functions.in && \
+ cp $(real_common_functions_in) debian/ && \
+ eperl -P -o debian/common.functions debian/common.functions.in || true
+endef
+
+# For command-line use
+commonstuff_update:
+ $(update_commonstuff)
+
+debian/rules: debian/rules.in $(eperl_sourcefiles)
+ # Refresh debian/common.variables and debian/common.functions.in every
+ # time the rules file is going to be regenerated
+ $(update_commonstuff)
+ # Regenerate the rules file
+ eperl -P -o $@ $<
+
+# Override the general rule for eperl-generated files in order to avoid a
+# circular dependency (debian/common.functions is listed in
+# $(eperl_sourcefiles)).
+debian/common.functions: debian/common.functions.in debian/common.variables
+ eperl -P -o $@ $<
+
# Eperl is simply great: thanks, Davide!
-% :: %.in commonstuff_update $(eperl_sourcefiles)
+% :: %.in $(eperl_sourcefiles)
eperl -P -o $@ $<
-head -1 $@ | grep '^#!/' >/dev/null && chmod a+x $@
@@ -72,30 +104,6 @@
# Subtargets that do the work
##############################
-# common.variables and common.functions are shared between the tetex-base and
-# tetex-bin source packages. If you want to use this mechanism, check out the
-# tetex-common tree and put it two directories above the package directory.
-# I use ~/src/Packages/tetex-common together with ~/src/Packages/tetex-base/tetex-base-$version/.
-commonstuff_update: common.variables_update common.functions_update
-common.variables_update:
- test -e $(real_common_variables) && \
- test $(real_common_variables) -nt debian/common.variables && \
- touch -t `ls -l --time-style=+%Y%m%d%H%M.%S ../../tetex-common/common.variables | \
- sed -e 's@$(timepattern)@\1@'` debian/common.variables_newer || true
-
-debian/common.variables: debian/common.variables_newer
- -cp $(real_common_variables) debian/ 2>/dev/null
-
-common.functions_update:
- test -e $(real_common_functions) && \
- test $(real_common_functions) -nt debian/common.functions.in && \
- touch -t `ls -l --time-style=+%Y%m%d%H%M.%S ../../tetex-common/common.functions.in | \
- sed -e 's@$(timepattern)@\1@'` debian/common.functions_newer || true
-
-debian/common.functions: debian/common.functions_newer
- -cp $(real_common_functions) debian/ 2>/dev/null
- eperl -P -o $@ debian/common.functions.in
-
$(stampdir)/eperl-stamp: $(EPERL_FILES)
touch $@
@@ -110,11 +118,12 @@
touch $(stampdir)/build-stamp
-
### Clean up the source tree.
-clean: commonstuff_update
+clean:
dh_testdir
dh_testroot
+ $(update_commonstuff)
+
# Make sure that our build scripts are executable.
chmod +x debian/remove-bad-license-files
@@ -203,7 +212,7 @@
echo "dummy content for dpkg-source" > debian/sid-stamp
.PHONY: build clean binary-indep binary-arch binary install sarge sid
-.PHONY: commonstuff_update common.variables_update common.functions_update
+.PHONY: commonstuff_update
define check-cvs
test -d debian/CVS && \
> P.S.: I'll be offline for the next two weeks. Maybe you'll get some
> E-mails from me still on Monday but as of Wednesday I'll definitely
> be far away from any kind of computers.
OK. Bye,
--
Florent
Reply to: