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

raeburn raeburn at source.lon-capa.org
Wed Oct 7 15:55:39 EDT 2020


raeburn		Wed Oct  7 19:55:39 2020 EDT

  Modified files:              
    /loncom/build	lpml_parse.pl 
  Log:
  - For distros where setuid scripts (e.g., lciptables) are wrapped, check for
    update compares target's text version (e.g., .lciptables) with source file.
  
  
Index: loncom/build/lpml_parse.pl
diff -u loncom/build/lpml_parse.pl:1.61 loncom/build/lpml_parse.pl:1.62
--- loncom/build/lpml_parse.pl:1.61	Mon Jun  9 05:14:12 2014
+++ loncom/build/lpml_parse.pl	Wed Oct  7 19:55:39 2020
@@ -12,7 +12,7 @@
 # The LearningOnline Network with CAPA
 # lpml_parse.pl - Linux Packaging Markup Language parser
 #
-# $Id: lpml_parse.pl,v 1.61 2014/06/09 05:14:12 raeburn Exp $
+# $Id: lpml_parse.pl,v 1.62 2020/10/07 19:55:39 raeburn Exp $
 #
 # Written by Scott Harrison, codeharrison at yahoo.com
 #
@@ -1324,6 +1324,15 @@
 		}
 		return $result;
 	    }
+	    my $testtarget = $target;
+	    if ($categoryname eq 'setuid script') {
+		my ($path,$filename) = ($target =~ /^(.*\/)([^\/]+)$/);
+		my $alttarget = $path.'.'.$filename;
+		if ((-e "$targetroot/$target") && (-B "$targetroot/$target") &&
+		    (-e "$targetroot/$alttarget") && (-T "$targetroot/$alttarget")) {
+		    $testtarget = $alttarget;
+		}
+	    }
             my $bflag='-b5';
             $bflag='-b3' if ($buildlink);
             $bflag='-b6' if (($dependencies) or
@@ -1332,7 +1341,7 @@
 		return <<END;
 $buildtest	\@if (test -e "${sourceroot}/${source}") && (test -e "${targetroot}/${target}"); then \\
 		ECODE=0; \\
-		perl filecompare.pl $bflag ${sourceroot}/${source} ${targetroot}/${target} || ECODE=\$\$?; \\
+		perl filecompare.pl $bflag ${sourceroot}/${source} ${targetroot}/${testtarget} || 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 -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\
@@ -1356,7 +1365,7 @@
 		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=\$\$?; \\
+		perl filecompare.pl $bflag ${sourceroot}/${source} ${targetroot}/${testtarget} || 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 -p $categoryhash{$categoryname} ${sourceroot}/${source} ${targetroot}/${target};; \\




More information about the LON-CAPA-cvs mailing list