Annotation of loncom/build/crufty_update.pl, revision 1.1

1.1     ! harris41    1: # Go through list of files and make sure everything is in place in the
        !             2: # /home/harris41/LON-CAPA-topdir_for_build/SOURCES/TemporaryPackaging/SourceRoot
        !             3: # directory.
        !             4: 
        !             5: # This is a temporary script which needs to be replaced by a more comprehensive
        !             6: # build process.
        !             7: 
        !             8: open IN, "<../../../SPECS/LON-CAPA-base-3.1.spec" or die "can't open base spec file";
        !             9: 
        !            10: $changes=0;
        !            11: $total=0;
        !            12: 
        !            13: while (<IN>) {
        !            14:     chop;
        !            15:     if (!/\%dir/ && /\%attr/) {
        !            16: 	$total++;
        !            17: 	@stuff=split(/\s+/);
        !            18: 	$file=$stuff[$#stuff];
        !            19: 	$sourceroot="../SourceRoot/$file";
        !            20: 	$name=$file; $name=~s/.*\/(.*)$/$1/;
        !            21: 	unless (-e "$sourceroot" || ($name=~/\*/)) {
        !            22: 	    print "XXXXXXXX     FILE MISSING: $file\n";
        !            23: 	}
        !            24: 	elsif ($name=~/\*/) {
        !            25: 	    print "--------     no globbing : $file\n";
        !            26: 	}
        !            27: 	else {
        !            28: 	    $md5=`md5sum $sourceroot | cut -d ' ' -f1`; chop $md5;
        !            29: 	    @results=`find ../../loncom -name $name`;
        !            30: 	    unless (@results) {
        !            31: 		@results=`find ../../rat -name $name`;
        !            32: 	    }
        !            33: 	    $match=0;
        !            34: 	    RES: foreach $res (@results) {
        !            35: 		chop $res;
        !            36: 		$rmd5=`md5sum $res | cut -d ' ' -f1`; chop $rmd5;
        !            37: 		if ($md5 eq $rmd5) {
        !            38: 		    print "*** $file match with $res\n";
        !            39: 		    $match=1;
        !            40: 		    last RES;
        !            41: 		}
        !            42: 	    }
        !            43: 	    unless ($match) {
        !            44: 		$changes++;
        !            45: 		print "\n\n\n";
        !            46: 		print "Change for $file from: " . join(",",@results) . "\n";
        !            47: #		if (@results==1) {
        !            48: 		    print `diff $sourceroot $results[0] | grep '> '`;
        !            49: 		    `cp $results[0] $sourceroot`;
        !            50: 		    print "\n\n\n";
        !            51: #		}
        !            52: 	    }
        !            53: 	}
        !            54: 
        !            55:     }
        !            56: }
        !            57: 
        !            58: print "Changes: $changes\n";
        !            59: print "Total files: $total\n";

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>