[Pkg-tcltk-commits] r1017 - tcltk-defaults/trunk/debian

sgolovan at alioth.debian.org sgolovan at alioth.debian.org
Sun Jan 10 09:26:56 UTC 2010


Author: sgolovan
Date: 2010-01-10 09:26:55 +0000 (Sun, 10 Jan 2010)
New Revision: 1017

Modified:
   tcltk-defaults/trunk/debian/changelog
   tcltk-defaults/trunk/debian/tcltk-depends.in
Log:
[tcltk-defaults]
  * Made tcltk-depends adding substvars only if they are present in
    debian/control file to suppress dh_gencontrol warnings about unused
    substitution variables.


Modified: tcltk-defaults/trunk/debian/changelog
===================================================================
--- tcltk-defaults/trunk/debian/changelog	2010-01-10 00:25:23 UTC (rev 1016)
+++ tcltk-defaults/trunk/debian/changelog	2010-01-10 09:26:55 UTC (rev 1017)
@@ -3,9 +3,12 @@
   * Changed the default Tcl/Tk version to 8.5. This means depending on
     tcl8.5 and tk8.5 packages (closes: #515984, #516178).
   * Removed useless call to dh_desktop in debian/rules.
+  * Made tcltk-depends adding substvars only if they are present in
+    debian/control file to suppress dh_gencontrol warnings about unused
+    substitution variables.
   * Bumped standards version to 3.8.3.
 
- -- Sergei Golovan <sgolovan at debian.org>  Mon, 26 Oct 2009 11:13:20 +0300
+ -- Sergei Golovan <sgolovan at debian.org>  Sun, 10 Jan 2010 12:21:19 +0300
 
 tcltk-defaults (8.4.16-2) unstable; urgency=low
 

Modified: tcltk-defaults/trunk/debian/tcltk-depends.in
===================================================================
--- tcltk-defaults/trunk/debian/tcltk-depends.in	2010-01-10 00:25:23 UTC (rev 1016)
+++ tcltk-defaults/trunk/debian/tcltk-depends.in	2010-01-10 09:26:55 UTC (rev 1017)
@@ -171,7 +171,9 @@
 	    }
 	}
 
-	set lines [split [read $fd] "\n"]
+	set data [read $fd]
+	regsub -all {\n( |\t)} $data {\1} data ; # Join up all continuatioin lines
+	set lines [split $data "\n"]
 	lappend lines "" ; # If debian/config doesn't have a trailing LF
 	close $fd
 	set packages {}
@@ -179,6 +181,7 @@
 
 	set package ""
 	set arch ""
+	set vars {}
 	foreach line $lines {
 	    switch -glob -- $line {
 		"Package: *" {
@@ -187,6 +190,17 @@
 		"Architecture: *" {
 		    set arch [string trim [string range $line 14 end]]
 		}
+		"Pre-Depends: *" -
+		"Depends: *" -
+		"Recommends: *" -
+		"Suggests: *" -
+		"Enhances: *" -
+		"Breaks: *" -
+		"Conflicts: *" -
+		"Provides: *" -
+		"Replaces: *" {
+		    set vars [concat $vars [regexp -all -inline {\$\{\S*\}} $line]]
+		}
 		"" {
 		    if {$package == ""} {
 			# Two LF in a row or the end of a source package
@@ -194,18 +208,19 @@
 			# The package is excluded by -Npackage
 		    } elseif {[lsearch -exact $explicit $package] >= 0} {
 			# The package is explicitly required
-			lappend packages $package
+			lappend packages $package $vars
 		    } elseif {$arches == "arch" && $arch != "all"} {
 			# Arch dependent packages are requested
-			lappend packages $package
+			lappend packages $package $vars
 		    } elseif {$arches == "indep" && $arch == "all"} {
 			# Arch independent packages are requested
-			lappend packages $package
+			lappend packages $package $vars
 		    } elseif {$arches == "all"} {
-			lappend allpackages $package
+			lappend allpackages $package $vars
 		    }
 		    set package ""
 		    set arch ""
+		    set vars {}
 		}
 	    }
 	}
@@ -224,14 +239,22 @@
     set dep " (>= $version)"
 }
 
-foreach package [getpackages $argv] {
+foreach {package vars} [getpackages $argv] {
     delsubstvar $package "tcl:Depends"
-    addsubstvar $package "tcl:Depends" "tcl$dep"
+    if {[lsearch -exact $vars "\${tcl:Depends}"] >= 0} {
+	addsubstvar $package "tcl:Depends" "tcl$dep"
+    }
     delsubstvar $package "tclsh:Depends"
-    addsubstvar $package "tclsh:Depends" "tcl$dep | tclsh"
+    if {[lsearch -exact $vars "\${tclsh:Depends}"] >= 0} {
+	addsubstvar $package "tclsh:Depends" "tcl$dep | tclsh"
+    }
     delsubstvar $package "tk:Depends"
-    addsubstvar $package "tk:Depends" "tk$dep"
+    if {[lsearch -exact $vars "\${tk:Depends}"] >= 0} {
+	addsubstvar $package "tk:Depends" "tk$dep"
+    }
     delsubstvar $package "wish:Depends"
-    addsubstvar $package "wish:Depends" "tk$dep | wish"
+    if {[lsearch -exact $vars "\${wish:Depends}"] >= 0} {
+	addsubstvar $package "wish:Depends" "tk$dep | wish"
+    }
 }
 




More information about the Pkg-tcltk-commits mailing list