summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorModestas Vainius <modestas@vainius.eu>2011-03-09 02:11:52 +0200
committerModestas Vainius <modestas@vainius.eu>2011-03-09 02:11:52 +0200
commit6366efa1f1f24fbb100222c40dc1b06f782db67b (patch)
treec16968b97dc75d3301c69b35119462b5d57edfe7
parent8a9f2f75a38b2bc6603abcc35fbe7397f60923fb (diff)
downloadpkg-kde-tools-6366efa1f1f24fbb100222c40dc1b06f782db67b.tar.gz
Simplify passing of extra options to non-overriden commands.
Options are passed via DHMK_OPTIONS envvar which has to be set to overrides to work anyway. What is more, DHMK_OPTIONS is derefenced in dhmk.mk rather than being expanded in dhmk.pl directly.
-rw-r--r--qt-kde-team/2/dhmk.mk2
-rwxr-xr-xqt-kde-team/2/dhmk.pl13
2 files changed, 5 insertions, 10 deletions
diff --git a/qt-kde-team/2/dhmk.mk b/qt-kde-team/2/dhmk.mk
index 7b60c7c..5f496e4 100644
--- a/qt-kde-team/2/dhmk.mk
+++ b/qt-kde-team/2/dhmk.mk
@@ -55,7 +55,7 @@ include $(shell test ! -f $(dhmk_rules_mk) && touch -t 197001030000 $(dhmk_rules
# Routine to run a specific command ($1 should be {target}_{command})
dhmk_override_cmd = $(if $(dhmk_$1),$(MAKE) -f $(dhmk_top_makefile) $1)
-dhmk_run_command = $(or $(call dhmk_override_cmd,override_$(call butfirstword,$1,_)),$($1))
+dhmk_run_command = $(or $(call dhmk_override_cmd,override_$(call butfirstword,$1,_)),$($1) $(DHMK_OPTIONS))
# Generate dhmk_{pre,post}_{target}_{command} targets for each target+command
$(foreach t,$(dhmk_standard_targets),$(foreach c,$(dhmk_$(t)_commands),dhmk_pre_$(t)_$(c))): dhmk_pre_%:
diff --git a/qt-kde-team/2/dhmk.pl b/qt-kde-team/2/dhmk.pl
index f96bfa1..b84a552 100755
--- a/qt-kde-team/2/dhmk.pl
+++ b/qt-kde-team/2/dhmk.pl
@@ -149,8 +149,8 @@ sub load_addons {
return 1;
}
-# Add extra options to each command
-sub add_extraopts {
+# Generate extra options from command line options
+sub gen_extraopts {
my @opts;
# Convert "--option value" syntax to --option=value like dh(1) would do
foreach my $opt (@_) {
@@ -162,12 +162,7 @@ sub add_extraopts {
push @opts, $opt;
}
}
- my $shescaped =" " . join(" ", map({ s/^'-/-O'-/; $_ } _escape_shell(@opts)));
- _find_cmd_and_do(sub {
- my ($cmds, $i) = ($_[0], ${$_[1]});
- $cmds->[$i] .= $shescaped;
- });
- return $shescaped;
+ return join(" ", map({ s/^'-/-O'-/; $_ } _escape_shell(@opts)));
}
1;
@@ -380,7 +375,7 @@ eval {
}
}
if (@{$cmdopts{extraopts}}) {
- $shextraopts = Debian::PkgKde::Dhmk::DhCompat::add_extraopts(@{$cmdopts{extraopts}});
+ $shextraopts = Debian::PkgKde::Dhmk::DhCompat::gen_extraopts(@{$cmdopts{extraopts}});
}
my $overrides = get_override_info($RULES_FILE, get_commands($targets));
write_dhmk_rules($DHMK_RULES_FILE, $RULES_FILE, $targets, $overrides, $shextraopts);