summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2017-08-07 19:14:47 +0000
committerNiels Thykier <niels@thykier.net>2017-08-07 19:14:53 +0000
commit5332dc6aaffdc921d7494cfcae1435f43fca1678 (patch)
tree1379ea4d6c15c29935c891322d685841690d3389
parentfcd74cc8c1fc3ab3faaa87a36d5ba141dee86e47 (diff)
downloaddebhelper-5332dc6aaffdc921d7494cfcae1435f43fca1678.tar.gz
Avoid some unnecessary shells from qx
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r--debian/changelog4
-rwxr-xr-xdh_compress2
-rwxr-xr-xdh_gconf3
-rwxr-xr-xdh_installgsettings4
-rwxr-xr-xdh_perl2
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
diff --git a/dh_gconf b/dh_gconf
index ba8f51ab..74c04a35 100755
--- a/dh_gconf
+++ b/dh_gconf
@@ -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");
}
diff --git a/dh_perl b/dh_perl
index b536099d..8e1e603f 100755
--- a/dh_perl
+++ b/dh_perl
@@ -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";
}