Kaynağa Gözat

dpkg-shlibdeps: always use Dpkg::Version

Instead of mixing usual scalars with Dpkg::Version objects, always use
Dpkg::Version objects when storing a version.
Raphaël Hertzog 16 yıl önce
ebeveyn
işleme
2d74173f41
2 değiştirilmiş dosya ile 6 ekleme ve 3 silme
  1. 2 0
      debian/changelog
  2. 4 3
      scripts/dpkg-shlibdeps.pl

+ 2 - 0
debian/changelog

@@ -3,6 +3,8 @@ dpkg (1.15.5.2) UNRELEASED; urgency=low
   * Change Dpkg::Version API to accept invalid versions by default and add
     is_valid() method. The boolean evaluation of a version object returns
     true if the version is valid, false otherwise.
+  * Update dpkg-shlibdeps to always use Dpkg::Version now that it can
+    contain the empty version string. Closes: #556786
 
  -- Raphael Hertzog <hertzog@debian.org>  Wed, 18 Nov 2009 10:21:53 +0100
 

+ 4 - 3
scripts/dpkg-shlibdeps.pl

@@ -242,7 +242,7 @@ foreach my $file (keys %exec) {
 		my $minver = $symfile->get_smallest_version($soname) || '';
 		foreach my $subdep (split /\s*,\s*/, $dep) {
 		    if (not exists $dependencies{$cur_field}{$subdep}) {
-			$dependencies{$cur_field}{$subdep} = $minver;
+			$dependencies{$cur_field}{$subdep} = Dpkg::Version->new($minver);
                         print " Initialize dependency ($subdep) with minimal " .
                               "version ($minver)\n" if $debug > 1;
 		    }
@@ -590,6 +590,7 @@ sub get_min_version_from_deps {
 sub update_dependency_version {
     my ($dep, $minver, $existing_only) = @_;
     return if not defined($minver);
+    $minver = Dpkg::Version->new($minver);
     foreach my $subdep (split /\s*,\s*/, $dep) {
 	if (exists $dependencies{$cur_field}{$subdep} and
 	    defined($dependencies{$cur_field}{$subdep}))
@@ -630,8 +631,8 @@ sub add_shlibs_dep {
 	    print " Found $dep in $file\n" if $debug;
 	    foreach (split(/,\s*/, $dep)) {
 		# Note: the value is empty for shlibs based dependency
-		# symbol based dependency will put a version as value
-		$dependencies{$cur_field}{$_} = '';
+		# symbol based dependency will put a valid version as value
+		$dependencies{$cur_field}{$_} = Dpkg::Version->new('');
 	    }
 	    return 1;
 	}