Bug#602919: doc-base: Please drop perl dependency

2011-01-16 Thread Robert Luberda
On 09.11.2010 13:51, Martin Pitt writes:

Hi,
 Package: doc-base
 Version: 0.9.5
 Severity: wishlist
 
 With this patch, this package will work with just perl-base.
 

No, it doesn't, as doc-base depends on libmldbm-perl. I'm going to apply
the patch anyway. As for the MLDBM, I can see there are plenty of bug
reports in Ubuntu against doc-base and it seems most of them is caused
by some corruption of the DB files. I've already spent some time on
finding a way to prevent/handle such corruptions, and now I'm considering
storing the databases in some other format (maybe YAML with
libyaml-tiny-perl would be ok for this purpose).


Regards,
robert




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#602919: doc-base: Please drop perl dependency

2010-11-09 Thread Martin Pitt
Package: doc-base
Version: 0.9.5
Severity: wishlist
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch natty

Hello,

in Ubuntu we are trying to get rid of Perl in the default installation
(that is, the full Perl, not perl-base of course); for this I'm
currently removing the remaining reverse dependencies.

With this patch, this package will work with just perl-base.

Thanks for considering,

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
diff -Nru doc-base-0.9.5/debian/changelog doc-base-0.9.5ubuntu1/debian/changelog
--- doc-base-0.9.5/debian/changelog 2009-10-15 11:26:29.0 +0200
+++ doc-base-0.9.5ubuntu1/debian/changelog  2010-11-09 13:42:41.0 
+0100
@@ -1,3 +1,16 @@
+doc-base (0.9.5ubuntu1) natty; urgency=low
+
+  * perl/Debian/DocBase/Programs/Scrollkeeper.pm: Provide our own local
+dirname() function and use it instead of File::Basename.
+  * perl/Debian/DocBase/InstallDocs.pm: Use 'rm -r' and 'mkdir -p' programs
+instead of File::Path.
+  * perl/Debian/DocBase/DB.pm: If Dumper module is not available, exit with an
+error that perl needs to be installeld. --dump-db is only required for
+debugging.
+  * debian/rules: Run dh_perl with '-d' to avoid perl dependency.
+
+ -- Martin Pitt martin.p...@ubuntu.com  Tue, 09 Nov 2010 13:24:19 +0100
+
 doc-base (0.9.5) unstable; urgency=low
 
   * Add a `Typesetting' top-level section for software used to typesetting 
diff -Nru doc-base-0.9.5/debian/rules doc-base-0.9.5ubuntu1/debian/rules
--- doc-base-0.9.5/debian/rules 2009-09-10 21:15:51.0 +0200
+++ doc-base-0.9.5ubuntu1/debian/rules  2010-11-09 13:42:22.0 +0100
@@ -60,7 +60,7 @@
dh_link
dh_compress
dh_fixperms
-   dh_perl
+   dh_perl -d
 #  dh_python
dh_installdeb
dh_gencontrol
diff -Nru doc-base-0.9.5/perl/Debian/DocBase/DB.pm 
doc-base-0.9.5ubuntu1/perl/Debian/DocBase/DB.pm
--- doc-base-0.9.5/perl/Debian/DocBase/DB.pm2008-04-07 20:36:39.0 
+0200
+++ doc-base-0.9.5ubuntu1/perl/Debian/DocBase/DB.pm 2010-11-09 
13:41:04.0 +0100
@@ -13,7 +13,9 @@
 use Carp;
 use Debian::DocBase::Common;
 use Debian::DocBase::Utils;
-use Data::Dumper;
+my $has_dumper = 1;
+eval 'use Data::Dumper';
+$has_dumper = 0 if ($@);
 
 my $filesdb  = undef;
 my $statusdb = undef;
@@ -76,6 +78,11 @@
   my $self = shift;
   my $db   = $self-{'DB'};
 
+  unless ($has_dumper) {
+  print STDERR Please install the 'perl' package for this operation\n;
+  exit 1;
+  }
+
   my $dumper = Data::Dumper-new([$db], [$self-{'FILE'}]);
   $dumper-Indent(1);
   $dumper-Terse(1);
diff -Nru doc-base-0.9.5/perl/Debian/DocBase/InstallDocs.pm 
doc-base-0.9.5ubuntu1/perl/Debian/DocBase/InstallDocs.pm
--- doc-base-0.9.5/perl/Debian/DocBase/InstallDocs.pm   2009-04-27 
00:57:37.0 +0200
+++ doc-base-0.9.5ubuntu1/perl/Debian/DocBase/InstallDocs.pm2010-11-09 
13:02:32.0 +0100
@@ -156,8 +156,8 @@
   foreach my $d (@dbdirs) {
 next unless -d $d;
 rename ($d, $d.$suffix) or croak(Can't rename $d to ${d}${suffix}: $!);
-mkpath ($d, 0, 0755);
-rmtree ($d.$suffix, 0, 0);
+system ('mkdir', '-m', '-p', $d);
+system ('rm', '-r', $d.$suffix);
   }
   unlink $DB_STATUS or croak(Can't remove $DB_STATUS: $!) if -f $DB_STATUS;
 
diff -Nru doc-base-0.9.5/perl/Debian/DocBase/Programs/Scrollkeeper.pm 
doc-base-0.9.5ubuntu1/perl/Debian/DocBase/Programs/Scrollkeeper.pm
--- doc-base-0.9.5/perl/Debian/DocBase/Programs/Scrollkeeper.pm 2008-11-11 
14:21:09.0 +0100
+++ doc-base-0.9.5ubuntu1/perl/Debian/DocBase/Programs/Scrollkeeper.pm  
2010-11-09 13:24:14.0 +0100
@@ -17,7 +17,6 @@
 use Debian::DocBase::Common;
 use Debian::DocBase::Utils;
 use Debian::DocBase::Gettext;
-use File::Basename qw(dirname);
 use UUID;
 
 
@@ -126,6 +125,13 @@
   return $mapping{lc($_[0])};
 } # }}}
 
+sub dirname {
+my @p = split '/', $_[0];
+return (join '/', @p[0..($#p-1)]) if $#p  1;
+return '/' if substr ($_[0], 0, 1) eq '/';
+return '.';
+}
+
 sub _RemoveOmfFile($) { # {{{
   my $omf_file = shift;
   my $omf_dir = dirname($omf_file);


signature.asc
Description: Digital signature


Bug#602919: doc-base: Please drop perl dependency

2010-11-09 Thread Martin Pitt
Hello again,

Martin Pitt [2010-11-09 13:51 +0100]:
 With this patch, this package will work with just perl-base.

Sorry, previous patch was an old and broken one. This is better.

Thanks,

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
diff -Nru doc-base-0.9.5/debian/changelog doc-base-0.9.5ubuntu1/debian/changelog
--- doc-base-0.9.5/debian/changelog 2009-10-15 11:26:29.0 +0200
+++ doc-base-0.9.5ubuntu1/debian/changelog  2010-11-09 13:42:41.0 
+0100
@@ -1,3 +1,16 @@
+doc-base (0.9.5ubuntu1) natty; urgency=low
+
+  * perl/Debian/DocBase/Programs/Scrollkeeper.pm: Provide our own local
+dirname() function and use it instead of File::Basename.
+  * perl/Debian/DocBase/InstallDocs.pm: Use 'rm -r' and 'mkdir -p' programs
+instead of File::Path.
+  * perl/Debian/DocBase/DB.pm: If Dumper module is not available, exit with an
+error that perl needs to be installeld. --dump-db is only required for
+debugging.
+  * debian/rules: Run dh_perl with '-d' to avoid perl dependency.
+
+ -- Martin Pitt martin.p...@ubuntu.com  Tue, 09 Nov 2010 13:24:19 +0100
+
 doc-base (0.9.5) unstable; urgency=low
 
   * Add a `Typesetting' top-level section for software used to typesetting 
diff -Nru doc-base-0.9.5/debian/rules doc-base-0.9.5ubuntu1/debian/rules
--- doc-base-0.9.5/debian/rules 2009-09-10 21:15:51.0 +0200
+++ doc-base-0.9.5ubuntu1/debian/rules  2010-11-09 13:42:22.0 +0100
@@ -60,7 +60,7 @@
dh_link
dh_compress
dh_fixperms
-   dh_perl
+   dh_perl -d
 #  dh_python
dh_installdeb
dh_gencontrol
diff -Nru doc-base-0.9.5/perl/Debian/DocBase/DB.pm 
doc-base-0.9.5ubuntu1/perl/Debian/DocBase/DB.pm
--- doc-base-0.9.5/perl/Debian/DocBase/DB.pm2008-04-07 20:36:39.0 
+0200
+++ doc-base-0.9.5ubuntu1/perl/Debian/DocBase/DB.pm 2010-11-09 
13:41:04.0 +0100
@@ -13,7 +13,9 @@
 use Carp;
 use Debian::DocBase::Common;
 use Debian::DocBase::Utils;
-use Data::Dumper;
+my $has_dumper = 1;
+eval 'use Data::Dumper';
+$has_dumper = 0 if ($@);
 
 my $filesdb  = undef;
 my $statusdb = undef;
@@ -76,6 +78,11 @@
   my $self = shift;
   my $db   = $self-{'DB'};
 
+  unless ($has_dumper) {
+  print STDERR Please install the 'perl' package for this operation\n;
+  exit 1;
+  }
+
   my $dumper = Data::Dumper-new([$db], [$self-{'FILE'}]);
   $dumper-Indent(1);
   $dumper-Terse(1);
diff -Nru doc-base-0.9.5/perl/Debian/DocBase/InstallDocs.pm 
doc-base-0.9.5ubuntu1/perl/Debian/DocBase/InstallDocs.pm
--- doc-base-0.9.5/perl/Debian/DocBase/InstallDocs.pm   2009-04-27 
00:57:37.0 +0200
+++ doc-base-0.9.5ubuntu1/perl/Debian/DocBase/InstallDocs.pm2010-11-09 
13:02:32.0 +0100
@@ -156,8 +156,8 @@
   foreach my $d (@dbdirs) {
 next unless -d $d;
 rename ($d, $d.$suffix) or croak(Can't rename $d to ${d}${suffix}: $!);
-mkpath ($d, 0, 0755);
-rmtree ($d.$suffix, 0, 0);
+system ('mkdir', '-m', '0755', '-p', $d);
+system ('rm', '-r', $d.$suffix);
   }
   unlink $DB_STATUS or croak(Can't remove $DB_STATUS: $!) if -f $DB_STATUS;
 
diff -Nru doc-base-0.9.5/perl/Debian/DocBase/Programs/Scrollkeeper.pm 
doc-base-0.9.5ubuntu1/perl/Debian/DocBase/Programs/Scrollkeeper.pm
--- doc-base-0.9.5/perl/Debian/DocBase/Programs/Scrollkeeper.pm 2008-11-11 
14:21:09.0 +0100
+++ doc-base-0.9.5ubuntu1/perl/Debian/DocBase/Programs/Scrollkeeper.pm  
2010-11-09 13:24:14.0 +0100
@@ -17,7 +17,6 @@
 use Debian::DocBase::Common;
 use Debian::DocBase::Utils;
 use Debian::DocBase::Gettext;
-use File::Basename qw(dirname);
 use UUID;
 
 
@@ -126,6 +125,13 @@
   return $mapping{lc($_[0])};
 } # }}}
 
+sub dirname {
+my @p = split '/', $_[0];
+return (join '/', @p[0..($#p-1)]) if $#p  1;
+return '/' if substr ($_[0], 0, 1) eq '/';
+return '.';
+}
+
 sub _RemoveOmfFile($) { # {{{
   my $omf_file = shift;
   my $omf_dir = dirname($omf_file);


signature.asc
Description: Digital signature