Просмотр исходного кода

Implement support for Homepage field.

Guillem Jover лет назад: 19
Родитель
Сommit
db992d8325
10 измененных файлов с 50 добавлено и 6 удалено
  1. 14 0
      ChangeLog
  2. 1 0
      debian/changelog
  3. 18 0
      dpkg-deb/build.c
  4. 5 0
      man/ChangeLog
  5. 3 0
      man/deb-control.5
  6. 1 0
      man/dpkg-query.1
  7. 1 1
      scripts/dpkg-genchanges.pl
  8. 2 2
      scripts/dpkg-gencontrol.pl
  9. 1 1
      scripts/dpkg-scanpackages.pl
  10. 4 2
      scripts/dpkg-source.pl

+ 14 - 0
ChangeLog

@@ -1,3 +1,17 @@
+2007-08-20  Guillem Jover  <guillem@debian.org>
+
+	* dpkg-deb/build.c (arbitrary_fields): New variable.
+	(known_arbitrary_field): New function.
+	(do_build): Call known_arbitrary_field to not warn on known arbitrary
+	fields.
+	* scripts/dpkg-genchanges.pl: Ignore Homepage field.
+	* scripts/dpkg-gencontrol.pl: Parse Homepage from source package
+	stanza.
+	(@control_fields): Add Homepage.
+	* scripts/dpkg-scanpackages.pl (@fieldpri): Add Homepage.
+	* scripts/dpkg-source.pl: Parse Homepage from source package stanza.
+	(@dsc_fields): Add Homepage.
+
 2007-08-18  Guillem Jover  <guillem@debian.org>
 2007-08-18  Guillem Jover  <guillem@debian.org>
 
 
 	* scripts/dpkg-divert.pl (infol): Check if parameters are defined
 	* scripts/dpkg-divert.pl (infol): Check if parameters are defined

+ 1 - 0
debian/changelog

@@ -37,6 +37,7 @@ dpkg (1.14.6) UNRELEASED; urgency=low
     Thanks to Ian Jackson.
     Thanks to Ian Jackson.
   * Fix perl warnings:
   * Fix perl warnings:
     - When removing a non diverted file with dpkg-divert. Closes: #438416
     - When removing a non diverted file with dpkg-divert. Closes: #438416
+  * Implement support for Homepage field. Closes: #142324
 
 
   [ Updated scripts translations ]
   [ Updated scripts translations ]
   * French (Frédéric Bothamy, Christian Perrier).
   * French (Frédéric Bothamy, Christian Perrier).

+ 18 - 0
dpkg-deb/build.c

@@ -56,6 +56,21 @@ struct _finfo {
   struct _finfo* next;
   struct _finfo* next;
 };
 };
 
 
+const char *arbitrary_fields[]= {
+  "Homepage",
+  NULL
+};
+
+static int known_arbitrary_field(const struct arbitraryfield *field) {
+  const char **known;
+
+  for (known= arbitrary_fields; *known; known++)
+    if (strcasecmp(field->name, *known) == 0)
+      return 1;
+
+  return 0;
+}
+
 /* Do a quick check if vstring is a valid versionnumber. Valid in this case
 /* Do a quick check if vstring is a valid versionnumber. Valid in this case
  * means it contains at least one digit. If an error is found increment
  * means it contains at least one digit. If an error is found increment
  * *errs.
  * *errs.
@@ -223,6 +238,9 @@ void do_build(const char *const *argv) {
       warns++;
       warns++;
     }
     }
     for (field= checkedinfo->available.arbs; field; field= field->next) {
     for (field= checkedinfo->available.arbs; field; field= field->next) {
+      if (known_arbitrary_field(field))
+        continue;
+
       fprintf(stderr, _("warning, `%s' contains user-defined field `%s'\n"),
       fprintf(stderr, _("warning, `%s' contains user-defined field `%s'\n"),
               controlfile, field->name);
               controlfile, field->name);
       warns++;
       warns++;

+ 5 - 0
man/ChangeLog

@@ -1,3 +1,8 @@
+2007-08-20  Guillem Jover  <guillem@debian.org>
+
+	* deb-control.5: Document Homepage field.
+	* dpkg-query.1: Document Homepage as a recognized field.
+
 2007-08-18  Guillem Jover  <guillem@debian.org>
 2007-08-18  Guillem Jover  <guillem@debian.org>
 
 
 	* po/dpkg-man.pot: Regenerated.
 	* po/dpkg-man.pot: Regenerated.

+ 3 - 0
man/deb-control.5

@@ -85,6 +85,9 @@ etc. Note that the
 option is meant for packages that are architecture independent. Some examples
 option is meant for packages that are architecture independent. Some examples
 of this are shell and Perl scripts, and documentation.
 of this are shell and Perl scripts, and documentation.
 .TP
 .TP
+.BR Homepage: " <url>"
+The upstream project home page URL.
+.TP
 .BR Source: " <source name>"
 .BR Source: " <source name>"
 The name of the source package that this binary package came from, if
 The name of the source package that this binary package came from, if
 different than the name of the package itself.
 different than the name of the package itself.

+ 1 - 0
man/dpkg-query.1

@@ -109,6 +109,7 @@ alignment will be used. The following \fIfield\fRs are recognised:
     \fBEnhances\fP
     \fBEnhances\fP
     \fBEssential\fP
     \fBEssential\fP
     \fBFilename\fP
     \fBFilename\fP
+    \fBHomepage\fP
     \fBInstalled\-Size\fP
     \fBInstalled\-Size\fP
     \fBMD5sum\fP
     \fBMD5sum\fP
     \fBMSDOS\-Filename\fP
     \fBMSDOS\-Filename\fP

+ 1 - 1
scripts/dpkg-genchanges.pl

@@ -208,7 +208,7 @@ for $_ (keys %fi) {
 	elsif (m/^Section$|^Priority$/i) { $sourcedefault{$_}= $v; }
 	elsif (m/^Section$|^Priority$/i) { $sourcedefault{$_}= $v; }
 	elsif (m/^Maintainer$/i) { $f{$_}= $v; }
 	elsif (m/^Maintainer$/i) { $f{$_}= $v; }
 	elsif (s/^X[BS]*C[BS]*-//i) { $f{$_}= $v; }
 	elsif (s/^X[BS]*C[BS]*-//i) { $f{$_}= $v; }
-	elsif (m/|^X[BS]+-|^Standards-Version$/i) { }
+	elsif (m/|^X[BS]+-|^Standards-Version$|^Homepage$/i) { }
 	else { &unknown(_g('general section of control info file')); }
 	else { &unknown(_g('general section of control info file')); }
     } elsif (s/^C(\d+) //) {
     } elsif (s/^C(\d+) //) {
 	my $i = $1;
 	my $i = $1;

+ 2 - 2
scripts/dpkg-gencontrol.pl

@@ -23,7 +23,7 @@ textdomain("dpkg-dev");
 
 
 my @control_fields = (qw(Package Source Version Architecture Essential Origin
 my @control_fields = (qw(Package Source Version Architecture Essential Origin
                          Bugs Maintainer Installed-Size), @pkg_dep_fields,
                          Bugs Maintainer Installed-Size), @pkg_dep_fields,
-                      qw(Section Priority Description));
+                      qw(Section Priority Homepage Description));
 
 
 my $controlfile = 'debian/control';
 my $controlfile = 'debian/control';
 my $changelogfile = 'debian/changelog';
 my $changelogfile = 'debian/changelog';
@@ -146,7 +146,7 @@ for $_ (keys %fi) {
 
 
     if (s/^C //) {
     if (s/^C //) {
 #print STDERR "G key >$_< value >$v<\n";
 #print STDERR "G key >$_< value >$v<\n";
-	if (m/^(Origin|Bugs|Maintainer)$/) {
+	if (m/^(Origin|Bugs|Maintainer|Homepage)$/) {
 	    $f{$_} = $v;
 	    $f{$_} = $v;
 	} elsif (m/^Source$/) {
 	} elsif (m/^Source$/) {
 	    setsourcepackage($v);
 	    setsourcepackage($v);

+ 1 - 1
scripts/dpkg-scanpackages.pl

@@ -26,7 +26,7 @@ my %kmap= (optional         => 'suggests',
 
 
 my @fieldpri = (qw(Package Source Version Architecture Essential Origin Bugs
 my @fieldpri = (qw(Package Source Version Architecture Essential Origin Bugs
                    Maintainer Installed-Size), @pkg_dep_fields, qw(Filename
                    Maintainer Installed-Size), @pkg_dep_fields, qw(Filename
-                   Size MD5sum Section Priority Description));
+                   Size MD5sum Section Priority Homepage Description));
 
 
 # This maps the fields into the proper case
 # This maps the fields into the proper case
 my %field_case;
 my %field_case;

+ 4 - 2
scripts/dpkg-source.pl

@@ -76,7 +76,8 @@ our @src_dep_fields;
 textdomain("dpkg-dev");
 textdomain("dpkg-dev");
 
 
 my @dsc_fields = (qw(Format Source Binary Architecture Version Origin
 my @dsc_fields = (qw(Format Source Binary Architecture Version Origin
-                     Maintainer Uploaders Standards-Version), @src_dep_fields);
+                     Maintainer Uploaders Homepage Standards-Version),
+                  @src_dep_fields);
 
 
 
 
 # Make sure patch doesn't get any funny ideas
 # Make sure patch doesn't get any funny ideas
@@ -238,8 +239,9 @@ if ($opmode eq 'build') {
         if (s/^C //) {
         if (s/^C //) {
 	    if (m/^Source$/i) {
 	    if (m/^Source$/i) {
 		setsourcepackage($v);
 		setsourcepackage($v);
+	    } elsif (m/^(Standards-Version|Origin|Maintainer|Homepage)$/i) {
+		$f{$_}= $v;
 	    }
 	    }
-            elsif (m/^(Standards-Version|Origin|Maintainer)$/i) { $f{$_}= $v; }
 	    elsif (m/^Uploaders$/i) { ($f{$_}= $v) =~ s/[\r\n]//g; }
 	    elsif (m/^Uploaders$/i) { ($f{$_}= $v) =~ s/[\r\n]//g; }
 	    elsif (m/^Build-(Depends|Conflicts)(-Indep)?$/i) {
 	    elsif (m/^Build-(Depends|Conflicts)(-Indep)?$/i) {
 		my $dep = parsedep(substvars($v),1);
 		my $dep = parsedep(substvars($v),1);