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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 11 Sep 2003 22:01:48 -0000


albertel		Thu Sep 11 18:01:48 2003 EDT

  Modified files:              
    /loncom/build	lpml_parse.pl 
  Log:
  - fixes BUG#580
     -<privatedependencies> are not put into MANIFEST
     -<file type="private"> are not added to MANIFEST
  
  
  
Index: loncom/build/lpml_parse.pl
diff -u loncom/build/lpml_parse.pl:1.51 loncom/build/lpml_parse.pl:1.52
--- loncom/build/lpml_parse.pl:1.51	Sun Oct 13 13:27:49 2002
+++ loncom/build/lpml_parse.pl	Thu Sep 11 18:01:48 2003
@@ -12,7 +12,7 @@
 # The LearningOnline Network with CAPA
 # lpml_parse.pl - Linux Packaging Markup Language parser
 #
-# $Id: lpml_parse.pl,v 1.51 2002/10/13 17:27:49 harris41 Exp $
+# $Id: lpml_parse.pl,v 1.52 2003/09/11 22:01:48 albertel Exp $
 #
 # Written by Scott Harrison, codeharrison@yahoo.com
 #
@@ -386,6 +386,7 @@
     build => \&format_build,
     status => \&format_status,
     dependencies => \&format_dependencies,
+    privatedependencies => \&format_privatedependencies,
     buildlink => \&format_buildlink,
     glob => \&format_glob,
     sourcedir => \&format_sourcedir,
@@ -1236,6 +1237,9 @@
 	    my (@deps)=split(/\;/,$dependencies);
 	    my $retval=join("\n",($source,
 		       (map {"$command$_"} @deps)));
+	    if ($tokeninfo[2]{type} eq 'private') {
+		return "\n";
+	    }
 	    return $retval."\n";
 	}
 	elsif ($mode eq 'html') {
@@ -1618,12 +1622,24 @@
 # ------------------------------------------------- Format dependencies section
 sub format_dependencies {
     my @tokeninfo=@_;
-    $dependencies='';
+    #$dependencies='';
     my $text=&trim($parser->get_text('/dependencies'));
     if ($text) {
 	$parser->get_tag('/dependencies');
-	$dependencies=join(';',
-			      (map {s/^\s*//;s/\s$//;$_} split(/\;/,$text)));
+	$dependencies=join(';',((map {s/^\s*//;s/\s$//;$_} split(/\;/,$text)),$dependencies));
+	$dependencies=~s/;$//;
+    }
+    return '';
+}
+sub format_privatedependencies {
+    my @tokeninfo=@_;
+    #$dependencies='';
+    my $text=&trim($parser->get_text('/privatedependencies'));
+    if ($text) {
+	$parser->get_tag('/privatedependencies');
+	if ($mode eq 'MANIFEST') { return '';	}
+	$dependencies=join(';',((map {s/^\s*//;s/\s$//;$_} split(/\;/,$text)),$dependencies));
+	$dependencies=~s/;$//;
     }
     return '';
 }