lintian: r835 - in trunk: checks debian testset testset/binary/debian
Author: rra
Date: 2007-03-17 07:07:49 +0100 (Sat, 17 Mar 2007)
New Revision: 835
Modified:
trunk/checks/rules
trunk/checks/rules.desc
trunk/debian/changelog
trunk/testset/binary/debian/rules
trunk/testset/tags.binary
Log:
* checks/rules{.desc,}:
+ [RA] Warn about use of $(PWD) instead of $(CURDIR).
Modified: trunk/checks/rules
===================================================================
--- trunk/checks/rules 2007-03-15 23:24:21 UTC (rev 834)
+++ trunk/checks/rules 2007-03-17 06:07:49 UTC (rev 835)
@@ -55,9 +55,16 @@
my %seen;
local $_;
while (<RULES>) {
+ next if /^\s*\#/;
$includes = 1 if /^ *[s-]?include\s+/;
- # We're looking only for the required targets. Ignore everything else.
+ # Check for problems that can occur anywhere in debian/rules.
+ if (/\$[\(\{]PWD[\)\}]/) {
+ tag "debian-rules-uses-pwd", "line $.";
+ }
+
+ # After this point, we're only doing target analysis, so skip everything
+ # else.
next unless /^([^:]+):/;
my @targets = split (' ', $1);
for (@targets) {
Modified: trunk/checks/rules.desc
===================================================================
--- trunk/checks/rules.desc 2007-03-15 23:24:21 UTC (rev 834)
+++ trunk/checks/rules.desc 2007-03-17 06:07:49 UTC (rev 835)
@@ -33,3 +33,15 @@
of the required targets. All of build, binary, binary-arch,
binary-indep, and clean must be provided, even if they don't do anything
for this package.
+
+Tag: debian-rules-uses-pwd
+Type: warning
+Info: The <tt>debian/rules</tt> file for this package appears to use the
+ variable $(PWD) to refer to the current directory. This variable is not
+ set by GNU make and therefore will have whatever value it has in the
+ environment, which may not be the actual current directory. Some ways of
+ building Debian packages (such as through sudo) will clear the PWD
+ environment variable.
+ .
+ Instead of $(PWD), use $(CURDIR), which is set by GNU make, ignores the
+ environment, and is guaranteed to always be set.
Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog 2007-03-15 23:24:21 UTC (rev 834)
+++ trunk/debian/changelog 2007-03-17 06:07:49 UTC (rev 835)
@@ -47,10 +47,11 @@
compare the generated pot file with the one in the package both
directions to catch all out of date errors. Thanks, Thomas
Huriaux. (Closes: #402662)
- * checks/rules.desc:
+ * checks/rules{.desc,}:
+ [RA] Fix the policy section for debian-rules-missing-required-target
and debian-rules-not-a-makefile. Thanks, Daniel Kahn Gillmor.
(Closes: #414964)
+ + [RA] Warn about use of $(PWD) instead of $(CURDIR).
* checks/scripts{.desc,}:
+ [RA] update-inetd is now its own package and netbase may not always
depend on it. Update the check to require a dependency on
Modified: trunk/testset/binary/debian/rules
===================================================================
--- trunk/testset/binary/debian/rules 2007-03-15 23:24:21 UTC (rev 834)
+++ trunk/testset/binary/debian/rules 2007-03-17 06:07:49 UTC (rev 835)
@@ -2,8 +2,11 @@
tmp=debian/tmp
+# This reference to $(PWD) should not cause an error but the one below
+# should.
build:
make
+ echo $(PWD)
clean:
make clean
Modified: trunk/testset/tags.binary
===================================================================
--- trunk/testset/tags.binary 2007-03-15 23:24:21 UTC (rev 834)
+++ trunk/testset/tags.binary 2007-03-17 06:07:49 UTC (rev 835)
@@ -32,6 +32,7 @@
I: binary: binary-has-unneeded-section ./usr/bin/hello-static .comment
I: binary: no-md5sums-control-file
W: binary source: ancient-standards-version 3.2.1 (current is 3.7.2)
+W: binary source: debian-rules-uses-pwd line 9
W: binary source: maintainer-upload-has-incorrect-version-number 4-1.1
W: binary source: native-package-with-dash-version
W: binary source: not-binnmuable-all-depends-any binary-data -> binary
Reply to: