Hi!

I've added a new option to y2makeall script to invoke 'make clean' before 
building. This is quite helpful if you did not recompile whole subversion for 
quite some time.

Usage: 'y2tool y2makeall --clean'

Patch for trunk yast2-devtools attached. Please, review and commit if useful.

Stano
Index: devtools/bin/y2makeall
===================================================================
--- devtools/bin/y2makeall	(revision 50604)
+++ devtools/bin/y2makeall	(working copy)
@@ -94,6 +94,7 @@
 my $icecream_prefix				= "/opt/icecream";
 my $jobs					= 8;
 my $zypp_defines				= "";
+my $clean					= 0;
 
 # Verbosity values
 
@@ -180,7 +181,8 @@
 		"verbose"		=> \$verbose,
 		"debug"			=> \$debug,
 		"silent"		=> \$silent,
-		"help"			=> \$show_help
+		"help"			=> \$show_help,
+		"clean"			=> \$clean
 		);
 
     usage() if $show_help;
@@ -998,11 +1000,6 @@
 	}
     }
 
-
-    #
-    # make
-    #
-
     if ( $is_cmake_project )
     {
 	chdir( $cmake_build_dir );
@@ -1011,6 +1008,25 @@
 	# system_int( "pwd" );
     }
 
+    #
+    # make clean
+    #
+    if ( $clean )
+    {
+	log_progress( "\tmake clean" );
+	system_int( "$make_env make -e clean >>$make_log 2>&1" ) unless $dry_run;
+
+	if ( $CHILD_ERROR )
+	{
+	    log_error( "'make clean' failed for $pkg_dir" );
+	    $error = 1;
+	}
+    }
+
+    #
+    # make
+    #
+
     if ( ! $error )
     {
 	log_progress( "\tmake $make_target" );
@@ -1398,6 +1414,7 @@
 
 	--fast			no "make -f Makefile.cvs" if it can be avoided
 	--favourites-only	stop processing after favourites list is done
+	--clean			perform 'make clean' before actual building
 
 	--prefix <prefix>	use <prefix> instead of /usr
 	-n  (--no-sudo)		do not sudo certain commands (useful with --prefix)

Reply via email to