diff options
author | Niels Thykier <niels@thykier.net> | 2017-08-07 19:14:47 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2017-08-07 19:14:53 +0000 |
commit | 5332dc6aaffdc921d7494cfcae1435f43fca1678 (patch) | |
tree | 1379ea4d6c15c29935c891322d685841690d3389 | |
parent | fcd74cc8c1fc3ab3faaa87a36d5ba141dee86e47 (diff) | |
download | debhelper-5332dc6aaffdc921d7494cfcae1435f43fca1678.tar.gz |
Avoid some unnecessary shells from qx
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r-- | debian/changelog | 4 | ||||
-rwxr-xr-x | dh_compress | 2 | ||||
-rwxr-xr-x | dh_gconf | 3 | ||||
-rwxr-xr-x | dh_installgsettings | 4 | ||||
-rwxr-xr-x | dh_perl | 2 |
5 files changed, 11 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index 0fd218fe..188866d6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,10 @@ debhelper (10.7.3) UNRELEASED; urgency=medium * dh_installexamples: Ditto. * dh_installinfo: Ditto. * dh_installman: Ditto. + * dh_compress: Avoid forking a shell for a find command. + * dh_gconf: Ditto. + * dh_installgsettings: Ditto. + * dh_perl: Avoid forking a shell for a dpkg call. -- Niels Thykier <niels@thykier.net> Thu, 03 Aug 2017 19:30:01 +0000 diff --git a/dh_compress b/dh_compress index a0000d08..3858c465 100755 --- a/dh_compress +++ b/dh_compress @@ -203,7 +203,7 @@ on_pkgs_in_parallel { chdir($olddir); # Fix up symlinks that were pointing to the uncompressed files. - my %links = map { chomp; $_ => 1 } `find $tmp -type l`; + my %links = map { chomp; $_ => 1 } qx_cmd('find', $tmp, '-type', 'l'); my $changed; # Keep looping through looking for broken links until no more # changes are made. This is done in case there are links pointing @@ -90,7 +90,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) { if (-d "$new_schemas_dir") { # Get a list of the schemas - my $schemas = `find $new_schemas_dir -type f -name \\*.schemas -printf '%P '`; + my $schemas = qx_cmd('find', $new_schemas_dir, '-type', 'f', '-name', '*.schemas', + '-printf', '%P'); if ($schemas ne '') { addsubstvar($package, "misc:Depends", "gconf2 (>= 2.28.1-2)"); } diff --git a/dh_installgsettings b/dh_installgsettings index db0d1032..faedcb7c 100755 --- a/dh_installgsettings +++ b/dh_installgsettings @@ -78,7 +78,9 @@ foreach my $package (@{$dh{DOPACKAGES}}) { if (-d "$gsettings_schemas_dir") { # Get a list of the schemas - my $schemas = `find $gsettings_schemas_dir -type f \\( -name \\*.xml -o -name \\*.override \\) -printf '%P '`; + my $schemas = qx_cmd('find', $gsettings_schemas_dir, '-type', 'f', + '(', '-name', '*.xml', '-o', '-name', '*.override', + ')', '-printf', '%P'); if ($schemas ne '') { addsubstvar($package, "misc:Depends", "dconf-gsettings-backend | gsettings-backend"); } @@ -123,7 +123,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) { if ($deps) { my $version=""; if ($deps & XS_MODULE or $dh{V_FLAG_SET}) { - ($version) = `dpkg -s $perl` =~ /^Version:\s*(\S+)/m + ($version) = qx_cmd('dpkg', '-s', $perl) =~ /^Version:\s*(\S+)/m unless $version; $version = ">= $version"; } |