diff options
author | Boyuan Yang <byang@debian.org> | 2020-02-23 14:37:44 -0800 |
---|---|---|
committer | Boyuan Yang <byang@debian.org> | 2020-02-23 14:37:44 -0800 |
commit | ad837af33e152566dc47d6805cb0a84ce1329ed5 (patch) | |
tree | 15fc67268928e2784b815b959de3f9e6212686ef /pat/patdiff.SH | |
parent | ceb3507a8fca872770b3dcd7e5c5b36179ab95b0 (diff) |
dist (1:3.5-236-0.2) unstable; urgency=medium
* Non-maintainer upload.
* debian/dist.postinst: Fix wrong direction form.
(Closes: #908187)
* debian/rules: Explicitly provide tool path to avoid usrmerge
differences and make package reproducible. (Closes: #915910)
* debian/rules: Avoid manually setting DEB_HOST_MULTIARCH, use
/usr/share/dpkg/architecture.mk instead. (lintian warning)
[dgit import package dist 1:3.5-236-0.2]
Diffstat (limited to 'pat/patdiff.SH')
-rwxr-xr-x | pat/patdiff.SH | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/pat/patdiff.SH b/pat/patdiff.SH index 0c74c9a..ed4e97b 100755 --- a/pat/patdiff.SH +++ b/pat/patdiff.SH @@ -49,6 +49,8 @@ $startperl !GROK!THIS! cat >>patdiff <<'!NO!SUBS!' +use File::Temp qw/ tempfile tempdir /; + $RCSEXT = ',v' unless $RCSEXT; $TOPDIR = ''; # We are at top-level directory @@ -159,9 +161,11 @@ foreach $file (@ARGV) { close DIFF; system 'rcs', "-Nlastpat:$new", @files; } else { - ©right'expand("co -p -rlastpat $file", "/tmp/pdo$$"); - ©right'expand("co -p -r$new $file", "/tmp/pdn$$"); - open(DIFF, "$mydiff /tmp/pdo$$ /tmp/pdn$$ |") || + my $tmpo = File::Temp->new(); + my $tmpn = File::Temp->new(); + ©right'expand("co -p -rlastpat $file", "$tmpo"); + ©right'expand("co -p -r$new $file", "$tmpn"); + open(DIFF, "$mydiff $tmpo $tmpn |") || die "Can't run $mydiff"; while (<DIFF>) { # Contextual or unified diff if ($. == 1) { @@ -177,7 +181,7 @@ foreach $file (@ARGV) { } close DIFF; system 'rcs', "-Nlastpat:$new", @files; - unlink "/tmp/pdn$$", "/tmp/pdo$$"; + unlink "$tmpo", "$tmpn"; } } else { if ($mydiff eq '') { @@ -191,9 +195,11 @@ foreach $file (@ARGV) { } close DIFF; } else { - system "co -p -rlastpat $files >/tmp/pdo$$"; - system "cp $file /tmp/pdn$$"; - open(DIFF, "$mydiff /tmp/pdo$$ /tmp/pdn$$ |") || + my $tmpo = File::Temp->new(); + my $tmpn = File::Temp->new(); + system "co -p -rlastpat $files >$tmpo"; + system "cp $file $tmpn"; + open(DIFF, "$mydiff $tmpo $tmpn |") || die "$progname: can't fork $mydiff: $!\n"; while (<DIFF>) { # Contextual or unified diff @@ -209,7 +215,7 @@ foreach $file (@ARGV) { print PATCH; } close DIFF; - unlink "/tmp/pdn$$", "/tmp/pdo$$"; + unlink "$tmpo", "$tmpn"; } } } |