summaryrefslogtreecommitdiff
path: root/pat
diff options
context:
space:
mode:
Diffstat (limited to 'pat')
-rwxr-xr-xpat/patcil.SH14
-rwxr-xr-xpat/patdiff.SH22
-rwxr-xr-xpat/patlog.SH2
3 files changed, 15 insertions, 23 deletions
diff --git a/pat/patcil.SH b/pat/patcil.SH
index a4fae23..642bac2 100755
--- a/pat/patcil.SH
+++ b/pat/patcil.SH
@@ -61,8 +61,6 @@ $startperl
!GROK!THIS!
cat >>patcil <<'!NO!SUBS!'
-use File::Temp qw/ tempfile tempdir /;
-
$progname = &profile; # Read ~/.dist_profile
require 'getopts.pl';
&usage unless $#ARGV >= 0;
@@ -506,12 +504,12 @@ x Toggle patch# prefix.
sub edit {
local($text) = join("\n", @_);
- my $tmp = File::Temp->new();
- print $tmp $text;
- close $tmp;
- system $EDITOR, "$tmp";
- $text = `cat "$tmp"`;
- unlink "$tmp";
+ open(TMP,">/tmp/cil$$") || die "Can't create /tmp/cil$$";
+ print TMP $text;
+ close TMP;
+ system $EDITOR, "/tmp/cil$$";
+ $text = `cat /tmp/cil$$`;
+ unlink "/tmp/cil$$";
$text;
}
diff --git a/pat/patdiff.SH b/pat/patdiff.SH
index ed4e97b..0c74c9a 100755
--- a/pat/patdiff.SH
+++ b/pat/patdiff.SH
@@ -49,8 +49,6 @@ $startperl
!GROK!THIS!
cat >>patdiff <<'!NO!SUBS!'
-use File::Temp qw/ tempfile tempdir /;
-
$RCSEXT = ',v' unless $RCSEXT;
$TOPDIR = ''; # We are at top-level directory
@@ -161,11 +159,9 @@ foreach $file (@ARGV) {
close DIFF;
system 'rcs', "-Nlastpat:$new", @files;
} else {
- my $tmpo = File::Temp->new();
- my $tmpn = File::Temp->new();
- &copyright'expand("co -p -rlastpat $file", "$tmpo");
- &copyright'expand("co -p -r$new $file", "$tmpn");
- open(DIFF, "$mydiff $tmpo $tmpn |") ||
+ &copyright'expand("co -p -rlastpat $file", "/tmp/pdo$$");
+ &copyright'expand("co -p -r$new $file", "/tmp/pdn$$");
+ open(DIFF, "$mydiff /tmp/pdo$$ /tmp/pdn$$ |") ||
die "Can't run $mydiff";
while (<DIFF>) { # Contextual or unified diff
if ($. == 1) {
@@ -181,7 +177,7 @@ foreach $file (@ARGV) {
}
close DIFF;
system 'rcs', "-Nlastpat:$new", @files;
- unlink "$tmpo", "$tmpn";
+ unlink "/tmp/pdn$$", "/tmp/pdo$$";
}
} else {
if ($mydiff eq '') {
@@ -195,11 +191,9 @@ foreach $file (@ARGV) {
}
close DIFF;
} else {
- 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 |") ||
+ system "co -p -rlastpat $files >/tmp/pdo$$";
+ system "cp $file /tmp/pdn$$";
+ open(DIFF, "$mydiff /tmp/pdo$$ /tmp/pdn$$ |") ||
die "$progname: can't fork $mydiff: $!\n";
while (<DIFF>) {
# Contextual or unified diff
@@ -215,7 +209,7 @@ foreach $file (@ARGV) {
print PATCH;
}
close DIFF;
- unlink "$tmpo", "$tmpn";
+ unlink "/tmp/pdn$$", "/tmp/pdo$$";
}
}
}
diff --git a/pat/patlog.SH b/pat/patlog.SH
index 1588af4..ff7a81f 100755
--- a/pat/patlog.SH
+++ b/pat/patlog.SH
@@ -252,7 +252,7 @@ system 'perl', '-S', 'patdiff', $changelog;
exit 0; # All done.
-# Returns true if .clog and .rlog (it it exists) are newer than .xlog.
+# Returns true if .clog and .rlog (if it exists) are newer than .xlog.
sub newertmp {
return 1 unless -f ".xlog$bnum"; # To force regeneration
return 1 if &newer(".clog$bnum", ".xlog$bnum") ||