ports/70677: UPDATE: www/bricolage to 1.8. 1

Rod Taylor ports at rbt.ca
Thu Aug 19 23:50:25 UTC 2004


>Number:         70677
>Category:       ports
>Synopsis:       UPDATE: www/bricolage to 1.8. 1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 19 23:50:24 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Rod Taylor
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD jester.rbt.ca 5.2-CURRENT FreeBSD 5.2-CURRENT #1: Sat May 15 02:34:43 EDT 2004 root at jester.rbt.ca:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
	
	Upgrade Bricolage to 1.8.1. Requires the inclusion of a custom upgrade script
	to upgrade between versions.

>How-To-Repeat:
	
>Fix:

	

--- bricolage.patch begins here ---
Binary files bricolage.orig/.pkg-plist.swo and bricolage/.pkg-plist.swo differ
diff -ruN bricolage.orig/Makefile bricolage/Makefile
--- bricolage.orig/Makefile	Wed Aug 11 17:42:22 2004
+++ bricolage/Makefile	Thu Aug 19 11:49:46 2004
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	bricolage
-PORTVERSION=	1.8.0
+PORTVERSION=	1.8.1
 CATEGORIES=	www perl5
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	bricolage
@@ -49,6 +49,9 @@
 
 MAKE_ENV+=	INSTALL_VERBOSITY="QUIET"
 
+# Used to determine which versions we can upgrade from
+PREVIOUS_VERSIONS=	1.8.0 1.8.1
+
 USE_REINPLACE=	yes
 PERL_CONFIGURE=	yes
 PKGMESSAGE=	${WRKDIR}/pkg-message
@@ -212,20 +215,35 @@
 		Bric::Util::UserPref.3 Bric::Util::WebDav.3
 
 SQLDIR=		${PREFIX}/share/${PKGNAMEPREFIX}${PORTNAME}
+UPGRADEDIR=		${PREFIX}/bricolage/upgrade
 
-# Setup for $PREFIX
+# Setup for $PREFIX and $SQLDIR
 post-patch:
 	@${SED} -e "s,%%PREFIX%%,${PREFIX},g" ${.CURDIR}/pkg-message > ${PKGMESSAGE}
+	@${SED} -e "s,%%PREFIX%%,${PREFIX},g" \
+		-e "s,%%PORTVERSION%%,${PORTVERSION},g" \
+		${FILESDIR}/bric_upgrade.sh > ${WRKSRC}/bric_upgrade
 	@${REINPLACE_CMD} -e "s,%%SQLDIR%%,${SQLDIR},g" ${WRKSRC}/bin/bric_pgimport
 	@${REINPLACE_CMD} -e "s,%%PREFIX%%,${PREFIX},g" \
 		-e "s,%%SITE_PERL_REL%%,${SITE_PERL_REL},g" \
 		-e "s,%%MAN3PREFIX%%,${MAN3PREFIX},g" \
 		-e "s,%%MAN1PREFIX%%,${MAN1PREFIX},g" ${WRKSRC}/inst/config.pl
 
-# Install SQL file and display pkg-message
+# Install SQL file, upgrade files, and display pkg-message
 post-install:
+	${INSTALL_SCRIPT} ${WRKSRC}/bric_upgrade ${PREFIX}/bin
 	@${MKDIR} ${SQLDIR}
 	${INSTALL_DATA} ${WRKSRC}/inst/Pg.sql ${SQLDIR}
+	@${MKDIR} ${UPGRADEDIR}
+	${INSTALL_DATA} ${WRKSRC}/inst/versions.txt ${UPGRADEDIR}
+	@${MKDIR} ${UPGRADEDIR}/lib
+	${INSTALL_DATA} ${WRKSRC}/inst/upgrade/lib/bric_upgrade.pm ${UPGRADEDIR}/lib
+	@for ver in ${PREVIOUS_VERSIONS} ; do \
+		${MKDIR} ${UPGRADEDIR}/$${ver} ; \
+	done
+	for ver in ${PREVIOUS_VERSIONS} ; do \
+		${INSTALL_SCRIPT} ${WRKSRC}/inst/upgrade/$${ver}/*.pl ${UPGRADEDIR}/$${ver} ; \
+	done
 	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.post.mk>
diff -ruN bricolage.orig/distinfo bricolage/distinfo
--- bricolage.orig/distinfo	Wed Jun 16 09:34:30 2004
+++ bricolage/distinfo	Wed Aug 18 16:55:44 2004
@@ -1,2 +1,2 @@
-MD5 (bricolage-1.8.0.tar.gz) = bf06cde4eaef7549702d9648274fe235
-SIZE (bricolage-1.8.0.tar.gz) = 2257604
+MD5 (bricolage-1.8.1.tar.gz) = 93525168d152ac12f438b3ae6b4ac669
+SIZE (bricolage-1.8.1.tar.gz) = 2267893
diff -ruN bricolage.orig/files/bric_upgrade.sh bricolage/files/bric_upgrade.sh
--- bricolage.orig/files/bric_upgrade.sh	Wed Dec 31 19:00:00 1969
+++ bricolage/files/bric_upgrade.sh	Thu Aug 19 10:53:32 2004
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+BRICUPGRADE=%%PREFIX%%
+NEWVERSION=%%PORTVERSION%%
+
+# Ensure the version exists
+if [ "X" = "X${NEWVERSION}" ]
+then
+	echo "New version not supplied (port bug)"
+	exit 1
+fi
+
+# Ensure the old version exists at the end of the argument list
+OLDVERSION=`echo "$*" | sed -e "s/^.* \([^ ]*\)/\1/"`
+VTEST=`echo "$OLDVERSION" | sed -e "s/^1\.8\.[01]$/OKAY/"`
+if [ "${VTEST}" != "OKAY" ]
+then
+	echo "The final argument should be the old version of the port, in the format."
+	echo "	$0 [options] <version number>"
+	exit 1
+fi
+
+HAS_VERSION=`grep ${OLDVERSION} ${BRICUPGRADE}/versions.txt`
+if [ "${HAS_VERSION}" = "" ]
+then
+	echo "Version ${OLDVERSION} could not be found in the ${BRICUPGRADE}/versions.txt file"
+	echo "There are no components to upgrade"
+	exit 0
+fi
+
+# Now try to upgrade it
+for ver in `grep -A 1000 ${OLDVERSION} ${BRICUPGRADE}/versions.txt | tail -n +2`
+do
+	for file in `ls ${BRICUPGRADE}/${ver}`
+	do
+		${BRICUPGRADE}/${ver}/${file} $@ # Run with our args
+	done
+done
+
+echo "Upgrade complete"
+exit 0
diff -ruN bricolage.orig/files/patch-bin::bric_pgimport bricolage/files/patch-bin::bric_pgimport
--- bricolage.orig/files/patch-bin::bric_pgimport	Wed Jun 16 09:34:30 2004
+++ bricolage/files/patch-bin::bric_pgimport	Wed Aug 18 18:01:36 2004
@@ -1,22 +1,19 @@
-*** bin/bric_pgimport.orig	Sun Feb 29 15:11:56 2004
---- bin/bric_pgimport	Tue Jun  1 22:55:42 2004
+*** bin/bric_pgimport.orig	Tue Jun  8 22:22:34 2004
+--- bin/bric_pgimport	Wed Aug 18 18:00:40 2004
 ***************
-*** 33,41 ****
+*** 35,41 ****
   
-  =item -w
-  
-! The directory with the CVS SQL files. Defaults to lib subdirectory of
-! BRICOLAGE_ROOT environment variable, which itself defaults to
+  The directory with the Subversion SQL files. Defaults to lib subdirectory of
+  BRICOLAGE_ROOT environment variable, which itself defaults to
 ! F</usr/local/bricolage>.
   
   =item -u
   
---- 33,40 ----
-  
-  =item -w
+--- 35,41 ----
   
-! The directory with the Bricolage SQL files. Defaults to 
-! F</usr/local/share/bricolage>.
+  The directory with the Subversion SQL files. Defaults to lib subdirectory of
+  BRICOLAGE_ROOT environment variable, which itself defaults to
+! F<%%SQLDIR%%>.
   
   =item -u
   
@@ -32,14 +29,31 @@
       }
   
       # Print a usage message unless all required args are included or if -h has
---- 188,197 ----
+--- 189,198 ----
   
       if ($opt_w) {
           # Add on the location of the SQL.
 !         $opt_w = catdir($opt_w);
       } else {
-! 	$ENV{BRICOLAGE_ROOT} ||= '/usr/local/share/bricolage';
+! 	$ENV{BRICOLAGE_ROOT} ||= '%%SQLDIR%%';
 ! 	$opt_w = catdir($ENV{BRICOLAGE_ROOT});
       }
   
       # Print a usage message unless all required args are included or if -h has
+***************
+*** 252,258 ****
+       This should work if psql is in your path.
+    -w The directory with the Subversion SQL files. Defaults to lib subdirectory
+       of BRICOLAGE_ROOT environment variable, which itself defaults to
+!      /usr/local/bricolage.
+    -u Database user login. Defaults to PGUSER environment variable.
+    -p Database user password. Defaults to PGPASSWORD environment variable.
+    -d Database name. Defaults to PGDATABASE environment variable.
+--- 252,258 ----
+       This should work if psql is in your path.
+    -w The directory with the Subversion SQL files. Defaults to lib subdirectory
+       of BRICOLAGE_ROOT environment variable, which itself defaults to
+!      %%SQLDIR%%.
+    -u Database user login. Defaults to PGUSER environment variable.
+    -p Database user password. Defaults to PGPASSWORD environment variable.
+    -d Database name. Defaults to PGDATABASE environment variable.
diff -ruN bricolage.orig/pkg-message bricolage/pkg-message
--- bricolage.orig/pkg-message	Mon Jul 12 18:02:52 2004
+++ bricolage/pkg-message	Thu Aug 19 10:49:28 2004
@@ -1,5 +1,8 @@
 ************************************************************
-Bricolage has been installed but is not yet usable.
+NEW INSTALL:
+
+The Bricolage software has now been installed, but there are
+number of steps remaining to make it usable.
 
 You must: 1) Import the database
           2) Edit your apache.conf file
@@ -45,5 +48,24 @@
 
 	Login:	 	"admin"
 	Password:	"change me now!"
+
+************************************************************
+UPGRADE: 
+
+If you are upgrading from one version of the www/bricolage port to
+another, skip the above installation related items and instead
+run the following upgrade command after making backups of
+the %%PREFIX%%/bricolage path and the bric database:
+
+  bric_upgrade [options] <Previous Bricolage Version>
+
+Common Supported Options:
+  -u Database user login.
+  -p Database user password.
+  -d Database name.
+
+Example:
+
+	%%PREFIX%%/bin/bric_upgrade -u pgsql -d bric 1.8.0 
 
 ************************************************************
diff -ruN bricolage.orig/pkg-plist bricolage/pkg-plist
--- bricolage.orig/pkg-plist	Wed Jun 16 09:34:30 2004
+++ bricolage/pkg-plist	Thu Aug 19 14:06:10 2004
@@ -8,6 +8,13 @@
 bin/bric_dist_mon
 bin/bric_apachectl
 bin/bric_soap
+bin/bric_upgrade
+bricolage/upgrade/versions.txt
+bricolage/upgrade/lib/bric_upgrade.pm
+bricolage/upgrade/1.8.0/new_lang_pref_options.pl
+bricolage/upgrade/1.8.1/contrib_type_secret.pl
+bricolage/upgrade/1.8.1/fix_orphan_assets.pl
+bricolage/upgrade/1.8.1/grp_grp_name.pl
 bricolage/comp/admin/alerts/dhandler
 bricolage/comp/admin/alerts/recip
 bricolage/comp/admin/control/change_user/dhandler
@@ -203,6 +210,7 @@
 bricolage/comp/help/dhandler
 bricolage/comp/help/en_us/about.html
 bricolage/comp/help/en_us/admin/control/change_user.html
+bricolage/comp/help/en_us/admin/control/publish.html
 bricolage/comp/help/en_us/admin/events/dhandler
 bricolage/comp/help/en_us/admin/manager/alert_type.html
 bricolage/comp/help/en_us/admin/manager/category.html
@@ -980,6 +988,20 @@
 bricolage/comp/login/dhandler
 bricolage/comp/login/welcome.html
 bricolage/comp/media/css/style.css
+bricolage/comp/media/css/bo.css
+bricolage/comp/media/css/de_de.css
+bricolage/comp/media/css/en_us.css
+bricolage/comp/media/css/it_it.css
+bricolage/comp/media/css/km.css
+bricolage/comp/media/css/ko_ko.css
+bricolage/comp/media/css/lo.css
+bricolage/comp/media/css/my.css
+bricolage/comp/media/css/pt_pt.css
+bricolage/comp/media/css/ug.css
+bricolage/comp/media/css/vi_vn.css
+bricolage/comp/media/css/zh_cn.css
+bricolage/comp/media/css/zh_hk.css
+bricolage/comp/media/css/zh_tw.css
 bricolage/comp/media/images/006666_curve_left.gif
 bricolage/comp/media/images/006666_curve_right.gif
 bricolage/comp/media/images/646430_arrow_open.gif
@@ -2749,6 +2771,10 @@
 @dirrm %%SITE_PERL%%/Bric
 @dirrm %%SITE_PERL%%/mach/auto/Bric
 @dirrm %%SITE_PERL%%/mach/auto/bric_bin
+ at dirrm bricolage/upgrade/1.8.1
+ at dirrm bricolage/upgrade/1.8.0
+ at dirrm bricolage/upgrade/lib
+ at dirrm bricolage/upgrade
 @dirrm bricolage/data/burn/comp/oc_1
 @dirrm bricolage/data/burn/comp
 @dirrm bricolage/data/burn
@@ -3112,6 +3138,7 @@
 @dirrm bricolage/comp/help/bo
 @dirrm bricolage/comp/help
 @dirrm bricolage/comp/errors
+ at exec [ -d bricolage/comp/data ] || (mkdir -p bricolage/comp/data && chown www:www bricolage/comp/data)
 @dirrm bricolage/comp/data
 @dirrm bricolage/comp/admin/profile/workflow
 @dirrm bricolage/comp/admin/profile/user_pref
--- bricolage.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list