[Lunar-commits] r18780 - moonbase/trunk/perl/perl

Auke Kok sofar at lunar-linux.org
Fri Feb 17 22:53:01 UTC 2006


Author: sofar
Date: 2006-02-17 22:52:57 +0000 (Fri, 17 Feb 2006)
New Revision: 18780

Modified:
   moonbase/trunk/perl/perl/CONFIGURE
   moonbase/trunk/perl/perl/POST_INSTALL
   moonbase/trunk/perl/perl/PRE_BUILD
Log:
really really really really really really really really really really really really really really really really really recompile lunar-installed perl modules after a perl upgrade.

really.


Modified: moonbase/trunk/perl/perl/CONFIGURE
===================================================================
--- moonbase/trunk/perl/perl/CONFIGURE	2006-02-17 22:43:40 UTC (rev 18779)
+++ moonbase/trunk/perl/perl/CONFIGURE	2006-02-17 22:52:57 UTC (rev 18780)
@@ -1,2 +1,9 @@
 mquery CUSTOM "Custom Configuration Perl?" n
 mquery SUIDPERL "Compile and install suidperl?" y
+
+unset_module_config UPGRADE_PERL_MODULES
+unset_module_config OLD_PERL_VERSION
+if module_installed perl && [ "$(installed_version perl)" != "$VERSION" ]; then
+  set_module_config UPGRADE_PERL_MODULES yes
+  set_module_config OLD_PERL_VERSION $(installed_version perl)
+fi

Modified: moonbase/trunk/perl/perl/POST_INSTALL
===================================================================
--- moonbase/trunk/perl/perl/POST_INSTALL	2006-02-17 22:43:40 UTC (rev 18779)
+++ moonbase/trunk/perl/perl/POST_INSTALL	2006-02-17 22:52:57 UTC (rev 18780)
@@ -1,17 +1,24 @@
 #  Reinstall packages that add their own perl modules
-if [ -n "$OLD_PERL_VERSION" ] ; then
-	# preserve CPAN config?
-	if [ ! -f /usr/lib/perl5/$VERSION/CPAN/Config.pm -a -f /usr/lib/perl5/$OLD_PERL_VERSION/CPAN/Config.pm ] ; then
-		cp /usr/lib/perl5/$OLD_PERL_VERSION/CPAN/Config.pm /usr/lib/perl5/$VERSION/CPAN/Config.pm
+if [ -n "$(get_module_config UPGRADE_PERL_MODULES)" ]; then
+	message "$MESSAGE_COLOR"
+	message "Any perl module previously installed is now broken due to the way"
+	message "perl handles modules. They need to be recompiled in order to work."
+	message "$DEFAULT_COLOR"
+	OLD_PERL_VERSION=$(get_module_config OLD_PERL_VERSION)
+	if query "Do you want lunar to attempt to upgrade your perl modules?" y; then
+		# preserve CPAN config?
+		if [ ! -f /usr/lib/perl?/$VERSION/CPAN/Config.pm -a -f /usr/lib/perl?/$OLD_PERL_VERSION/CPAN/Config.pm ] ; then
+			cp /usr/lib/perl?/$OLD_PERL_VERSION/CPAN/Config.pm /usr/lib/perl?/$VERSION/CPAN/Config.pm
+		fi
+		PERLMODS="$( lvu from /usr/lib/perl?/ | cut -d: -f1 | uniq | grep -v perl)"
+		for PERLMOD in $(sort_by_dependency $PERLMODS); do
+			lin -c $PERLMOD || true
+		done
 	fi
-	PERLMODS="$( (lvu from /usr/lib/perl?/$OLD_PERL_VERSION/; lvu from /usr/lib/perl?/site_perl/$OLD_PERL_VERSION/) | cut -d: -f1 | uniq | grep -v perl)"
-	for PERLMOD in $(sort_by_dependency $PERLMODS); do
-		lin -c $PERLMOD || true
-	done
 	unset_module_config OLD_PERL_VERSION
+	unset_module_config UPGRADE_PERL_MODULES
 fi
 
-message ""
-message "${MESSAGE_COLOR}Remember to re-install ANY CPAN modules by hand!${DEFAULT_COLOR}"
-message "${MESSAGE_COLOR}You will also need to re-lin lunar-installed perl modules too!${DEFAULT_COLOR}"
-message ""
+message "$MESSAGE_COLOR"
+message "Remember to re-install all CPAN modules by hand!"
+message "$DEFAULT_COLOR"

Modified: moonbase/trunk/perl/perl/PRE_BUILD
===================================================================
--- moonbase/trunk/perl/perl/PRE_BUILD	2006-02-17 22:43:40 UTC (rev 18779)
+++ moonbase/trunk/perl/perl/PRE_BUILD	2006-02-17 22:52:57 UTC (rev 18780)
@@ -1,7 +1,3 @@
-unset_module_config OLD_PERL_VERSION
-if [ "$(installed_version perl)" != "$VERSION" ]; then
-  set_module_config OLD_PERL_VERSION $(installed_version perl)
-fi &&
 if module_installed perl ; then
   lrm --upgrade perl
 fi &&



More information about the Lunar-commits mailing list