Try to avoid warning.
authorMikko Värri <vmj@linuxbox.fi>
Fri, 30 Sep 2011 00:10:48 +0000 (03:10 +0300)
committerMikko Värri <vmj@linuxbox.fi>
Fri, 30 Sep 2011 00:10:48 +0000 (03:10 +0300)
lib/Slackware/Cache.pm

index f9319e5..6de5f1a 100644 (file)
@@ -60,7 +60,8 @@ sub get_pkg_db_entries_providing_file {
     my @packages = `grep --fixed-string --line-regexp --files-with-matches "$name" /var/log/packages/*`;
     if (scalar(@packages) == 0 and $file->is_dynamically_linked) {
         my $glibc_lib = $name;
-        $glibc_lib =~ s[lib(64)?/][lib$1/incoming/];
+        # lib(64)? sometimes triggers a warning that $1 is uninitialized
+        $glibc_lib =~ s[(lib|lib64)/][$1/incoming/];
         @packages = `grep --fixed-string --line-regexp --files-with-matches "$glibc_lib" /var/log/packages/*`;
     }
     unless (@packages) {