develooper Front page | perl.perl5.porters | Postings from November 1999

[Patch] Let patchls work on STDIN

From:
andreas.koenig
Date:
November 18, 1999 01:51
Subject:
[Patch] Let patchls work on STDIN
Message ID:
sfc66z0t9d8.fsf@hohenstaufen.in-berlin.de
This is useful when working with Sarathy's patch repository.

--- perl5.005_62..4590/Porting/patchls~	Thu Nov 18 10:28:17 1999
+++ perl5.005_62..4590/Porting/patchls	Thu Nov 18 10:34:45 1999
@@ -17,7 +17,7 @@
 use strict;
 use vars qw($VERSION);
 
-$VERSION = 2.10;
+$VERSION = 2.11;
 
 sub usage {
 die qq{
@@ -35,6 +35,7 @@
            (F has \$ appended unless it contains a /).
     -e     Expect patched files to Exist (relative to current directory)
            Will print warnings for files which don't. Also affects -4 option.
+    -      Read patch from STDIN
   other options for special uses:
     -I     just gather and display summary Information about the patches.
     -4     write to stdout the PerForce commands to prepare for patching.
@@ -159,7 +160,9 @@
 	warn "Ignored directory $in\n";
 	next;
     }
-    unless (open F, "<$in") {
+    if ($in eq "-") {
+      *F = \*STDIN;
+    } elsif (not open F, "<$in") {
 	warn "Unable to open $in: $!\n";
 	next;
     }

-- 
andreas



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About