Some patches
Hi all,
As already mentioned in a previous message I have made some changes, here
are they.
The first patch (spelling.patch) adds a couple of spelling mistakes, and
some project names.
The second patch (php4.patch) removes php4 from the list of known
interpreters, as scripts should no longer use php4 in the shebang.
The third one (watch.patch) adds a couple of test cases together with some
improvements to the watch-file check to reduce false positives and false
negatives.
Regards,
--
Atomo64 - Raphael
Please avoid sending me Word, PowerPoint or Excel attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
--- a/checks/scripts
+++ b/checks/scripts
@@ -140,7 +140,7 @@ our %versioned_interpreters =
qr/^octave([\d.]+)$/, 'octave$1', qw(2.1 2.9 3.0)
],
php => [ '/usr/bin', '',
- qr/^php(\d+)$/, 'php$1-cli', qw(4 5)
+ qr/^php(\d+)$/, 'php$1-cli', qw(5)
],
pike => [ '/usr/bin', '',
qr/^pike([\d.]+)$/, 'pike$1 | pike$1-core', qw(7.6 7.7)
diff --git a/lib/Spelling.pm b/lib/Spelling.pm
index 2a70267..639254a 100644
--- a/lib/Spelling.pm
+++ b/lib/Spelling.pm
@@ -133,6 +133,7 @@ our %CORRECTIONS = qw(
edditable editable
editting editing
eletronic electronic
+ enhaced enhanced
enchanced enhanced
encorporating incorporating
enlightnment enlightenment
@@ -271,6 +272,7 @@ our %CORRECTIONS = qw(
setts sets
similiar similar
simliar similar
+ synax syntax
speach speech
speling spelling
splitted split
@@ -347,6 +349,8 @@ our %CORRECTIONS_CASE = qw(
Mysql MySQL
mysql MySQL
linux Linux
+ latex LaTeX
+ Latex LaTeX
OCAML OCaml
Ocaml OCaml
ocaml OCaml
@@ -364,6 +368,7 @@ our %CORRECTIONS_CASE = qw(
s-lang S-Lang
TCL Tcl
tcl Tcl
+ Tex TeX
TEX TeX
TeTeX teTeX
Tetex teTeX
diff --git a/checks/watch-file b/checks/watch-file
index 14edf80..2f9be21 100644
--- a/checks/watch-file
+++ b/checks/watch-file
@@ -31,65 +31,75 @@ my $pkg = shift;
my $type = shift;
my $info = shift;
-unless ($info->native) {
- unless (-f "debfiles/watch") {
- tag 'debian-watch-file-is-missing';
- return;
- }
+if (! -f "debfiles/watch") {
+ tag 'debian-watch-file-is-missing' unless ($info->native);
+ return;
+}
- my $version = $info->field('version');
- # Check if the Debian version contains anything that resembles a repackaged
- # source package sign, for fine grained version mangling check
- my $repack;
- if ($version =~ /(dfsg|debian|ds)/) {
- $repack = $1;
+# Perform the other checks even if it is a native package
+tag 'debian-watch-file-in-native-package' if ($info->native);
+
+my $version = $info->field('version');
+# Check if the Debian version contains anything that resembles a repackaged
+# source package sign, for fine grained version mangling check
+my $repack;
+if ($version =~ /(dfsg|debian|ds)/) {
+ $repack = $1;
+}
+
+# Gather information from the watch file and look for problems we can
+# diagnose on the first time through.
+open(WATCH, '<', 'debfiles/watch') or fail("cannot open watch file: $!");
+local $_;
+my ($watchver, $mangle, $dmangle);
+while (<WATCH>) {
+ next if /^\s*\#/;
+ next if /^\s*$/;
+ s/^\s*//;
+ if (s/(?<!\\)\\$//) {
+ # this is catched by uscan, no need to examine every aspect
+ last if (eof(WATCH));
+ $_ .= <WATCH>;
}
- # Gather information from the watch file and look for problems we can
- # diagnose on the first time through.
- open(WATCH, '<', 'debfiles/watch') or fail("cannot open watch file: $!");
- local $_;
- my ($watchver, $mangle, $dmangle);
- while (<WATCH>) {
- next if /^\s*\#/;
- next if /^\s*$/;
- if (/^version=(\d+)(\s|\Z)/) {
- if (defined $watchver) {
- tag 'debian-watch-file-declares-multiple-versions', "line $.";
- }
- $watchver = $1;
- if ($watchver ne '2' and $watchver ne '3') {
- tag 'debian-watch-file-unknown-version', $watchver;
- }
- } else {
- unless ($watchver) {
- tag 'debian-watch-file-missing-version';
- $watchver = 1;
- }
- while (s/\\\s*$//) {
- $_ .= <WATCH>;
- }
- chomp;
- my ($opts, @opts);
- if (s/^opts=\"([^\"]+)\"// || s/^opts=(\S+)\s*//) {
- $opts = $1;
- @opts = split(',', $opts);
- $mangle = 1 if grep { /^[ud]versionmangle.*=.*($repack)/ } @opts;
- $dmangle = 1 if grep { /^dversionmangle.*=.*($repack)/ } @opts;
- }
+ if (/^version\s*=\s*(\d+)(\s|$)/) {
+ if (defined $watchver) {
+ tag 'debian-watch-file-declares-multiple-versions', "line $.";
+ }
+ $watchver = $1;
+ if ($watchver ne '2' and $watchver ne '3') {
+ tag 'debian-watch-file-unknown-version', $watchver;
+ }
+ } else {
+ unless (defined($watchver)) {
+ tag 'debian-watch-file-missing-version';
+ $watchver = 1;
+ }
+ while (s/\\\s*$//) {
+ $_ .= <WATCH>;
+ }
+ chomp;
+ my ($opts, @opts);
+ if (s/^opt(ion)?s=\"([^\"]+)\"\s+// || s/^opt(ion)?s=(\S+)\s+//) {
+ $opts = $2;
+ @opts = split(',', $opts);
+ unless (!defined($repack)) {
+ $mangle = 1 if grep { /^[ud]versionmangle.*=.*($repack)/ } @opts;
+ $dmangle = 1 if grep { /^dversionmangle.*=.*($repack)/ } @opts;
+ }
}
}
- close WATCH;
+}
+close WATCH;
- # If the version of the package contains dfsg, assume that it needs to be
- # mangled to get reasonable matches with upstream.
- if ($repack and not $mangle) {
- tag 'debian-watch-file-should-mangle-version';
- }
+# If the version of the package contains dfsg, assume that it needs to be
+# mangled to get reasonable matches with upstream.
+if ($repack and not $mangle) {
+ tag 'debian-watch-file-should-mangle-version';
+}
- if ($repack and $mangle and not $dmangle) {
- tag 'debian-watch-file-should-dversionmangle-not-uversionmangle';
- }
+if ($repack and $mangle and not $dmangle) {
+ tag 'debian-watch-file-should-dversionmangle-not-uversionmangle';
}
}
diff --git a/checks/watch-file.desc b/checks/watch-file.desc
index 4ed9fd6..f2a93f0 100644
--- a/checks/watch-file.desc
+++ b/checks/watch-file.desc
@@ -61,3 +61,10 @@ Info: The version of this package contains <tt>dfsg</tt>, <tt>ds</tt>,
<tt>dfsg</tt>-free as-is, the <tt>debian/watch</tt> file should
use the dversionmangle option to remove, instead of adding in uversionmangle,
the <tt>dfsg</tt> before version number comparison.
+
+Tag: debian-watch-file-in-native-package
+Type: warning
+Ref: http://wiki.debian.org/DEHS
+Info: The package ships a watch file although it is a Debian native package.
+ DEHS does not process watch files in native packages based on the reasoning
+ that native packages do not have <tt>upstreams</tt> to check for new releases.
diff --git a/testset/foo++/debian/watch b/testset/foo++/debian/watch
new file mode 100644
index 0000000..26f9a3c
--- /dev/null
+++ b/testset/foo++/debian/watch
@@ -0,0 +1,6 @@
+# A comment \
+version=0
+
+# uscan does not interpret the backslash above, it is just part of the comment
+
+http://domain.tld/file-(.*)\.tar\.gz
diff --git a/testset/maintainer-scripts/debian/changelog b/testset/maintainer-scripts/debian/changelog
index 0f8063d..a0c6dc5 100644
--- a/testset/maintainer-scripts/debian/changelog
+++ b/testset/maintainer-scripts/debian/changelog
@@ -1,4 +1,4 @@
-maintainer-scripts (7-0.1) unstable; urgency=low
+maintainer-scripts (7+dfsg-0.1) unstable; urgency=low
* Doing an upload for QA but I fail to give it a correct version number,
have some uploaders, and also fail to mention it... Bad me ;)
diff --git a/testset/maintainer-scripts/debian/watch b/testset/maintainer-scripts/debian/watch
new file mode 100644
index 0000000..982696c
--- /dev/null
+++ b/testset/maintainer-scripts/debian/watch
@@ -0,0 +1,11 @@
+# A whitespace is fine for uscan:
+ version=4
+
+# Following line should not be matched:
+#opts=uversionmangle=s/$/+debian/,dversionmangle=s/foo/bar/ \
+# Following one is incorrect, there's a missing backslash at the end
+opts=uversionmangle=s/$/+dfsg/,dversionmangle=s/foo/bar/
+
+# 'active' is useless here, but it works anyway
+options=active \
+http://domain.tld/foo-(.+)\.tar\.gz
\ No newline at end of file
diff --git a/testset/tags.foo++ b/testset/tags.foo++
index 43a1477..3a1ff76 100644
--- a/testset/tags.foo++
+++ b/testset/tags.foo++
@@ -15,6 +15,8 @@ E: foo++: no-copyright-file
E: foo++: wrong-debian-qa-address-set-as-maintainer Lintian Maintainer <debian-qa@lists.debian.org>
I: foo++: no-md5sums-control-file
W: foo++ source: ancient-standards-version 3.1.1 (current is 3.8.0)
+W: foo++ source: debian-watch-file-in-native-package
+W: foo++ source: debian-watch-file-unknown-version 0
W: foo++ source: uploader-address-looks-weird Jeroen van Wolffelaar<jeroen@localhost.localdomain>
W: foo++ source: uploader-not-full-name Frank
W: foo++ source: uploader-not-full-name Josip
diff --git a/testset/tags.maintainer-scripts b/testset/tags.maintainer-scripts
index 7e8437a..9140ff9 100644
--- a/testset/tags.maintainer-scripts
+++ b/testset/tags.maintainer-scripts
@@ -31,8 +31,11 @@ I: maintainer-scripts: no-md5sums-control-file
I: maintainer-scripts: output-of-updaterc.d-not-redirected-to-dev-null bar postrm
W: maintainer-scripts source: ancient-standards-version 3.1.1 (current is 3.8.0)
W: maintainer-scripts source: changelog-should-mention-qa
+W: maintainer-scripts source: debian-watch-file-in-native-package
+W: maintainer-scripts source: debian-watch-file-should-mangle-version
+W: maintainer-scripts source: debian-watch-file-unknown-version 4
W: maintainer-scripts source: package-uses-deprecated-debhelper-compat-version 1
-W: maintainer-scripts source: qa-upload-has-incorrect-version-number 7-0.1
+W: maintainer-scripts source: qa-upload-has-incorrect-version-number 7+dfsg-0.1
W: maintainer-scripts: ancient-dpkg-epoch-check preinst:8
W: maintainer-scripts: ancient-dpkg-long-filenames-check preinst:9
W: maintainer-scripts: ancient-dpkg-multi-conrep-check preinst:10
Reply to: