SPECS: builder - make --mr-proper remove removed files from CVS co...

glen glen at pld-linux.org
Thu Nov 22 16:06:15 CET 2007


Author: glen                         Date: Thu Nov 22 15:06:15 2007 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- make --mr-proper remove removed files from CVS control files

---- Files affected:
SPECS:
   builder (1.522 -> 1.523) 

---- Diffs:

================================================================
Index: SPECS/builder
diff -u SPECS/builder:1.522 SPECS/builder:1.523
--- SPECS/builder:1.522	Thu Nov 22 00:38:52 2007
+++ SPECS/builder	Thu Nov 22 16:06:10 2007
@@ -241,7 +241,10 @@
 --short-circuit     - short-circuit build
 -B, --branch        - add branch
 -c, --clean         - clean all temporarily created files (in BUILD, SOURCES,
-                      SPECS and \$RPM_BUILD_ROOT),
+                      SPECS and \$RPM_BUILD_ROOT and CVS/Entries) after rpmbuild commands.
+-m, --mr-proper     - clean all temporarily created files (in BUILD, SOURCES,
+					  SPECS and \$RPM_BUILD_ROOT and CVS/Entries). Doesn't run
+					  any rpm building.
 -cf, --cvs-force	- use -F when tagging (useful when moving branches)
 -d <cvsroot>, --cvsroot <cvsroot>
                     - setup \$CVSROOT,
@@ -256,8 +259,6 @@
 --http              - use http instead of ftp,
 -l <logfile>, --logtofile <logfile>
                     - log all to file,
--m, --mr-proper     - only remove all files related to spec file and all work
-                      resources,
 -nc, --no-cvs       - don't download sources from CVS, if source URL is given,
 -ncs, --no-cvs-specs
                     - don't check specs in CVS
@@ -1873,6 +1874,37 @@
 	
 }
 
+# remove entries from CVS/Entries
+cvs_entry_remove() {
+	local cvsdir="$1"; shift
+	if [ ! -d "$cvsdir" ]; then
+		echo >&2 "cvs_entry_remove: $cvsdir is not a directory"
+		exit 1
+	fi
+
+	for file in "$@"; do
+		rm -f $cvsdir/CVS/Entries.new || return 1
+		awk -ve="${file##*/}" -F/ '$2 != e {print}' $cvsdir/CVS/Entries > $cvsdir/CVS/Entries.new || return 1
+		mv -f $cvsdir/CVS/Entries.new $cvsdir/CVS/Entries || return 1
+	done
+	return 0
+}
+
+mr_proper() {
+	init_builder
+	NOCVSSPEC="yes"
+	DONT_PRINT_REVISION="yes"
+	get_spec
+	parse_spec
+
+	# remove from CVS/Entries
+	cvs_entry_remove $SPECS_DIR $SPECFILE
+	cvs_entry_remove $SOURCE_DIR $SOURCES $PATCHES
+
+	# remove spec and sources
+	$RPMBUILD --clean --rmsource --rmspec --nodeps $SPECFILE
+}
+
 #---------------------------------------------
 # main()
 
@@ -2322,7 +2354,7 @@
 		fi
 		;;
 	"mr-proper" )
-		$RPM --clean --rmsource --rmspec --force --nodeps $SPECFILE
+		mr_proper
 		;;
 	"list-sources-files" )
 		init_builder
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/builder?r1=1.522&r2=1.523&f=u



More information about the pld-cvs-commit mailing list