[devscripts] 01/01: wip
Mattia Rizzolo
mattia at debian.org
Mon Feb 5 20:46:26 UTC 2018
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to branch pu/mk-origtargz-argmax
in repository devscripts.
commit 3d96e5f38e8f472b166942f1a76d56cf0af018d4
Author: Mattia Rizzolo <mattia at debian.org>
Date: Mon Feb 5 20:30:16 2018 +0100
wip
Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
scripts/mk-origtargz.pl | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/scripts/mk-origtargz.pl b/scripts/mk-origtargz.pl
index 4533899..7602756 100644
--- a/scripts/mk-origtargz.pl
+++ b/scripts/mk-origtargz.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl
+# vim: set shiftwidth=4 tabstop=8 noexpandtab:
#
# mk-origtargz: Rename upstream tarball, optionally changing the compression
# and removing unwanted files.
@@ -571,7 +572,16 @@ if ($do_repack || $deletecount) {
# We have to use piping because --delete is broken otherwise, as documented
# at https://www.gnu.org/software/tar/manual/html_node/delete.html
if (@to_delete) {
- while (my @next_n = splice @to_delete, 0, 16384) {
+ # ARG_MAX: max number of bytes exec() can handle
+ my $arg_max;
+ spawn(
+ exec => ['getconf', 'ARG_MAX'],
+ to_string => \$arg_max,
+ wait_child => 1
+ );
+ # usually NAME_MAX=255, but here we use 128 to be on the safe side.
+ $arg_max = int($arg_max / 128);
+ while (my @next_n = splice @to_delete, 0, $arg_max) {
spawn(exec => ['tar', '--delete', @next_n ],
from_file => $destfiletar,
to_file => $destfiletar . ".tmp",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git
More information about the devscripts-devel
mailing list