Index: dist_clean
===================================================================
--- dist_clean (nonexistent)
+++ dist_clean (revision 5)
@@ -0,0 +1,81 @@
+#!/bin/env perl
+
+use File::Basename;
+
+my $base;
+my ($toolchain, $hardware, $flavour);
+my $target_build_dir;
+my $fname = "";
+
+sub usage
+{
+ print <<EOF;
+
+Usage: dist_clean [options]
+Options:
+ --destination=DEST - where DEST is a destination directory.
+ --toolchain=TOOLCHAIN - where TOOLCHAIN ia a toolchain name;
+ --hardware=HARDWARE - where HARDWARE ia a HARDWARE name;
+ --flavour=FLAVOUR - where FLAVOUR ia a FLAVOUR name.
+
+EOF
+ exit;
+}
+
+
+foreach ( @ARGV )
+{
+ if( /--destination=(\S*)/ )
+ {
+ $base = $1;
+ }
+ elsif( /--toolchain=(\S*)/ )
+ {
+ $toolchain = $1;
+ }
+ elsif( /--hardware=(\S*)/ )
+ {
+ $hardware = $1;
+ }
+ elsif( /--flavour=(\S*)/ )
+ {
+ $flavour = $1;
+ }
+ elsif( /--help/ )
+ {
+ usage;
+ }
+}
+
+if( ! defined $base or $base eq "" ) { usage; }
+if( ! defined $toolchain or $toolchain eq "" ) { usage; }
+if( ! defined $hardware or $hardware eq "" ) { usage; }
+if( ! defined $flavour or $flavour eq "" )
+{
+ $flavour = "";
+ $target_build_dir = "." . $toolchain . "/" . $hardware;
+}
+else
+{
+ $target_build_dir = "." . $toolchain . "/" . $hardware . "/" . $flavour;
+}
+
+$fname = $target_build_dir . "/.dist";
+
+open( F, '<', $fname ) or die "Could not open $fname";
+
+while( <F> )
+{
+ chomp;
+ $f = "$base/$_";
+ unlink $f;
+ $dirs{dirname($f)}++;
+}
+
+foreach ( sort { length($b) <=> length($a) } keys %dirs )
+{
+ while( rmdir )
+ {
+ $_ = dirname( $_ );
+ }
+}
Property changes on: dist_clean
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property