[LON-CAPA-cvs] cvs: loncom /build lpml_parse.pl

raeburn raeburn at source.lon-capa.org
Mon Jan 23 07:48:45 EST 2012


raeburn		Mon Jan 23 12:48:45 2012 EDT

  Modified files:              
    /loncom/build	lpml_parse.pl 
  Log:
  - Bug 6535.
   - use -p option with install to apply modification times of source files 
     (in decompressed tarball) to corresponding destination files 
     (in /home/httpd).
   - prevents unwanted .lpmlsave files being generated if other than the 
     latest stable LON-CAPA version was installed, and later updated with a
     newer stable release.  
  
  
Index: loncom/build/lpml_parse.pl
diff -u loncom/build/lpml_parse.pl:1.58 loncom/build/lpml_parse.pl:1.59
--- loncom/build/lpml_parse.pl:1.58	Mon Jan 23 03:32:43 2012
+++ loncom/build/lpml_parse.pl	Mon Jan 23 12:48:45 2012
@@ -12,7 +12,7 @@
 # The LearningOnline Network with CAPA
 # lpml_parse.pl - Linux Packaging Markup Language parser
 #
-# $Id: lpml_parse.pl,v 1.58 2012/01/23 03:32:43 raeburn Exp $
+# $Id: lpml_parse.pl,v 1.59 2012/01/23 12:48:45 raeburn Exp $
 #
 # Written by Scott Harrison, codeharrison at yahoo.com
 #
@@ -1332,11 +1332,11 @@
 		perl filecompare.pl $bflag ${sourceroot}/${source} ${targetroot}/${target} || ECODE=\$\$?; \\
 		case "\$\$ECODE" in \\
 			1) echo "${targetroot}/${target} is unchanged";; \\
-			2) echo "**** WARNING **** target file ${targetroot}/${target} is newer than CVS source; saving current (old) target file to ${targetroot}/${target}.lpmlsave and then overwriting"$logcmd && install -o www -g www -m 0600 ${targetroot}/${target} ${targetroot}/${target}.lpmlsave && install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
-			0) echo "install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
+			2) echo "**** WARNING **** target file ${targetroot}/${target} is newer than CVS source; saving current (old) target file to ${targetroot}/${target}.lpmlsave and then overwriting"$logcmd && install -o www -g www -m 0600 ${targetroot}/${target} ${targetroot}/${target}.lpmlsave && install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
+			0) echo "install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
                 esac; \\
 	elif (test -e "${sourceroot}/${source}") && !(test -e "${targetroot}/${target}"); then\\
-		echo "install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}; \\
+		echo "install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}; \\
 	fi
 	\@if (test -e "${targetroot}/${target}"); then \\
 		perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\
@@ -1349,13 +1349,15 @@
 	elif !(test -e "${sourceroot}/${source}"); then \\
 		echo "**** WARNING **** CVS source file does not exist: ${sourceroot}/${source}"$logcmd; \\
 		perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\
+	elif !(test -e "${targetroot}/${target}"); then \\
+		echo "install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}; \\
 	else \\
 		ECODE=0; \\
 		perl filecompare.pl $bflag ${sourceroot}/${source} ${targetroot}/${target} || ECODE=\$\$?; \\
 		case "\$\$ECODE" in \\
 			1) echo "${targetroot}/${target} is unchanged";; \\
-			2) echo "**** WARNING **** target file ${targetroot}/${target} is newer than CVS source; saving current (old) target file to ${targetroot}/${target}.lpmlsave and then overwriting"$logcmd && install -o www -g www -m 0600 ${targetroot}/${target} ${targetroot}/${target}.lpmlsave && install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
-			0) echo "install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
+			2) echo "**** WARNING **** target file ${targetroot}/${target} is newer than CVS source; saving current (old) target file to ${targetroot}/${target}.lpmlsave and then overwriting"$logcmd && install -o www -g www -m 0600 ${targetroot}/${target} ${targetroot}/${target}.lpmlsave && install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
+			0) echo "install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target}" && install -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
 		esac; \\
 		perl verifymodown.pl ${targetroot}/${target} "$categoryhash{$categoryname}"$logcmd; \\
 	fi
@@ -1552,7 +1554,7 @@
 	    if ($glob eq '*') {
 		$eglob='[^C][^V][^S]'.$glob;
 	    }
-	    return "\t".'install '.
+	    return "\t".'install -p '.
 		$categoryhash{$categoryname}.' '.
 		$sourceroot.'/'.$sourcedir.$eglob.' '.
 		$targetroot.'/'.$targetdir.'.'."\n";




More information about the LON-CAPA-cvs mailing list