summaryrefslogtreecommitdiff
path: root/pat
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2020-05-19 20:02:56 -0700
committerManoj Srivastava <srivasta@debian.org>2020-05-19 20:36:47 -0700
commit0664966ad710d299c3ab43a8fe06d141306a0e68 (patch)
tree35d29604717f974049e6f4fc4267c61cb7f0778e /pat
parentcc8dafd4c41256a693f980bd8f48c1a51e58defd (diff)
parent303867b2c314107cc81618561c3be69df19a4c9a (diff)
Merge branch 'upstream'
Diffstat (limited to 'pat')
-rw-r--r--pat/pat.man76
-rwxr-xr-xpat/patcil.SH14
-rwxr-xr-xpat/patdiff.SH22
-rwxr-xr-xpat/patlog.SH2
4 files changed, 53 insertions, 61 deletions
diff --git a/pat/pat.man b/pat/pat.man
index 48cd567..c5d29c4 100644
--- a/pat/pat.man
+++ b/pat/pat.man
@@ -1,42 +1,42 @@
.rn '' }`
-''' $Id$
-'''
-''' Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
-'''
-''' You may redistribute only under the terms of the Artistic Licence,
-''' as specified in the README file that comes with the distribution.
-''' You may reuse parts of this distribution only within the terms of
-''' that same Artistic Licence; a copy of which may be found at the root
-''' of the source tree for dist 4.0.
-'''
-''' $Log: pat.man,v $
-''' Revision 3.0.1.7 1997/02/28 16:32:45 ram
-''' patch61: documents contents of the message sent by patnotify
-'''
-''' Revision 3.0.1.6 1995/09/25 09:20:41 ram
-''' patch59: new -i option for patsend to add extra instructions
-'''
-''' Revision 3.0.1.5 1995/05/12 12:25:28 ram
-''' patch54: updated my e-mail address
-'''
-''' Revision 3.0.1.4 1994/10/29 16:38:31 ram
-''' patch36: documents new patlog script and the files it uses
-''' patch36: the RCS layer section has been extended slightly
-'''
-''' Revision 3.0.1.3 1993/08/27 14:40:19 ram
-''' patch7: random cleanup
-'''
-''' Revision 3.0.1.2 1993/08/25 14:05:02 ram
-''' patch6: new -q option for patsend and patnotify
-'''
-''' Revision 3.0.1.1 1993/08/24 12:15:42 ram
-''' patch3: added patnotify and patsnap
-''' patch3: patcol has a new -S option
-''' patch3: the users file built by mailagent is now listed under FILES
-'''
-''' Revision 3.0 1993/08/18 12:10:37 ram
-''' Baseline for dist 3.0 netwide release.
-'''
+.\" $Id$
+.\"
+.\" Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
+.\"
+.\" You may redistribute only under the terms of the Artistic Licence,
+.\" as specified in the README file that comes with the distribution.
+.\" You may reuse parts of this distribution only within the terms of
+.\" that same Artistic Licence; a copy of which may be found at the root
+.\" of the source tree for dist 4.0.
+.\"
+.\" $Log: pat.man,v $
+.\" Revision 3.0.1.7 1997/02/28 16:32:45 ram
+.\" patch61: documents contents of the message sent by patnotify
+.\"
+.\" Revision 3.0.1.6 1995/09/25 09:20:41 ram
+.\" patch59: new -i option for patsend to add extra instructions
+.\"
+.\" Revision 3.0.1.5 1995/05/12 12:25:28 ram
+.\" patch54: updated my e-mail address
+.\"
+.\" Revision 3.0.1.4 1994/10/29 16:38:31 ram
+.\" patch36: documents new patlog script and the files it uses
+.\" patch36: the RCS layer section has been extended slightly
+.\"
+.\" Revision 3.0.1.3 1993/08/27 14:40:19 ram
+.\" patch7: random cleanup
+.\"
+.\" Revision 3.0.1.2 1993/08/25 14:05:02 ram
+.\" patch6: new -q option for patsend and patnotify
+.\"
+.\" Revision 3.0.1.1 1993/08/24 12:15:42 ram
+.\" patch3: added patnotify and patsnap
+.\" patch3: patcol has a new -S option
+.\" patch3: the users file built by mailagent is now listed under FILES
+.\"
+.\" Revision 3.0 1993/08/18 12:10:37 ram
+.\" Baseline for dist 3.0 netwide release.
+.\"
.de Sh
.br
.ne 5
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") ||