&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;
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 $//;
}
# 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 \$?';
}
}
}
}
- 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;
}
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;
}
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="";