X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debian%2FDebhelper%2FDh_Lib.pm;h=793a2e0700894784ae147bab8f0ffb5ac911af3f;hb=298aa10d16b548364a28a4f67c50cb0882c5a150;hp=3effb60b9a21d817fff4dfabf37185bacafdd737;hpb=2261140a15e8e31b8c9e64608ff46df303dc399e;p=debhelper.git diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm index 3effb60..793a2e0 100644 --- a/Debian/Debhelper/Dh_Lib.pm +++ b/Debian/Debhelper/Dh_Lib.pm @@ -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="";