Bug#367466: lintian: enhancement, check for missing menu files

2006-05-21 Thread Matt Taggart

Russ Allbery writes...

 I'm worried about the number of false positives here, from packages like
 gksu that might link with X libraries but shouldn't have menu entries for
 themselves.  There may be quite a few helper programs like that that link
 with X but aren't applications in the menu sense.
 
 (There are also a lot of false negatives, of course, including binaries
 that link with a toolkit rather than with the X libraries directly, but
 that doesn't necessarily rule it out.)

OK, I'd like to try to fix the patch to deal with any false positives.

Does someone run lintian on the whole archive that could try with this
patch and give me a list of packages that report the problem?

-- 
Matt Taggart
[EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#367466: lintian: enhancement, check for missing menu files

2006-05-21 Thread Russ Allbery
Matt Taggart [EMAIL PROTECTED] writes:

 OK, I'd like to try to fix the patch to deal with any false positives.

 Does someone run lintian on the whole archive that could try with this
 patch and give me a list of packages that report the problem?

I'm not sure that anyone is currently doing this.  It unfortunately takes
a very, very long time to do.  I've been meaning to set up a test
environment where I can run that sort of controlled test, but
realistically I'm not going to have time before late this summer.

-- 
Russ Allbery ([EMAIL PROTECTED])   http://www.eyrie.org/~eagle/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#367466: lintian: enhancement, check for missing menu files

2006-05-16 Thread Matt Taggart
Package: lintian
Version: 1.23.21
Severity: wishlist

I have an idea for a lintian enhancement. There are packages that
provide GUI programs (gtk,qt,etc.) that do not provide a menu file for
those programs, ideally they would all provide menu files.

Here is a patch that adds a test to the binaries check. It checks each
executable binary to see if it uses libX11 and if any do and the package
doesn't have a menu file it issues a warning. I have tested it on

1) a deb that has no menu file and a libX11 using executable and it
  correctly reports it.
2) a deb that has no menu file and libX11 using _libraries_ (libxt
  package) and it correctly does not report.
3) a deb that had a menu file and a libX11 using executable and it
  correctly does not report.

Can you think of any other cases where this test would mistakenly fail?
This is my first lintian patch, so let me know if I haven't done things
correctly.

Thanks,

-- 
Matt Taggart
[EMAIL PROTECTED]

diff -ur lintian-1.23.21/checks/binaries lintian-1.23.21.new/checks/binaries
--- lintian-1.23.21/checks/binaries 2006-04-02 17:40:48.0 -0500
+++ lintian-1.23.21.new/checks/binaries 2006-05-16 01:57:38.0 -0500
@@ -31,6 +31,8 @@
 my $arch;
 my $dynsyms = 0;
 my $needs_depends_line = 0;
+my $has_x11 = 0;
+my $has_menu = 0;
 
 my %COMMENT;
 my %NOTE;
@@ -166,6 +168,11 @@
 m/^(.+?):\s+(.*)$/o or fail(an error in the file pkg is preventing 
lintian from checking this package: $_);
 my ($file,$info) = ($1,$2);
 
+# check for menu file
+if ($file =~ m,/usr/(lib|share)/menu/,) {
+   $has_menu++;
+}
+
 # binary or object file?
 next unless ($info =~ m/^[^,]*\bELF\b/) or ($info =~ m/\bcurrent ar 
archive\b/);
 
@@ -268,6 +275,10 @@
if ($lib =~ m/^libc/o) {
$no_libc = 0;
}
+   # count executables that use X11
+   if ( $info =~ m/executable/ and $lib =~ m/^libX11/o) {
+   $has_x11++;
+   }
}
 
if ($no_libc and not $file =~ m,/libc\b,) {
@@ -281,6 +292,11 @@
 }
 close(IN);
 
+# did a binary use X11 and we don't have a menu file?
+if ($has_x11 and !$has_menu) {
+   tag binary-uses-x11-no-menu, ;
+}
+
 if ($needs_depends_line) {
 if (not -e fields/depends and not -e fields/pre-depends) {
tag missing-depends-line, 
diff -ur lintian-1.23.21/checks/binaries.desc 
lintian-1.23.21.new/checks/binaries.desc
--- lintian-1.23.21/checks/binaries.desc2006-03-11 21:33:35.0 
-0600
+++ lintian-1.23.21.new/checks/binaries.desc2006-05-16 01:49:24.0 
-0500
@@ -145,3 +145,11 @@
 Info: This appears to be an ELF file but objdump -T cannot parse it.
  If it is external debugging symbols for another file, it should be
  installed under /usr/lib/debug.
+
+Tag: binary-uses-x11-no-menu
+Type: warning
+Info: This package contains an executable linked against libX11, but does
+ not appear to have a menu file. This is a very basic test, if a package
+ does not have a menu file any executable that requires libX11 will cause
+ this warning. Please inspect your executables and determine if a menu
+ file is needed.


Bug#367466: lintian: enhancement, check for missing menu files

2006-05-16 Thread Russ Allbery
Matt Taggart [EMAIL PROTECTED] writes:

 Package: lintian
 Version: 1.23.21
 Severity: wishlist

 I have an idea for a lintian enhancement. There are packages that
 provide GUI programs (gtk,qt,etc.) that do not provide a menu file for
 those programs, ideally they would all provide menu files.

 Here is a patch that adds a test to the binaries check. It checks each
 executable binary to see if it uses libX11 and if any do and the package
 doesn't have a menu file it issues a warning. I have tested it on

I'm worried about the number of false positives here, from packages like
gksu that might link with X libraries but shouldn't have menu entries for
themselves.  There may be quite a few helper programs like that that link
with X but aren't applications in the menu sense.

(There are also a lot of false negatives, of course, including binaries
that link with a toolkit rather than with the X libraries directly, but
that doesn't necessarily rule it out.)

-- 
Russ Allbery ([EMAIL PROTECTED])   http://www.eyrie.org/~eagle/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]