You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by zo...@apache.org on 2011/03/25 20:00:24 UTC

svn commit: r1085517 - in /aries/scripts: create_modules_table.pl download_release_artifacts.pl

Author: zoe
Date: Fri Mar 25 19:00:24 2011
New Revision: 1085517

URL: http://svn.apache.org/viewvc?rev=1085517&view=rev
Log:
Fix bug in downloads script, add create table

Added:
    aries/scripts/create_modules_table.pl
Modified:
    aries/scripts/download_release_artifacts.pl

Added: aries/scripts/create_modules_table.pl
URL: http://svn.apache.org/viewvc/aries/scripts/create_modules_table.pl?rev=1085517&view=auto
==============================================================================
--- aries/scripts/create_modules_table.pl (added)
+++ aries/scripts/create_modules_table.pl Fri Mar 25 19:00:24 2011
@@ -0,0 +1,95 @@
+#!/usr/bin/perl
+#
+# Generate a release table row for each bundle to be released
+# Needs a text file called aries_release_versions.txt. This needs to be updated with the
+# right version information before running the script.
+#
+
+$release_file = @ARGV[0];
+
+if (!-f $release_file) {
+         print "\nUsage: perl create_modules_table.pl aries_release_versions.txt \n\n";
+         exit;
+}
+
+
+# Distribution directories
+$cgi = "http://www.apache.org/dyn/closer.cgi/aries/";
+$dist = "http://www.apache.org/dist/aries/";
+
+$oaa = "org.apache.aries.";
+
+#HTML fragments
+$open_td = "<td class=\"confluenceTd\"\>";
+$close_td = "</td>";
+$open_tr = "<tr>";
+$close_tr = "</tr>";
+$ar = "<A href=\"";
+$c_jar = "\">jar</A>";
+$c_asc = "\">asc</A>";
+$c_md5 = "\">md5</A>";
+$c_sha1 = "\">sha1</A>";
+
+open (MOD, "aries_release_versions.txt");
+
+while (<MOD>) {
+    if (/Module: (\w+)/i) {
+        $module = $1;
+        print_module_header();
+        # print "$module \n";
+        while (<MOD>) {
+            last if (/ModuleEnd/i); 
+            next if (/^#/);
+            chomp;
+            ($bundle, $version) = split(/,/, $_); 
+            print_table_row();
+         #    print "$bundle $version \n";
+       } 
+    }
+}
+
+foreach $keys (%bundle_info) {
+    print;
+}
+
+sub print_module_header {
+    print $open_tr.$open_td." ".$module." ".$close_td.$open_td.$close_td.$open_td." - ".$close_td.$open_td." - " .$close_td.$open_td." - ".$close_td.$open_td.$close_td.$close_tr."\n";
+}
+
+
+sub print_table_row {
+
+    $jar = $bundle."-".$version.".jar";
+    $asc = $bundle."-".$version.".jar.asc";
+    $md5 = $bundle."-".$version.".jar.md5";
+    $sha1 = $bundle."-".$version.".jar.sha1";
+
+    $s_jar = $bundle."-".$version.".sources.jar";
+    $s_asc = $bundle."-".$version.".sources.jar.asc";
+    $s_md5 = $bundle."-".$version.".sources.jar.md5";
+    $s_sha1 = $bundle."-".$version.".sources.jar.sha1";
+
+    $line1 = $ar.$cgi.$oaa.$jar.$c_jar.
+             " (".
+             $ar.$dist.$oaa.$asc.$c_asc.
+             ", ".
+             $ar.$dist.$oaa.$md5.$c_md5.
+             ", ".
+             $ar.$dist.$oaa.$sha1.$c_sha1.
+             ")";
+
+    $line2 = $ar.$cgi.$oaa.$s_jar.$c_jar.
+             " (".
+             $ar.$dist.$oaa.$s_asc.$c_asc.
+             ", ".
+             $ar.$dist.$oaa.$s_md5.$c_md5.
+             ", ".
+             $ar.$dist.$oaa.$s_sha1.$c_sha1.
+             ")";
+             
+    print $open_tr.$open_td.$close_td.$open_td." ".$bundle." ".$close_td.$open_td." ".$version." ".$close_td.$open_td."\n";
+    print $line1."\n";
+    print $close_td.$open_td."\n";
+    print $line2."\n";
+    print $close_td.$open_td.$close_td.$close_tr."\n";
+}

Modified: aries/scripts/download_release_artifacts.pl
URL: http://svn.apache.org/viewvc/aries/scripts/download_release_artifacts.pl?rev=1085517&r1=1085516&r2=1085517&view=diff
==============================================================================
--- aries/scripts/download_release_artifacts.pl (original)
+++ aries/scripts/download_release_artifacts.pl Fri Mar 25 19:00:24 2011
@@ -15,30 +15,38 @@ $from_repository = "https://repository.a
 
 $oaa = "org.apache.aries";
 
+@file_types = (
+              "",
+              ".md5",
+              ".asc",
+              ".sha1"
+              );
+
 open (MOD, $release_file);
 
 while (<MOD>) {
     if (/Module: (\w+)/i) {
     $module = $1;
-  # print "$module \n";
+  #
+  # Special case util
+  #
+    if ($module =~ /util/i ) {
+        $module = "";
+    } 
     while (<MOD>) {
        last if (/ModuleEnd/i);
        next if (/^#/);
        chomp;
        ($bundle, $version) = split(/,/, $_);
        print_row();
-     # print "$bundle $version \n";
+       # print "$bundle $version \n";
     }
   }
 }
 sub print_row {
-  print "wget $from_repository/$module/$oaa.$bundle/$version/$oaa.$bundle-$version.jar\n";
-  print "wget $from_repository/$module/$oaa.$bundle/$version/$oaa.$bundle-$version.jar.md5\n";
-  print "wget $from_repository/$module/$oaa.$bundle/$version/$oaa.$bundle-$version.jar.asc\n";
-  print "wget $from_repository/$module/$oaa.$bundle/$version/$oaa.$bundle-$version.jar.sha1\n";
-  print "wget $from_repository/$module/$oaa.$bundle/$version/$oaa.$bundle-$version-sources.jar\n";
-  print "wget $from_repository/$module/$oaa.$bundle/$version/$oaa.$bundle-$version-sources.jar.md5\n";
-  print "wget $from_repository/$module/$oaa.$bundle/$version/$oaa.$bundle-$version-sources.jar.asc\n";
-  print "wget $from_repository/$module/$oaa.$bundle/$version/$oaa.$bundle-$version-sources.jar.sha1\n";
+  foreach $ft ($file_types) {
+     print "wget $from_repository/$module/$oaa.$bundle/$version/$oaa.$bundle-$version.jar$ft\n";
+     print "wget $from_repository/$module/$oaa.$bundle/$version/$oaa.$bundle-$version-sources.jar$ft\n";
+  }
 }