Przeglądaj źródła

dpkg-shlibdeps: Move regex variable inside function

The function is defined after its first call site, so the regex variable
is not found when compiling the code.
Guillem Jover 10 lat temu
rodzic
commit
ae83a2d983
1 zmienionych plików z 13 dodań i 12 usunięć
  1. 13 12
      scripts/dpkg-shlibdeps.pl

+ 13 - 12
scripts/dpkg-shlibdeps.pl

@@ -670,20 +670,21 @@ sub split_soname {
     }
 }
 
-my $shlibs_re = qr{
-    ^\s*
-    (?:(\S+):\s+)?              # Optional type
-    (\S+)\s+                    # Library
-    (\S+)                       # Version
-    (?:
-      \s+
-      (\S.*\S)                  # Dependencies
-    )?
-    \s*$
-}x;
-
 sub extract_from_shlibs {
     my ($soname, $shlibfile) = @_;
+
+    my $shlibs_re = qr{
+        ^\s*
+        (?:(\S+):\s+)?              # Optional type
+        (\S+)\s+                    # Library
+        (\S+)                       # Version
+        (?:
+          \s+
+          (\S.*\S)                  # Dependencies
+        )?
+        \s*$
+    }x;
+
     # Split soname in name/version
     my ($libname, $libversion) = split_soname($soname);
     unless (defined $libname) {