[SCM] Debian Qt/KDE packaging tools branch, dhmk, updated. debian/0.9.5-15-g8a9f2f7

Modestas Vainius modax at alioth.debian.org
Tue Mar 8 01:45:42 UTC 2011


The following commit has been merged in the dhmk branch:
commit 2181a0863aa57aafcdfc4c35af8738bedd04d130
Author: Modestas Vainius <modestas at vainius.eu>
Date:   Mon Mar 7 03:04:55 2011 +0200

    Move relationships between actions to commands file.
    
    This is a logical move as commands file looks more complete now.
---
 qt-kde-team/2/commands |   12 ++++++------
 qt-kde-team/2/dhmk.mk  |   10 ++++------
 qt-kde-team/2/dhmk.pl  |   18 +++++++++++-------
 3 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/qt-kde-team/2/commands b/qt-kde-team/2/commands
index 38760f9..998c07f 100644
--- a/qt-kde-team/2/commands
+++ b/qt-kde-team/2/commands
@@ -1,6 +1,6 @@
 # Standard target commands are defined here.
 # File format is:
-# target:
+# target: prerequisite_target(s) ...
 # 	command1
 # 	command2
 # 	command3
@@ -11,7 +11,7 @@ configure:
 	dh_testdir
 	dh_auto_configure
 
-build:
+build: configure
 	dh_testdir
 	dh_auto_build
 	dh_auto_test
@@ -21,7 +21,7 @@ clean:
 	dh_auto_clean
 	dh_clean
 
-install:
+install: build
 	dh_testroot
 	dh_prep
 	dh_installdirs
@@ -61,17 +61,17 @@ install:
 	dh_compress
 	dh_fixperms
 
-binary-indep:
+binary-indep: install
 	dh_installdeb
 	dh_gencontrol
 	dh_md5sums
 	dh_builddeb
 
-binary-arch:
+binary-arch: install
 	dh_strip
 	dh_makeshlibs
 	dh_shlibdeps
 	$binary-indep
 
-binary:
+binary: install
 	$binary-arch
diff --git a/qt-kde-team/2/dhmk.mk b/qt-kde-team/2/dhmk.mk
index 727ee38..8902b36 100644
--- a/qt-kde-team/2/dhmk.mk
+++ b/qt-kde-team/2/dhmk.mk
@@ -56,13 +56,8 @@ $(foreach t,$(dhmk_standard_targets),$(foreach c,$(dhmk_$(t)_commands),dhmk_pre_
 	$(call dhmk_run_command,$*)
 $(foreach t,$(dhmk_standard_targets),$(foreach c,$(dhmk_$(t)_commands),dhmk_post_$(t)_$(c))): dhmk_post_%:
 
-# Relationships between targets + export common options (to submake)
-debian/dhmk_build: debian/dhmk_configure
-debian/dhmk_install: debian/dhmk_build
-debian/dhmk_binary: debian/dhmk_install
-debian/dhmk_binary-arch: debian/dhmk_install
+# Export common options for some actions (to submake)
 debian/dhmk_binary-arch: export dhmk_target_dh_options = -a
-debian/dhmk_binary-indep: debian/dhmk_install
 debian/dhmk_binary-indep: export dhmk_target_dh_options = -i
 
 # Mark dynamic standard targets as PHONY
@@ -87,6 +82,9 @@ $(foreach t,$(dhmk_standard_targets),debian/dhmk_$(t)): debian/dhmk_%:
 
 .SECONDEXPANSION:
 
+# Relationships (depends/prerequisites)
+$(foreach t,$(dhmk_standard_targets),debian/dhmk_$(t)): debian/dhmk_%: $$(foreach d,$$(dhmk_%_depends),debian/dhmk_$$d)
+
 # Generate command chains for the standard targets
 $(foreach t,$(dhmk_standard_targets),dhmk_run_$(t)_commands): dhmk_run_%_commands: dhmk_pre_% $$(foreach c,$$(dhmk_%_commands),dhmk_pre_%_$$(c) dhmk_post_%_$$(c)) dhmk_post_%
 
diff --git a/qt-kde-team/2/dhmk.pl b/qt-kde-team/2/dhmk.pl
index 7c4ea54..19e781d 100755
--- a/qt-kde-team/2/dhmk.pl
+++ b/qt-kde-team/2/dhmk.pl
@@ -41,20 +41,22 @@ sub parse_commands_file {
         chop $line;
         if ($line =~ /^\s*#/ || $line =~ /^\s*$/) {
             next; # comment or empty line
-        } elsif ($line =~ /^(\S.+):\s*$/) {
+        } elsif ($line =~ /^(\S.+):\s*(.*)$/) {
             $t = $1;
+            $targets{$t}{deps} = $2 || "";
+            $targets{$t}{cmds} = [];
         } elsif (defined $t) {
             if ($line =~ /^\s+(.*)$/) {
                 my $c = $1;
                 # If it's a variable, dereference it
                 if ($c =~ /^\s*\$(\S+)\s*$/) {
                     if (exists $targets{$1}) {
-                        push @{$targets{$t}}, @{$targets{$1}};
+                        push @{$targets{$t}{cmds}}, @{$targets{$1}{cmds}};
                     } else {
                         die "could not dereference variable \$$1. Target '$1' was not defined yet";
                     }
                 } else {
-                    push @{$targets{$t}}, $c;
+                    push @{$targets{$t}{cmds}}, $c;
                 }
             } else {
                 die "dangling command '$line'. Missing target definition";
@@ -72,7 +74,7 @@ sub get_commands {
     my ($targets) = @_;
     my %commands;
     foreach my $tname (keys %$targets) {
-        my $t = $targets->{$tname};
+        my $t = $targets->{$tname}{cmds};
         foreach my $c (@$t) {
             if ($c =~ /^(\S+)/) {
                 push @{$commands{$1}}, $tname;
@@ -118,16 +120,18 @@ sub write_dhmk_rules {
     my ($dhmk_file, $rules_file, $targets, $overrides) = @_;
     open (my $fh, ">", $dhmk_file) or
         die "unable to open dhmk rules file ($dhmk_file) for writing: $!";
-    print $fh "# Target command sequences", "\n";
+    print $fh "# Action command sequences", "\n";
     foreach my $tname (keys %$targets) {
         my $t = $targets->{$tname};
         my @commands;
-        foreach my $cline (@$t) {
+        foreach my $cline (@{$t->{cmds}}) {
             my $c = ($cline =~ /^(\S+)/) && $1;
             push @commands, $c;
             print $fh $tname, "_", $c, " = ", $cline, "\n";
         }
-        print $fh "dhmk_". $tname, "_commands = ", join(" ", @commands), "\n\n";
+        print $fh "dhmk_", $tname, "_commands = ", join(" ", @commands), "\n";
+        print $fh "dhmk_", $tname, "_depends = ", $t->{deps}, "\n";
+        print $fh "\n";
     }
     print $fh "# Overrides", "\n";
     foreach my $o (sort keys %$overrides) {

-- 
Debian Qt/KDE packaging tools



More information about the pkg-kde-commits mailing list