Re: Check for deprecated automake configure.in (wishlist #708482)
Hello,
Thank you for your comments, and sorry I took a while to answer, I got
sidetracked with !($debian-related) matters.
Sat, Aug 17, 2013 at 11:45:07AM +0200 -- Niels Thykier :
> It looks pretty good; I have interleaved my remarks in the patch below.
> The only thing missing is a test for it. Getting started on that
> should basically be a matter of:
> [...]
> This should fail if my quick-test is correct and your check works. To
> have it succeed, you have to update the t/tests/automake-general/tags
> file to contain the (sorted) lintian output.
I added the test, and indeed, it failed at first, then passed when I
added the tag to the test.
> > +Severity: pedantic
> I think it should be at least a wishlist and possibly even normal.
I changed it to wishlist, but I don't feel very strongly one way or the
other :)
> > +Certainty: possible
> This /might/ be certain. I believe we use it as a indicator of how
> likely a false-positive is (i.e. if it only have false-negatives, then I
> believe we would call it certain).
I've changed it to certain, because:
- Assuming automake is used in the package build, a 'configure.in'
will always trigger a warning from automake, even if there's a
'configure.ac' right beside it.
- I guess it's unlikely to have a 'Makefile.am' and not use automake.
So a false positive doesn't look very probable.
> The code itself looks good at first glance. There are some minor
> stylistic things, but I believe we are currently considering to use
> perltidy. Hopefully soon such things will be a thing of the past. :)
>
> The perltidy rules suggested are available at [1] in case you want to
> try it. :)
Thanks, I used your perltidyrc. (I usually like my brackets to be on a
line of their own, and I inadvertently let one get away with it!)
I attached the new patch.
Best regards,
--
Gautier
>From cecaeca144d465cb10b11ef7244e805abbe6d5ff Mon Sep 17 00:00:00 2001
From: Gautier Minster <gautier+debian@minster.io>
Date: Fri, 16 Aug 2013 21:54:21 +0200
Subject: [PATCH] c/automake.pm: Added check for deprecated configure.in
(#708482)
---
checks/automake.desc | 13 ++++++++++++
checks/automake.pm | 46 +++++++++++++++++++++++++++++++++++++++++
t/tests/automake-general/desc | 6 ++++++
t/tests/automake-general/tags | 1 +
4 files changed, 66 insertions(+)
create mode 100644 checks/automake.desc
create mode 100644 checks/automake.pm
create mode 100644 t/tests/automake-general/debian/Makefile.am
create mode 100644 t/tests/automake-general/debian/configure.in
create mode 100644 t/tests/automake-general/desc
create mode 100644 t/tests/automake-general/tags
diff --git a/checks/automake.desc b/checks/automake.desc
new file mode 100644
index 0000000..86416d7
--- /dev/null
+++ b/checks/automake.desc
@@ -0,0 +1,13 @@
+Check-Script: automake
+Author: Gautier Minster <gautier+debian@minster.io>
+Abbrev: autom
+Type: source
+Needs-Info: index
+Info: Checks for erroneous, missing or deprecated automake files
+
+Tag: deprecated-configure-filename
+Severity: wishlist
+Certainty: certain
+Info: The Autoconf input file name 'configure.in' is deprecated, use 'configure.ac'.
+Ref: https://lists.gnu.org/archive/html/automake/2013-05/msg00049.html
+Experimental: yes
diff --git a/checks/automake.pm b/checks/automake.pm
new file mode 100644
index 0000000..2aebb1a
--- /dev/null
+++ b/checks/automake.pm
@@ -0,0 +1,46 @@
+# automake -- lintian check script -*- perl -*-
+#
+# Copyright (C) 2013 Gautier Minster
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, you can find it on the World Wide
+# Web at http://www.gnu.org/copyleft/gpl.html, or write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+package Lintian::automake;
+use strict;
+use warnings;
+use autodie;
+
+use Lintian::Tags qw(tag);
+
+sub run {
+ my ($pkg, $type, $info) = @_;
+
+ my $makefile = $info->index('Makefile.am');
+
+ # If there's no Makefile.am, automake probably isn't used, we're fine
+ return unless defined $makefile;
+
+ my $deprecated_configure = $info->index('configure.in');
+
+ if (defined $deprecated_configure) {
+ tag 'deprecated-configure-filename';
+ }
+
+ return;
+}
+
+1;
+
diff --git a/t/tests/automake-general/debian/Makefile.am b/t/tests/automake-general/debian/Makefile.am
new file mode 100644
index 0000000..e69de29
diff --git a/t/tests/automake-general/debian/configure.in b/t/tests/automake-general/debian/configure.in
new file mode 100644
index 0000000..e69de29
diff --git a/t/tests/automake-general/desc b/t/tests/automake-general/desc
new file mode 100644
index 0000000..dbb3922
--- /dev/null
+++ b/t/tests/automake-general/desc
@@ -0,0 +1,6 @@
+Testname: automake-general
+Sequence: 6000
+Version: 1.0
+Description: Test if the package uses the deprecated configure.in for automake
+Test-For:
+ deprecated-configure-filename
diff --git a/t/tests/automake-general/tags b/t/tests/automake-general/tags
new file mode 100644
index 0000000..d3c534b
--- /dev/null
+++ b/t/tests/automake-general/tags
@@ -0,0 +1 @@
+X: automake-general source: deprecated-configure-filename
--
1.7.10.4
Reply to: