[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libfile-sharedir-perl: diff for NMU version 0.05-1.2



tags 496122 + patch
thanks

Hi,

Attached is the diff for my libfile-sharedir-perl 0.05-1.2 NMU.

It closes a grave regression in 0.05 that is fixed upstream in 1.00.  
However, new upstream releases are inappropriate for Lenny, hence the 
fix was backported.

Please consider offering the package for adoption. Debian Perl Group 
is willing to take over. Mail debian-perl@lists.debian.org (cc-ed) or 
come say hello on #debian-perl.

-- 
dam            JabberID: dam@jabber.minus273.org
diff -u libfile-sharedir-perl-0.05/debian/control libfile-sharedir-perl-0.05/debian/control
--- libfile-sharedir-perl-0.05/debian/control
+++ libfile-sharedir-perl-0.05/debian/control
@@ -1,7 +1,7 @@
 Source: libfile-sharedir-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 5.0.0)
+Build-Depends: debhelper (>= 5.0.0), quilt
 Build-Depends-Indep: perl (>= 5.8.8-12), libclass-inspector-perl, libparams-util-perl
 Maintainer: Christian Sánchez <csanchez@unplug.org.ve>
 Standards-Version: 3.7.3
diff -u libfile-sharedir-perl-0.05/debian/changelog libfile-sharedir-perl-0.05/debian/changelog
--- libfile-sharedir-perl-0.05/debian/changelog
+++ libfile-sharedir-perl-0.05/debian/changelog
@@ -1,3 +1,11 @@
+libfile-sharedir-perl (0.05-1.2) unstable; urgency=high
+
+  * Non-maintainer upload.
+  * add fix-dist-path.patch, fixing a regression in shared directory layout.
+    Closes: #496122
+
+ -- Damyan Ivanov <dmn@debian.org>  Mon, 15 Sep 2008 09:12:06 +0300
+
 libfile-sharedir-perl (0.05-1.1) unstable; urgency=low
 
   * Non-maintainer upload.
diff -u libfile-sharedir-perl-0.05/debian/rules libfile-sharedir-perl-0.05/debian/rules
--- libfile-sharedir-perl-0.05/debian/rules
+++ libfile-sharedir-perl-0.05/debian/rules
@@ -2,6 +2,8 @@
 
 #export DH_VERBOSE=1
 
+include /usr/share/quilt/quilt.make
+
 export PERL_MM_USE_DEFAULT=1
 
 PACKAGE=$(shell dh_listpackages)
@@ -13,7 +15,7 @@
 TMP     =$(CURDIR)/debian/$(PACKAGE)
 
 build: build-stamp
-build-stamp:
+build-stamp: $(QUILT_STAMPFN)
 	dh_testdir
 
 	$(PERL) Makefile.PL INSTALLDIRS=vendor \
@@ -24,7 +26,7 @@
 
 	touch $@
 
-clean:
+clean: unpatch
 	dh_testdir
 	dh_testroot
 
only in patch2:
unchanged:
--- libfile-sharedir-perl-0.05.orig/debian/patches/fix-dist-path.patch
+++ libfile-sharedir-perl-0.05/debian/patches/fix-dist-path.patch
@@ -0,0 +1,160 @@
+# fix regression in shared directory layout model
+# patch backported from 1.00 upstream release
+# http://bugs.debian.org/496122
+--- a/lib/File/ShareDir.pm
++++ b/lib/File/ShareDir.pm
+@@ -145,6 +145,44 @@ located or is not readable.
+ 
+ sub dist_dir {
+ 	my $dist = _DIST(shift);
++	my $dir;
++
++	# Try the new version
++	$dir = _dist_dir_new( $dist );
++	return $dir if defined $dir;
++
++	# Fall back to the legacy version
++	$dir = _dist_dir_old( $dist );
++	return $dir if defined $dir;
++
++	# Ran out of options
++	croak("Failed to find share dir for dist '$dist'");
++}
++
++sub _dist_dir_new {
++	my $dist = shift;
++
++	# Create the subpath
++	my $path = File::Spec->catdir(
++		'auto', 'share', 'dist', $dist,
++	);
++
++	# Find the full dir withing @INC
++	foreach my $inc ( @INC ) {
++		next unless defined $inc and ! ref $inc;
++		my $dir = File::Spec->catdir( $inc, $path );
++		next unless -d $dir;
++		unless ( -r $dir ) {
++			croak("Found directory '$dir', but no read permissions");
++		}
++		return $dir;
++	}
++
++	return undef;
++}
++
++sub _dist_dir_old {
++	my $dist = shift;
+ 
+ 	# Create the subpath
+ 	my $path = File::Spec->catdir(
+@@ -162,8 +200,7 @@ sub dist_dir {
+ 		return $dir;
+ 	}
+ 
+-	# Couldn't find it
+-	croak("Failed to find share dir for dist '$dist'");
++	return undef;
+ }
+ 
+ =pod
+@@ -187,6 +224,43 @@ located or is not readable.
+ 
+ sub module_dir {
+ 	my $module = _MODULE(shift);
++	my $dir;
++
++	defined($module) or die "No module given";
++
++	# Try the new version
++	$dir = _module_dir_new( $module );
++	return $dir if defined $dir;
++
++	# Fall back to the legacy version
++	return _module_dir_old( $module );
++}
++
++sub _module_dir_new {
++	my $module = shift;
++
++	# Create the subpath
++	my $path = File::Spec->catdir(
++		'auto', 'share', 'module',
++		_module_subdir( $module ),
++	);
++
++	# Find the full dir withing @INC
++	foreach my $inc ( @INC ) {
++		next unless defined $inc and ! ref $inc;
++		my $dir = File::Spec->catdir( $inc, $path );
++		next unless -d $dir;
++		unless ( -r $dir ) {
++			croak("Found directory '$dir', but no read permissions");
++		}
++		return $dir;
++	}
++
++	return undef;
++}
++
++sub _module_dir_old {
++	my $module = shift;
+ 	my $short  = Class::Inspector->filename($module);
+ 	my $long   = Class::Inspector->loaded_filename($module);
+ 	$short =~ tr{/} {:} if $IS_MACOS;
+@@ -226,8 +300,41 @@ sub dist_file {
+ 	my $dist = _DIST(shift);
+ 	my $file = _FILE(shift);
+ 
++	# Try the new version first
++	my $path = _dist_file_new( $dist, $file );
++	return $path if defined $path;
++
++	# Hand off to the legacy version
++	return _dist_file_old( $dist, $file );;
++}
++
++sub _dist_file_new {
++	my $dist = shift;
++	my $file = shift;
++
++	# If it exists, what should the path be
++	my $dir  = _dist_dir_new( $dist );
++	return undef unless defined($dir);
++	my $path = File::Spec->catfile( $dir, $file );
++
++	# Does the file exist
++	return undef unless -e $path;
++	unless ( -f $path ) {
++		croak("Found dist_file '$path', but not a file");
++	}
++	unless ( -r $path ) {
++		croak("File '$path', no read permissions");
++	}
++
++	return $path;
++}
++
++sub _dist_file_old {
++	my $dist = shift;
++	my $file = shift;
++
+ 	# Create the subpath
+-	my $path = File::Spec->catdir(
++	my $path = File::Spec->catfile(
+ 		'auto', split( /-/, $dist ), $file,
+ 		);
+ 
+@@ -290,6 +397,12 @@ sub module_file {
+ #####################################################################
+ # Support Functions
+ 
++sub _module_subdir {
++	my $module = shift;
++	$module =~ s/::/-/g;
++	return $module;
++}
++
+ # Matches a valid distribution name
+ ### This is a total guess at this point
+ sub _DIST {
only in patch2:
unchanged:
--- libfile-sharedir-perl-0.05.orig/debian/patches/series
+++ libfile-sharedir-perl-0.05/debian/patches/series
@@ -0,0 +1 @@
+fix-dist-path.patch

Attachment: signature.asc
Description: Digital signature


Reply to: