#!@PREFIX@/bin/perl # # $NetBSD: patchdiff.pl,v 1.2 2000/08/17 03:09:26 wiz Exp $ # # patchdiff: compares a set of patches patch-aa, patch-ab, ... in # $WRKDIR/.newpatches in the with another set in patches. # # Copyright (c) 2000 by Dieter Baron and # Thomas Klausner # All Rights Reserved. Absolutely no warranty. use Getopt::Std; use Cwd; my $oldpatchdir, $newpatchdir; my $wrkdir; my %orig, %new; # change to WRKDIR sub goto_wrkdir { chdir $wrkdir or die ("can't cd to WRKDIR ($wrkdir)"); } sub getfilename { my $fname=shift; local $_; local *handle; open(handle, $fname); while () { next unless m/^\+\+\+[ ]([^ ]*)/; close(handle); $_ = $1; chomp(); return $_; } close(handle); return undef; } sub putinhash { my $hash=shift; my $files=shift; my $temp; local *handle; open(handle, "ls $files|"); while() { chomp; $temp=getfilename($_); $$hash{$temp}=$_; # print "put in hash: $temp // $_\n"; } close(handle); } getopts('d:h'); if ($opt_h) { ($prog) = ($0 =~ /([^\/]+)$/); print STDERR <