Bug#452316: Packages with empty directories

2007-11-21 Thread Russ Allbery
Neil Williams <[EMAIL PROTECTED]> writes:

> The only problem with the patch is that /usr/lib/perl5/ is often
> included just by creating a perl package. I've tried to get rid of it
> but it *is* created during 'make install' by use ExtUtils::MakeMaker;
> but it is not necessarily used by package files. Another problem is that
> the creation of the directory often doesn't show up in the build log - I
> can force it by running make install without sudo or a prefix:
>
> Warning: You do not have permissions to install into
> /usr/local/lib/perl/5.8.8 at /usr/share/perl/5.8/ExtUtils/Install.pm
> line 114.
> mkdir /usr/local/share/perl/5.8.8/XML: Permission denied at
> /usr/share/perl/5.8/ExtUtils/Install.pm line 176
>
> It seems that ExtUtils::MakeMaker insists on using both /usr/lib/perl5
> and /usr/share/perl5 whether the module itself uses them or not.

Currently you have to remove the empty directory yourself in debian/rules
after running make install.  It's one of the standard things that we do
for Perl packages.  It would be nice to fix ExtUtils::MakeMaker to not
create it in the first place, but so far as I know, no one has written a
patch.

-- 
Russ Allbery ([EMAIL PROTECTED])   



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



Bug#452316: Packages with empty directories

2007-11-21 Thread Neil Williams
Daniel Schepler wrote:
> On Tuesday 20 November 2007 11:20:17 pm Michael Biebl wrote:
>> Imho adding a lintian check for empty /usr/bin, /usr/sbin, /usr/lib and
>> /usr/include directories (as created by dh-make) would be a good start.
> 
> I wrote a lintian check implementing the conservative approach, and submitted 
> a patch as bug #452316.  It lists empty directories matching directories from 
> base-files, as well as any empty subdirectories of
> /usr/include, /usr/share/man, and some others where they clearly make no 
> sense.

The only problem with the patch is that /usr/lib/perl5/ is often
included just by creating a perl package. I've tried to get rid of it
but it *is* created during 'make install' by use ExtUtils::MakeMaker;
but it is not necessarily used by package files. Another problem is that
the creation of the directory often doesn't show up in the build log - I
can force it by running make install without sudo or a prefix:

Warning: You do not have permissions to install into
/usr/local/lib/perl/5.8.8 at /usr/share/perl/5.8/ExtUtils/Install.pm
line 114.
mkdir /usr/local/share/perl/5.8.8/XML: Permission denied at
/usr/share/perl/5.8/ExtUtils/Install.pm line 176

It seems that ExtUtils::MakeMaker insists on using both /usr/lib/perl5
and /usr/share/perl5 whether the module itself uses them or not.

Maybe someone from the Debian Perl group can show me where I'm going
wrong or maybe CDBS can check for empty directories but everytime I
remove debian/tmp/usr/lib/perl5, it gets recreated, despite not having
any mention of it in the package files.

-- 


Neil Williams
=
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/




signature.asc
Description: OpenPGP digital signature


Bug#452336: lintian: detect binaries in wrong location usr/share

2007-11-21 Thread Joerg Jaspert
Package: lintian
Version: 1.23.34
Severity: minor

Hi

a difference between linda and lintian that i would love to have in
lintian too (no lintian or linda overrides in the package):

lintian lives*.deb
W: lives: binary-or-shlib-defines-rpath ./usr/lib/lives/lives-exe /usr/lib
W: lives: binary-or-shlib-defines-rpath 
./usr/share/lives/plugins/effects/realtime/weed/compositor.wo /usr/lib
W: lives: binary-or-shlib-defines-rpath 
./usr/share/lives/plugins/effects/realtime/weed/gdk_fast_resize.wo /usr/lib
W: lives: binary-or-shlib-defines-rpath 
./usr/share/lives/plugins/effects/realtime/weed/videowall.wo /usr/lib
W: lives: binary-or-shlib-defines-rpath 
./usr/share/lives/plugins/playback/video/SDL /usr/lib

linda lives*.deb
E: lives; The file 
/usr/share/lives/plugins/effects/realtime/weed/alien_overlay.wo is considered 
architecture-dependent.
E: lives; The file 
/usr/share/lives/plugins/effects/realtime/weed/audio_volume.wo is considered 
architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/blurzoom.wo 
is considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/bump2d.wo is 
considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/ccorrect.wo 
is considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/colorkey.wo 
is considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/compositor.wo 
is considered architecture-dependent.
E: lives; The file 
/usr/share/lives/plugins/effects/realtime/weed/deinterlace.wo is considered 
architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/edge.wo is 
considered architecture-dependent.
E: lives; The file 
/usr/share/lives/plugins/effects/realtime/weed/fg_bg_removal.wo is considered 
architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/fireTV.wo is 
considered architecture-dependent.
E: lives; The file 
/usr/share/lives/plugins/effects/realtime/weed/gdk_fast_resize.wo is considered 
architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/haip.wo is 
considered architecture-dependent.
E: lives; The file 
/usr/share/lives/plugins/effects/realtime/weed/layout_blends.wo is considered 
architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/lifeTV.wo is 
considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/mirrors.wo is 
considered architecture-dependent.
E: lives; The file 
/usr/share/lives/plugins/effects/realtime/weed/multi_blends.wo is considered 
architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/negate.wo is 
considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/noise.wo is 
considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/onedTV.wo is 
considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/plasma.wo is 
considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/posterise.wo 
is considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/rippleTV.wo 
is considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/rotozoom.wo 
is considered architecture-dependent.
E: lives; The file 
/usr/share/lives/plugins/effects/realtime/weed/simple_blend.wo is considered 
architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/slide_over.wo 
is considered architecture-dependent.
E: lives; The file 
/usr/share/lives/plugins/effects/realtime/weed/targeted_zoom.wo is considered 
architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/textfun.wo is 
considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/vertigo.wo is 
considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/videowall.wo 
is considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/warpTV.wo is 
considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/effects/realtime/weed/xeffect.wo is 
considered architecture-dependent.
E: lives; The file /usr/share/lives/plugins/playback/video/SDL is considered 
architecture-dependent.
W: lives; Binary /usr/lib/lives/lives-exe compiled with an RPATH of /usr/lib.
W: lives; Binary /usr/share/lives/plugins/effects/realtime/weed/compositor.wo 
compiled with an RPATH of /usr/lib.
W: lives; Binary 
/usr/share/lives/plugins/effects/realtime/weed/gdk_fast_resize.wo compiled with 
an RPATH of /usr/lib.
W: lives; Binary /usr/share/lives/plugins/effects/realtime/weed/videowall.wo 
co

Bug#452316: lintian: Check for useless empty directories

2007-11-21 Thread Daniel Schepler
Package: lintian
Version: 1.23.36
Severity: wishlist

Following a recent thread on debian-devel, I've implemented a lintian check 
for useless empty directories.  This patch takes the conservative route of 
listing which directories are normally useless, as well as several 
directories where any empty subdirectories are likewise useless.

Note that this patch also deals with #357838.
-- 
Daniel Schepler
diff -urN lintian-1.23.36.old/checks/files lintian-1.23.36/checks/files
--- lintian-1.23.36.old/checks/files	2007-10-15 23:37:56.0 -0400
+++ lintian-1.23.36/checks/files	2007-11-21 15:58:45.0 -0500
@@ -75,6 +75,8 @@
 # We only want to warn about this once.
 my $warned_x11_predepends = 0;
 
+my %empty_dirs = ();
+
 # Read package contents...
 open(IN, '<', "index") or fail("cannot open index file index: $!");
 while () {
@@ -108,6 +110,11 @@
 	($file, $link) = split(' -> ', $file);
 }
 
+if ($file =~ m,^(.*/)[^/]+/?$,) {
+	delete $empty_dirs{$1};
+}
+$empty_dirs{$file} = 1 if $perm =~ /^d/;
+
 $operm = perm2oct($perm);
 
 my ($year) = ($date =~ /^(\d{4})/);
@@ -810,6 +817,40 @@
 }
 }
 
+my %base_dirs = ("bin/" => 1, "boot/" => 1, "dev/" => 1,
+		 "etc/" => 1, "etc/default/" => 1, "etc/opt/" => 1,
+		 "etc/skel/" => 1,
+		 "home/" => 1, "initrd/" => 1, "lib/" => 1, "media/" => 1,
+		 "mnt/" => 1, "opt/" => 1, "proc/" => 1, "root/" => 1,
+		 "sbin/" => 1, "srv/" => 1, "tmp/" => 1,
+		 "usr/" => 1, "usr/bin/" => 1, "usr/games/" => 1,
+		 "usr/games/" => 1, "usr/lib/" => 1, "usr/sbin/" => 1,
+		 "usr/share/" => 1, "usr/share/doc/" => 1,
+		 "usr/share/info/" => 1, "usr/share/man/" => 1,
+		 "usr/share/misc/" => 1, "usr/src/" => 1,
+		 "var/" => 1, "var/backups/" => 1, "var/cache/" => 1,
+		 "var/lib/" => 1, "var/lib/dpkg/" => 1, "var/lib/misc/" => 1,
+		 "var/local/" => 1, "var/lock/" => 1, "var/log/" => 1,
+		 "var/mail/" => 1, "var/opt/" => 1, "var/run/" => 1,
+		 "var/spool/" => 1, "var/tmp/" => 1);
+foreach my $dir (keys %empty_dirs) {
+if ($dir =~ m,^usr/include/, ||
+	$dir =~ m,^usr/share/doc/, ||
+	$dir =~ m,^usr/share/doc-base/, ||
+	$dir =~ m,^usr/share/info/, ||
+	$dir =~ m,^usr/share/locale/, ||
+	$dir =~ m,^usr/share/man/, ||
+	$dir =~ m,^usr/(lib|share)/menu/, ||
+	$dir =~ m,^usr/(lib|share)/perl5/, ||
+	$dir =~ m,^usr/share/applications/, ||
+	$dir =~ m,^usr/share/applnk/, ||
+	$dir =~ m,^usr/share/icons/, ||
+	$dir =~ m,^usr/share/pixmaps/, ||
+	$base_dirs{$dir}) {
+	tag "useless-empty-directory", "/" . substr($dir, 0, -1);
+}
+}
+
 }
 
 1;
diff -urN lintian-1.23.36.old/checks/files.desc lintian-1.23.36/checks/files.desc
--- lintian-1.23.36.old/checks/files.desc	2007-10-15 22:54:52.0 -0400
+++ lintian-1.23.36/checks/files.desc	2007-11-21 15:11:43.0 -0500
@@ -689,3 +689,8 @@
  .
  One possible cause is using debhelper 5.0.57 or earlier to install a
  doc-base file with a Document field that ends in whitespace.
+
+Tag: useless-empty-directory
+Type: warning
+Info: This package installs an empty directory which is already
+ provided by base-files or is otherwise useless.


Bug#377392: Bug#450432: ... and even more bugs like this?

2007-11-21 Thread Ivan Shmakov
> Colin Watson <[EMAIL PROTECTED]> writes:

 >> In a recent thread in debian-devel, it was suggested that lintian
 >> could call man(1) in such a way that the groff(1), called by `man',
 >> will emit warnings for every undefined macro, which is useful in
 >> catching the bugs like this:

 >> .B foo
 >> .  Note: ...

 >> Below is the patch that implements the suggestion.  Since `man'
 >> doesn't allow the `-wmac' option to be passed to `groff' by any
 >> other means, I've had to introduce two new files -- `mdoc.local' and
 >> `man.local' (to override the files in groff/site-tmac/), and the
 >> ${LINTIAN_ROOT}/groff-hack directory to hold them.

 > While I haven't reviewed the code in detail, the general approach
 > seems largely reasonable to me. However, the error the developer sees
 > will just be "manpage-has-errors-from-man", which in fact is no
 > longer really true in this case; you're specifically enabling
 > warnings that man doesn't show.  Perhaps it would be best to turn
 > these warnings from groff into a different lintian warning which can
 > have a more informative description, and ideally a way for the
 > developer to reproduce the problem.

A helper script, `lintian-man', could be introduced to hide all
the hackery, and to provide a way for the developer to reproduce
the problem.  Then, Tag: may be changed to, e. g.,
`manpage-has-messages-from-lintian-man'.  (Or should this script
be called `man-lintian'?)

I still hope that either `groff' or `man' will offer a way to
specify `-w'-options for `groff' in a more clean way.  The
helper script could then be modified, or eliminated entirely.

The patch is as follows.  (TODO: newly introduced lintian-man
script demands a man page on its own.)  This new version of the
patch suppresses `.IX'-related warnings.  (TODO: the generator
is to be fixed.)

--- lintian-1.23.36/checks/manpages 2007-10-16 10:40:04.0 +0700
+++ lintian-1.23.36-groff-hack/checks/manpages  2007-11-21 21:16:29.0 
+0600
@@ -253,10 +253,11 @@
# processed properly.  (Yes, there are man pages that include other
# pages with .so but aren't simple links; rbash, for instance.)
my $cmd;
+   my $man_cmd = "lintian-man -l";
if ($file =~ m,^(.*)/(man\d/.*)$,) {
-   $cmd = "cd unpacked/\Q$1\E && man -l \Q$2\E";
+   $cmd = "cd unpacked/\Q$1\E && $man_cmd \Q$2\E";
} else {
-   $cmd = "man -l unpacked/\Q$file\E";
+   $cmd = "$man_cmd unpacked/\Q$file\E";
}
my $pid = open MANERRS, '-|';
if (not defined $pid) {
@@ -282,7 +283,7 @@
}
chomp;
s/^[^:]+://o;
-   tag "manpage-has-errors-from-man", "$file", "$_";
+   tag "manpage-has-messages-from-lintian-man", "$file", "$_";
last;
}
close(MANERRS);
--- lintian-1.23.36/checks/manpages.desc2007-06-21 15:48:26.0 
+0700
+++ lintian-1.23.36-groff-hack/checks/manpages.desc 2007-11-21 
21:16:26.0 +0600
@@ -120,9 +120,12 @@
  Please double-check the manual page and replace the template language
  with specific information about this program.
 
-Tag: manpage-has-errors-from-man
+Tag: manpage-has-messages-from-lintian-man
 Type: warning
-Info: This man page provokes warnings or errors from man.
+Info: This man page provokes warnings or errors from lintian-man.
+ .
+ lintian-man is a helper script which behaves like man, but with Groff
+ warnings (-wman) explicitly enabled.
  .
  "cannot adjust" or "can't break" are trouble with paragraph filling,
  usually related to long lines.  Adjustment can be helped by left
--- lintian-1.23.36/debian/rules2006-11-19 07:11:32.0 +0600
+++ lintian-1.23.36-groff-hack/debian/rules 2007-11-21 21:18:13.0 
+0600
@@ -43,9 +43,12 @@
install -m 755 frontend/lintian $(tmp)/usr/bin/
sed -i 's//$(VER)/' $(tmp)/usr/bin/lintian
install -m 755 frontend/lintian-info $(tmp)/usr/bin/
+# helper scripts
+   @echo  install helper scripts 
+   install -m 755 frontend/lintian-man $(tmp)/usr/bin/
 # library files
@echo  install library files 
-   for d in checks collection lib unpack; do \
+   for d in checks collection lib unpack groff-hacks; do \
  install -d $(usl)/$$d; \
  find $$d -type f ! -path '*/CVS/*' ! -path '*/.svn/*' \
| xargs -iFILE cp -p FILE $(usl)/$$d/; \
--- lintian-1.23.36/frontend/lintian-man1970-01-01 07:00:00.0 
+0700
+++ lintian-1.23.36-groff-hack/frontend/lintian-man 2007-11-21 
21:16:48.0 +0600
@@ -0,0 +1,5 @@
+#!/bin/sh
+: ${LINTIAN_ROOT:=/usr/share/lintian}
+export \
+GROFF_TMAC_PATH="${LINTIAN_ROOT}${GROFF_TMAC_PATH:+:}${GROFF_TMAC_PATH}"
+exec man "$@"
--- lintian-1.23.36/groff-hacks/man.local   1970-01-01 07:00:00.0 
+0700
+++ lintian-1