HEADS UP TESTERS: New marcusmerge script

Franz Klammer klammer at webonaut.com
Fri May 23 15:13:57 PDT 2003


Am Fr, 2003-05-23 um 21.57 schrieb Franz Klammer:
> Am Fr, 2003-05-23 um 17.48 schrieb Joe Marcus Clarke:
> > Thanks to Lars' suggestion, I have updated marcusmerge to delete
> > obsolete port directories during the merge.  This should hopefully help
> > the upgrade procedure.  Be sure to download the latest version of the
> > script.
> 
> Good idea! since marcusmerge exists i always used the initial
> version. it's a good time to switch over to this version now :-)
> 
> attached a patch that enhances marcusmerge for my needs:
> 
> -p	do also a cvsup of the main ports tree
> -l	run pkg_version -l \< after marcusmerge to list the 
> 	outdated ports.
> 
> maybe it's useful an will be integrated into the official script.
> 

uups! made a mistake :-/

cvsup should be done _after_ removing obsolete ports.


> franz.
> 
> 
> > 
> > Joe
-- 
WEBONAUT.com
http://webonaut.com
mailto:klammer at webonaut.com

-------------- next part --------------
--- marcusmerge.orig	Fri May 23 23:13:59 2003
+++ marcusmerge	Sat May 24 00:12:24 2003
@@ -5,17 +5,25 @@
 SRCDIR=			# The path to the MarcusCom ports.
 DESTDIR="/usr/ports"	# The path to the official ports collection.
 VERBOSE="no"		# If you want verbose output.
+SUPFILE=		# The path your ports-supfile.
 
 # You do not have to change anything beyond this line.
 
+PKGVERSION_CMD="/usr/sbin/pkg_version"
+PKGVERSION_ARGS="-l \<"
+
+CVSUP_CMD="/usr/local/bin/cvsup -g"
+
 CVSROOT=":pserver:anonymous at creme-brulee.marcuscom.com:/space/cvs/marcuscom-cvs"
 RMPORTS="RMPORTS"
 
+update_main="no"
+pkgversion="no"
 updating="no"
-args=`getopt uvs:d:c: $*`
+args=`getopt pluvs:d:c: $*`
 
 if [ $? != 0 ]; then
-    echo "usage: marcusmerge [-s <directory>] [-d <directory>] [-c <cvsroot>] [-u] [-v]"
+    echo "usage: marcusmerge [-s <directory>] [-d <directory>] [-c <cvsroot>] [-u] [-v] [-l] [-p]"
     exit 1
 fi
 
@@ -38,6 +46,12 @@
 	-u)
 		updating="yes";
 		shift;;
+	-l)
+		pkgversion="yes";
+		shift;;
+	-p)
+		update_main="yes";
+		shift;;
 	--)
 		shift; break;;
     esac
@@ -53,6 +67,17 @@
     exit 1
 fi
 
+if [ ${update_main} = "yes" ]; then
+    if [ -z ${SUPFILE} ]; then
+        printf "Update of main ports tree requestet but you forgot\nto set SUPFILE in this script; aborting...\n\n"
+        exit 1
+    fi
+    if [ ! -f ${SUPFILE} ]; then
+        printf "Update of main ports tree requestet but i could not\nfind SUPFILE: ${SUPFILE}; aborting...\n\n"
+        exit 1
+    fi
+fi
+
 if [ ! -d ${SRCDIR} ]; then
     printf "First we have to checkout the ports module from\nhttp://www.marcuscom.com:8080/cgi-bin/cvsweb.cgi\nPlease type 'anoncvs' as your password.\n\n"
     cvs -d${CVSROOT} login
@@ -70,18 +95,26 @@
     echo "===> Updating done."
 fi
 
-echo "===> Merging files to the ports directory"
-echo "${SRCDIR} --> ${DESTDIR}"
-
 if [ -f "${SRCDIR}/${RMPORTS}" ]; then
+    echo "===> Removing obsolete ports from main tree"
     for i in `cat ${SRCDIR}/${RMPORTS}`; do
 	if [ "${VERBOSE}" = "yes" ]; then
-	    echo "Removing obsolete port ${i}"
+	    echo " Removing obsolete port ${i}"
 	fi
 	rm -rf ${DESTDIR}/${i}
     done
+    echo "===> done."
 fi
 
+if [ ${update_main} = "yes" ]; then
+    echo "===> Updating the main ports tree"
+    ${CVSUP_CMD} ${SUPFILE}
+    echo "===> Updating done."
+fi
+
+echo "===> Merging files to the ports directory"
+echo "${SRCDIR} --> ${DESTDIR}"
+
 if [ -d ${SRCDIR}/Mk ]; then
     if [ "${VERBOSE}" = "yes" ]; then
 	echo "Merging Mk files"
@@ -129,4 +162,13 @@
 
 echo "===> Merging done."
 echo
+
+if [ "${pkgversion}" = "yes" ]; then
+    echo "===> Listing outdated ports..."
+    ${PKGVERSION_CMD} ${PKGVERSION_ARGS}
+    echo "===> Listing done."
+fi
+
+echo
+
 printf "Now you should run portupgrade -r pkgconfig to update all of your GNOME 2\nports.\n"


More information about the freebsd-gnome mailing list