[debhelper-devel] [debhelper] 07/08: Drop .* from the beginning of unanchored regular expressions
Niels Thykier
nthykier at moszumanska.debian.org
Sun May 1 08:06:26 UTC 2016
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository debhelper.
commit 8f05076e7b406e1e57b3f2becea00c75db183b28
Author: Peter Pentchev <roam at ringlet.net>
Date: Fri Apr 8 17:42:25 2016 +0300
Drop .* from the beginning of unanchored regular expressions
Signed-off-by: Niels Thykier <niels at thykier.net>
---
Debian/Debhelper/Dh_Lib.pm | 2 +-
dh_installman | 4 ++--
dh_installmanpages | 4 ++--
dh_strip | 6 +++---
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 7daa5f4..55f08f9 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -567,7 +567,7 @@ sub pkgfilename {
}
# Is this a native Debian package?
- if ($dh{VERSION}=~m/.*-/) {
+ if (index($dh{VERSION}, '-') > -1) {
return $isnative_cache{$package}=0;
}
else {
diff --git a/dh_installman b/dh_installman
index 12d473c..af2d136 100755
--- a/dh_installman
+++ b/dh_installman
@@ -140,7 +140,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
close($fd);
# Failing that, we can try to get it from the filename.
if (! $section) {
- ($section)=$basename=~m/.*\.([1-9]\S*)/;
+ ($section)=$basename=~m/\.([1-9]\S*)/;
}
# Now get the numeric component of the section.
@@ -158,7 +158,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
# Translated man pages are typically specified by adding the
# language code to the filename, so detect that and
# redirect to appropriate directory, stripping the code.
- ($langcode)=$basename=~m/.*\.([a-z][a-z](?:_[A-Z][A-Z])?)\.(?:[1-9]|man)/;
+ ($langcode)=$basename=~m/\.([a-z][a-z](?:_[A-Z][A-Z])?)\.(?:[1-9]|man)/;
}
elsif ($dh{LANGUAGE} ne 'C') {
$langcode=$dh{LANGUAGE};
diff --git a/dh_installmanpages b/dh_installmanpages
index 7f83089..2583002 100755
--- a/dh_installmanpages
+++ b/dh_installmanpages
@@ -158,13 +158,13 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
if ($install) {
my $extdir="share";
- my ($section)=$basename=~m/.*\.([1-9])/;
+ my ($section)=$basename=~m/\.([1-9])/;
my $destdir="$tmp/usr/$extdir/man/man$section/";
# Handle translated man pages.
my $instname=$basename;
- my ($langcode)=$basename=~m/.*\.([a-z][a-z])\.([1-9])/;
+ my ($langcode)=$basename=~m/\.([a-z][a-z])\.([1-9])/;
if (defined $langcode && $langcode ne '') {
$destdir="$tmp/usr/$extdir/man/$langcode/man$section/";
$instname=~s/\.$langcode\./\./;
diff --git a/dh_strip b/dh_strip
index a7206db..ef5f517 100755
--- a/dh_strip
+++ b/dh_strip
@@ -209,10 +209,10 @@ sub testfile {
# Does its filename look like a shared library?
# - *.cmxs are OCaml native code shared libraries
# - *.node are also native ELF binaries (for node-js)
- if (m/.*\.(?:so.*?|cmxs|node)$/) {
+ if (m/\.(?:so.*?|cmxs|node)$/) {
# Ok, do the expensive test.
my $type=get_file_type($_);
- if ($type=~m/.*ELF.*shared.*/) {
+ if ($type=~m/ELF.*shared/) {
push @shared_libs, $fn;
return;
}
@@ -223,7 +223,7 @@ sub testfile {
if ($mode & 0111) {
# Ok, expensive test.
my $type=get_file_type($_);
- if ($type=~m/.*ELF.*(executable|shared).*/) {
+ if ($type=~m/ELF.*(executable|shared)/) {
push @executables, $fn;
return;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git
More information about the debhelper-devel
mailing list