[csw-devel] SF.net SVN: gar:[10820] csw/mgar/gar/v2/lib/python

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Aug 27 11:10:27 CEST 2010


Revision: 10820
          http://gar.svn.sourceforge.net/gar/?rev=10820&view=rev
Author:   wahwah
Date:     2010-08-27 09:10:27 +0000 (Fri, 27 Aug 2010)

Log Message:
-----------
mGAR v2: pkgdb gen-html, moved regex processing from the template to the main program.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/pkg-review-template.html
    csw/mgar/gar/v2/lib/python/pkgdb.py

Modified: csw/mgar/gar/v2/lib/python/pkg-review-template.html
===================================================================
--- csw/mgar/gar/v2/lib/python/pkg-review-template.html	2010-08-26 23:59:02 UTC (rev 10819)
+++ csw/mgar/gar/v2/lib/python/pkg-review-template.html	2010-08-27 09:10:27 UTC (rev 10820)
@@ -1,4 +1,5 @@
 ## This is a Cheetah template
+## $Id$
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 <html>
 <head>
@@ -59,14 +60,6 @@
       <a href="#${pkg.basic_stats.md5_sum}">
         ${pkg.basic_stats.pkg_basename}
       </a>
-      <ul>
-        <li><a href="#${pkg.basic_stats.md5_sum}-pkginfo">pkginfo</a></li>
-        <li><a href="#${pkg.basic_stats.md5_sum}-binaries_dump_info">binaries_dump_info</a></li>
-        <li><a href="#${pkg.basic_stats.md5_sum}-depends">depends</a></li>
-        <li><a href="#${pkg.basic_stats.md5_sum}-files_metadata">files_metadata</a></li>
-        <li><a href="#${pkg.basic_stats.md5_sum}-overrides">overrides</a></li>
-        <li><a href="#${pkg.basic_stats.md5_sum}-pkgmap">pkgmap</a></li>
-      </ul>
     </li>
 #end for
   </ul>
@@ -78,16 +71,33 @@
     <a name="${pkg.basic_stats.md5_sum}">${pkg.basic_stats.pkg_basename}</a>
   </h1>
   <h2>
+    Sections
+  </h2>
+      <ul>
+        <li><a href="#${pkg.basic_stats.md5_sum}-pkginfo">pkginfo</a></li>
+        <li><a href="#${pkg.basic_stats.md5_sum}-binaries_dump_info">binaries_dump_info</a></li>
+        <li><a href="#${pkg.basic_stats.md5_sum}-depends">depends</a></li>
+        <li><a href="#${pkg.basic_stats.md5_sum}-files_metadata">files_metadata</a></li>
+        <li><a href="#${pkg.basic_stats.md5_sum}-overrides">overrides</a></li>
+        <li><a href="#${pkg.basic_stats.md5_sum}-pkgmap">pkgmap</a></li>
+      </ul>
+  <h2>
     <a name="${pkg.basic_stats.md5_sum}-source">
       Build source code
     </a>
   </h2>
 #if $pkg.build_src
-  <p>
-    <a href="$pkg.build_src">
-      $pkg.build_src
-    </a>
-  </p>
+  <ul>
+    <li>$pkg.build_src</li>
+    <li>
+      <a href="$pkg.build_src_url_svn">Makefile</a>
+      (in Subversion, may link to a later revision)
+    </li>
+    <li>
+      <a href="$pkg.build_src_url_trac">Makefile</a>
+      (in Trac view, always links to the correct file revision)
+    </li>
+  </ul>
 #else
   <p>
     <span style="warning">

Modified: csw/mgar/gar/v2/lib/python/pkgdb.py
===================================================================
--- csw/mgar/gar/v2/lib/python/pkgdb.py	2010-08-26 23:59:02 UTC (rev 10819)
+++ csw/mgar/gar/v2/lib/python/pkgdb.py	2010-08-27 09:10:27 UTC (rev 10820)
@@ -106,10 +106,18 @@
       data = cPickle.loads(str(srv4.data))
       if "OPENCSW_REPOSITORY" in data["pkginfo"]:
         build_src = data["pkginfo"]["OPENCSW_REPOSITORY"]
-        build_src = re.sub(r"@(\d+)$", r"", build_src)
+        build_src_url_svn = re.sub(r'([^@]*).*', r'\1/Makefile', build_src)
+        build_src_url_trac = re.sub(
+            r'https://gar.svn.(sf|sourceforge).net/svnroot/gar/([^@]+)@(.*)',
+            r'http://sourceforge.net/apps/trac/gar/browser/\2/Makefile?rev=\3',
+            build_src)
       else:
         build_src = None
+        build_src_url_svn = None
+        build_src_url_trac = None
       data["build_src"] = build_src
+      data["build_src_url_svn"] = build_src_url_svn
+      data["build_src_url_trac"] = build_src_url_trac
       pkgstats.append(data)
     # This assumes the program is run as "bin/pkgdb", and not "lib/python/pkgdb.py".
     if not options.pkg_review_template:


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list