]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Dh_Lib.pm
r1889: releasing version 5.0.26
[debhelper.git] / Debian / Debhelper / Dh_Lib.pm
index 3effb60b9a21d817fff4dfabf37185bacafdd737..793a2e0700894784ae147bab8f0ffb5ac911af3f 100644 (file)
@@ -14,7 +14,7 @@ use vars qw(@ISA @EXPORT %dh);
            &pkgfile &pkgext &pkgfilename &isnative &autoscript &filearray
            &filedoublearray &getpackages &basename &dirname &xargs %dh
            &compat &addsubstvar &delsubstvar &excludefile &package_arch
-           &is_udeb &udeb_filename &debhelper_script_subst);
+           &is_udeb &udeb_filename &debhelper_script_subst &escape_shell);
 
 my $max_compat=5;
 
@@ -55,8 +55,8 @@ sub init {
                foreach (@{$dh{EXCLUDE}}) {
                        my $x=$_;
                        $x=escape_shell($x);
-                       $x=~s/\./\\./g;
-                       $dh{EXCLUDE_FIND}.="-regex .*$x.* -or ";
+                       $x=~s/\./\\\\./g;
+                       $dh{EXCLUDE_FIND}.="-regex .\\*$x.\\* -or ";
                }
                $dh{EXCLUDE_FIND}=~s/ -or $//;
        }
@@ -104,7 +104,7 @@ sub init {
        # If no error handling function was specified, just propigate
        # errors out.
        if (! exists $dh{ERROR_HANDLER} || ! defined $dh{ERROR_HANDLER}) {
-               $dh{ERROR_HANDLER}='exit $?';
+               $dh{ERROR_HANDLER}='exit \$?';
        }
 }
 
@@ -271,8 +271,8 @@ sub dirname {
                        }
                }
 
-               if ($c < 3 && ! $warned_compat) {
-                       warning("Compatibility levels before 3 are deprecated.");
+               if ($c < 4 && ! $warned_compat) {
+                       warning("Compatibility levels before 4 are deprecated.");
                        $warned_compat=1;
                }
        
@@ -553,7 +553,7 @@ sub excludefile {
        sub buildarch {
                return $arch if defined $arch;
 
-               $arch=`dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null` || error($!);
+               $arch=`dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null` || error("dpkg-architecture failed");
                chomp $arch;
                return $arch;
        }
@@ -616,7 +616,7 @@ sub getpackages {
                        if ($package &&
                            (($type eq 'indep' && $arch eq 'all') ||
                             ($type eq 'arch' && $arch ne 'all') ||
-                            ($type eq 'same' && ($arch eq 'any' || $arch =~ /\b$buildarch\b/)) ||
+                            ($type eq 'same' && ($arch eq 'any' || $arch =~ /(^|\s)$buildarch(\s|$)/)) ||
                             ! $type)) {
                                push @list, $package;
                                $package="";