#!@PERL5@ # # $NetBSD: patchdiff.pl,v 1.6 2004/01/10 05:40:40 jlam 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; use File::Spec; my $oldpatchdir, $newpatchdir; my $wrkdir, $thisdir; my %orig, %new; 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}=File::Spec->abs2rel($_, $thisdir); } close(handle); } getopts('d:h'); if ($opt_h) { ($prog) = ($0 =~ /([^\/]+)$/); print STDERR <