Bläddra i källkod

* scripts/{controllib,dpkg-{source,checkbuilddeps,control}}.pl:
* Rewrote the parsedep stuff, so that it wasn't done during control file
parsing. Scripts that need the internal parsed format should call
parsedep on the field's value.
* Split the substvars parsing into a separate function.
* No longer validate dependency fields when reading the control file.
Some fields may have vars in them, which breaks the validation.
* dpkg-gencontrol calls substvars after parsing the control file, and
then validates the substituted depends lines. Originally,
substitution occured only during writing of the final output file.
* Andreas Barth <aba@not.so.argh.org>:
Fix bad regex that didn't allow spaces in dependency field parsing.
It now directly matches what the c code expects. It previously was
allowing all of \S, which matched on '('.
Closes: #211660.
* debian/control: Remove stale debug that would have broken installation on
s390.
* debian/rules: We were calling our own local copy of dpkg-gencontrol, but
the system-installed copy of dpkg-shlibdeps. Now, both are called from
the build directory.

Adam Heath 23 år sedan
förälder
incheckning
b5803df202
8 ändrade filer med 85 tillägg och 39 borttagningar
  1. 23 0
      ChangeLog
  2. 25 0
      debian/changelog
  3. 1 1
      debian/control
  4. 4 3
      debian/rules
  5. 25 29
      scripts/controllib.pl
  6. 4 4
      scripts/dpkg-checkbuilddeps.pl
  7. 2 1
      scripts/dpkg-gencontrol.pl
  8. 1 1
      scripts/dpkg-source.pl

+ 23 - 0
ChangeLog

@@ -1,3 +1,26 @@
+Fri Sep 19 12:26:54 CDT 2003 Adam Heath <doogie@debian.org>
+
+  * scripts/{controllib,dpkg-{source,checkbuilddeps,control}}.pl:
+    * Rewrote the parsedep stuff, so that it wasn't done during control 
+      file parsing.  Scripts that need the internal parsed format should 
+      call parsedep on the field's value.
+    * Split the substvars parsing into a separate function.
+    * No longer validate dependency fields when reading the control file.
+      Some fields may have vars in them, which breaks the validation.
+    * dpkg-gencontrol calls substvars after parsing the control file, and
+      then validates the substituted depends lines.  Originally,
+      substitution occured only during writing of the final output file.
+    * Andreas Barth <aba@not.so.argh.org>:
+      Fix bad regex that didn't allow spaces in dependency field parsing.
+      It now directly matches what the c code expects.  It previously was
+      allowing all of \S, which matched on '('.
+      Closes: #211660.
+  * debian/control: Remove stale debug that would have broken installation
+    on s390.
+  * debian/rules: We were calling our own local copy of dpkg-gencontrol,
+    but the system-installed copy of dpkg-shlibdeps.  Now, both are called
+    from the build directory.
+
 Wed Sep 17 13:26:14 CDT 2003 Adam Heath <doogie@debian.org>
 
   * debian/changelog, version-nr: Updated to 1.10.13.

+ 25 - 0
debian/changelog

@@ -1,3 +1,28 @@
+dpkg (1.10.14) unstable; urgency=low
+
+  * controllib.pl:
+    * Rewrote the parsedep stuff, so that it wasn't done during control
+      file parsing.  Scripts that need the internal parsed format should
+      call parsedep on the field's value.
+    * Split the substvars parsing into a separate function.
+    * No longer validate dependency fields when reading the control file.
+      Some fields may have vars in them, which breaks the validation.
+    * dpkg-gencontrol calls substvars after parsing the control file, and
+      then validates the substituted depends lines.  Originally,
+      substitution occured only during writing of the final output file.
+    * Andreas Barth <aba@not.so.argh.org>:
+      Fix bad regex that didn't allow spaces in dependency field parsing.
+      It now directly matches what the c code expects.  It previously was
+      allowing all of \S, which matched on '('.
+      Closes: #211660.
+  * Remove stale debug in debian/control that would have broken
+    installation on s390.
+  * We were calling our own local copy of dpkg-gencontrol, but the
+    system-installed copy of dpkg-shlibdeps.  Now, both are called from
+    the build directory.
+
+ -- Adam Heath <doogie@debian.org>  UNRELEASED
+
 dpkg (1.10.13) unstable; urgency=low
 
   * Fix parsing of deps when both () and [] are specified.

+ 1 - 1
debian/control

@@ -13,7 +13,7 @@ Package: dpkg
 Architecture: any
 Essential: yes
 Pre-Depends: dselect, ${shlibs:Pre-Depends}
-Conflicts: sysvinit (<< 2.82-1), dpkg-iasearch (<< 0.11), dpkg-static, dpkg-dev (<< 1.9), foo [s390]
+Conflicts: sysvinit (<< 2.82-1), dpkg-iasearch (<< 0.11), dpkg-static, dpkg-dev (<< 1.9)
 Replaces: dpkg-doc-ja, dpkg-static, manpages-de (<= 0.4-3)
 Description: Package maintenance system for Debian
  This package contains the programs which handle the installation and

+ 4 - 3
debian/rules

@@ -15,7 +15,8 @@ DEB_BUILD_GNU_TYPE	:= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE 2> /dev/nul
 DEB_HOST_GNU_TYPE	:= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE 2> /dev/null || true)
 arch			:= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 
-GENCONTROL	:= perl -I $(CURDIR)/scripts scripts/dpkg-gencontrol.pl -isp
+GENCONTROL	:= perl -I $(CURDIR)/scripts $(BUILD)/scripts/dpkg-gencontrol -isp
+SHLIBDEPS	:= perl -I $(CURDIR)/scripts $(BUILD)/scripts/dpkg-shlibdeps
 
 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
   config_arg	:= --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
@@ -172,7 +173,7 @@ binary-dpkg-most binary-dpkg-static-most: binary-dpkg%-most: stamp-binary%
 	install -p -m 755 -o root -g root debian/dpkg.postinst $(TMP_DPKG)/DEBIAN/postinst
 	install -p -m 755 -o root -g root debian/dpkg.postrm $(TMP_DPKG)/DEBIAN/postrm
 
-	dpkg-shlibdeps -dPre-Depends -Tdebian/dpkg$(static).substvars \
+	$(SHLIBDEPS) -dPre-Depends -Tdebian/dpkg$(static).substvars \
 		$(TMP_DPKG)/sbin/start-stop-daemon \
 		`test -z "$(static)" && echo $(TMP_DPKG)/usr/bin/dpkg $(TMP_DPKG)/usr/bin/md5sum $(TMP_DPKG)/usr/bin/dpkg-deb`
 
@@ -280,7 +281,7 @@ binary-dselect: stamp-binary
 	install -d -m 755 -o root -g root $(TMP_DSELECT)/DEBIAN
 	install -p -m 644 -o root -g root debian/dselect.conffiles $(TMP_DSELECT)/DEBIAN/conffiles
 
-	dpkg-shlibdeps -Tdebian/dselect.substvars \
+	$(SHLIBDEPS) -Tdebian/dselect.substvars \
 		$(TMP_DSELECT)/usr/bin/dselect 
 	$(GENCONTROL) -Tdebian/dselect.substvars -pdselect -P$(TMP_DSELECT)
 	dpkg --build $(TMP_DSELECT) ..

+ 25 - 29
scripts/controllib.pl

@@ -105,22 +105,7 @@ sub substvars {
 sub outputclose {
     my ($dosubstvars) = @_;
     for $f (keys %f) { $substvar{"F:$f"}= $f{$f}; }
-    if (length($varlistfile) and $dosubstvars) {
-        $varlistfile="./$varlistfile" if $varlistfile =~ m/\s/;
-        if (open(SV,"< $varlistfile")) {
-            binmode(SV);
-            while (<SV>) {
-                next if m/^\#/ || !m/\S/;
-                s/\s*\n$//;
-                m/^(\w[-:0-9A-Za-z]*)\=/ ||
-                    &error("bad line in substvars file $varlistfile at line $.");
-                $substvar{$1}= $';
-            }
-            close(SV);
-        } elsif ($! != ENOENT ) {
-            &error("unable to open substvars file $varlistfile: $!");
-        }
-    }
+    &parsesubstvars if ($dosubstvars);
     for $f (sort { $fieldimps{$b} <=> $fieldimps{$a} } keys %f) {
         $v= $f{$f};
         if ($dosubstvars) {
@@ -154,20 +139,31 @@ sub parsecontrolfile {
         defined($fi{"C$i Package"}) ||
             &error("per-package paragraph $i in control info file is ".
                    "missing Package line");
-        foreach my $dep_field (@pkg_dep_fields) {
-            if (defined($fi{"C$i $dep_field"})) {
-                ($fi{"C$i $dep_field"} = parsedep($fi{"C$i $dep_field"}, 1, 1)) ||
-                    &error("per-package paragraph $i in control info file ".
-                           "invalid dependency field \`$dep_field'");
-            }
-        }
     }
-    foreach my $dep_field (@src_dep_fields) {
-        if (defined($fi{"C $dep_field"})) {
-            ($fi{"C $dep_field"} = parsedep($fi{"C $dep_field"}, 1, 1)) ||
-                &error("source paragraph in control info file ".
-                       "invalid dependency field \`$dep_field'");
+    defined($fi{"C Source"}) ||
+        &error("source paragraph in control info file is ".
+               "missing Source line");
+
+}
+
+my $substvarsparsed = 0;
+sub parsesubstvars {
+    if (length($varlistfile) && !$substvarsparsed) {
+        $varlistfile="./$varlistfile" if $varlistfile =~ m/\s/;
+        if (open(SV,"< $varlistfile")) {
+            binmode(SV);
+            while (<SV>) {
+                next if m/^\#/ || !m/\S/;
+                s/\s*\n$//;
+                m/^(\w[-:0-9A-Za-z]*)\=/ ||
+                    &error("bad line in substvars file $varlistfile at line $.");
+                $substvar{$1}= $';
+            }
+            close(SV);
+        } elsif ($! != ENOENT ) {
+            &error("unable to open substvars file $varlistfile: $!");
         }
+        $substvarsparsed = 1;
     }
 }
 
@@ -183,7 +179,7 @@ sub parsedep {
 ALTERNATE:
         foreach my $dep_or (split(/\s*\|\s*/m, $dep_and)) {
             my ($package, $relation, $version);
-            $package = $1 if ($dep_or =~ s/^(\S+)\s*//m);
+            $package = $1 if ($dep_or =~ s/^([a-zA-Z0-9][a-zA-Z0-9+._-]*)\s*//m);
             ($relation, $version) = ($1, $2) if ($dep_or =~ s/^\((=|<=|>=|<<?|>>?)\s*([^)]+).*\)\s*//m);
             my @arches = split(/\s+/m, $1) if ($use_arch && $dep_or =~ s/^\[([^]]+)\]\s*//m);
             if ($reduce_arch && @arches) {

+ 4 - 4
scripts/dpkg-checkbuilddeps.pl

@@ -41,16 +41,16 @@ local $/='';
 
 my $dep_regex=qr/[ \t]*(([^\n]+|\n[ \t])*)\s/; # allow multi-line
 if (defined($fi{"C Build-Depends"})) {
-	push @unmet, build_depends($fi{"C Build-Depends"}, @status);
+	push @unmet, build_depends(parsedep($fi{"C Build-Depends"}), @status);
 }
 if (defined($fi{"C Build-Conflicts"})) {
-	push @unmet, build_conflicts($fi{"C Build-Conflicts"}, @status);
+	push @unmet, build_conflicts(parsedep($fi{"C Build-Conflicts"}), @status);
 }
 if (! $binary_only && defined($fi{"C Build-Depends-Indep"})) {
-	push @unmet, build_depends($fi{"C Build-Depends-Indep"}, @status);
+	push @unmet, build_depends(parsedep($fi{"C Build-Depends-Indep"}), @status);
 }
 if (! $binary_only && defined($fi{"C Build-Conflicts-Indep"})) {
-	push @unmet, build_conflicts($fi{"C Build-Conflicts-Indep"}, @status);
+	push @unmet, build_conflicts(parsedep($fi{"C Build-Conflicts-Indep"}), @status);
 }
 
 if (@unmet) {

+ 2 - 1
scripts/dpkg-gencontrol.pl

@@ -98,6 +98,7 @@ while (@ARGV) {
 
 &findarch;
 &parsechangelog;
+&parsesubstvars;
 &parsecontrolfile;
             
 if (length($oppackage)) {
@@ -129,7 +130,7 @@ for $_ (keys %fi) {
         if (m/^(Package|Description|Essential|Optional)$/) {
             $f{$_}= $v;
         } elsif (exists($pkg_dep_fields{$_})) {
-            $f{$_}= showdep($v, 0);
+            $f{$_}= showdep(parsedep(substvars($v)), 0);
         } elsif (m/^Section$|^Priority$/) {
             $spvalue{$_}= $v;
         } elsif (m/^Architecture$/) {

+ 1 - 1
scripts/dpkg-source.pl

@@ -155,7 +155,7 @@ if ($opmode eq 'build') {
         if (s/^C //) {
             if (m/^Source$/i) { &setsourcepackage; }
             elsif (m/^(Standards-Version|Origin|Maintainer|Uploaders)$/i) { $f{$_}= $v; }
-	    elsif (m/^Build-(Depends|Conflicts)(-Indep)?$/i) { $f{$_}= showdep($v, 0); }
+	    elsif (m/^Build-(Depends|Conflicts)(-Indep)?$/i) { $f{$_}= $v; }
             elsif (s/^X[BC]*S[BC]*-//i) { $f{$_}= $v; }
             elsif (m/^(Section|Priority|Files|Bugs)$/i || m/^X[BC]+-/i) { }
             else { &unknown('general section of control info file'); }