[csw-devel] SF.net SVN: gar:[10989] csw/mgar/gar/v2-fortran

gadavis at users.sourceforge.net gadavis at users.sourceforge.net
Fri Sep 17 00:04:23 CEST 2010


Revision: 10989
          http://gar.svn.sourceforge.net/gar/?rev=10989&view=rev
Author:   gadavis
Date:     2010-09-16 22:04:22 +0000 (Thu, 16 Sep 2010)

Log Message:
-----------
Merge in changes from v2 "trunk": svn merge -r 10927:HEAD ../v2

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

Property Changed:
----------------
    csw/mgar/gar/v2-fortran/
    csw/mgar/gar/v2-fortran/pkglib/csw/depend


Property changes on: csw/mgar/gar/v2-fortran
___________________________________________________________________
Modified: svn:mergeinfo
   - /csw/mgar/gar/v2:4936-6678
/csw/mgar/gar/v2-bwalton:9784-10011
/csw/mgar/gar/v2-checkpkg:7722-7855
/csw/mgar/gar/v2-checkpkg-override-relocation:10585-10737
/csw/mgar/gar/v2-checkpkg-stats:8454-8649
/csw/mgar/gar/v2-collapsed-modulations:6895
/csw/mgar/gar/v2-dirpackage:8125-8180
/csw/mgar/gar/v2-migrateconf:7082-7211
/csw/mgar/gar/v2-skayser:6087-6132
/csw/mgar/gar/v2-sqlite:10434-10449
   + /csw/mgar/gar/v2:4936-6678,10928-10988
/csw/mgar/gar/v2-bwalton:9784-10011
/csw/mgar/gar/v2-checkpkg:7722-7855
/csw/mgar/gar/v2-checkpkg-override-relocation:10585-10737
/csw/mgar/gar/v2-checkpkg-stats:8454-8649
/csw/mgar/gar/v2-collapsed-modulations:6895
/csw/mgar/gar/v2-dirpackage:8125-8180
/csw/mgar/gar/v2-migrateconf:7082-7211
/csw/mgar/gar/v2-skayser:6087-6132
/csw/mgar/gar/v2-sqlite:10434-10449

Modified: csw/mgar/gar/v2-fortran/gar.lib.mk
===================================================================
--- csw/mgar/gar/v2-fortran/gar.lib.mk	2010-09-16 21:44:01 UTC (rev 10988)
+++ csw/mgar/gar/v2-fortran/gar.lib.mk	2010-09-16 22:04:22 UTC (rev 10989)
@@ -629,6 +629,41 @@
 	@( cd $* ; $(BUILD_ENV) python ./setup.py $(PYBUILD_CMD) $(BUILD_ARGS) )
 	@$(MAKECOOKIE)
 
+#################### CLEAN RULES ####################
+
+CLEAN_ARGS ?= clean
+ 
+# build from a standard gnu-style makefile's default rule.
+clean-%/Makefile:
+	@echo " ==> Running clean in $*"
+	@$(BUILD_ENV) $(MAKE) $(foreach TTT,$(BUILD_OVERRIDE_DIRS),$(TTT)="$($(TTT))") -C $* $(CLEAN_ARGS)
+	@rm -f $(COOKIEDIR)/build-$*
+
+clean-%/makefile:
+	@echo " ==> Running clean in $*"
+	@$(BUILD_ENV) $(MAKE) $(foreach TTT,$(BUILD_OVERRIDE_DIRS),$(TTT)="$($(TTT))") -C $* $(CLEAN_ARGS)
+	@rm -f $(COOKIEDIR)/build-$*
+
+clean-%/GNUmakefile:
+	@echo " ==> Running clean in $*"
+	@$(BUILD_ENV) $(MAKE) $(foreach TTT,$(BUILD_OVERRIDE_DIRS),$(TTT)="$($(TTT))") -C $* $(CLEAN_ARGS)
+	@rm -f $(COOKIEDIR)/build-$*
+
+clean-%/Jamfile:
+	$(error *** Don't know how to clean Jamfiles)
+
+clean-%/Rakefile:
+	$(error *** Don't know how to clean Rakefiles)
+
+clean-%/rakefile:
+	$(error *** Don't know how to clean Rakefiles)
+
+clean-%/setup.rb:
+	$(error *** Don't know how to clean Ruby setups)
+
+clean-%/setup.py:
+	$(error *** Don't know how to clean Python builds)
+
 #################### TEST RULES ####################
 
 TEST_TARGET ?= test

Modified: csw/mgar/gar/v2-fortran/gar.mk
===================================================================
--- csw/mgar/gar/v2-fortran/gar.mk	2010-09-16 21:44:01 UTC (rev 10988)
+++ csw/mgar/gar/v2-fortran/gar.mk	2010-09-16 22:04:22 UTC (rev 10989)
@@ -151,6 +151,7 @@
 $(call _modulate_target,build,$(2),$(4))
 $(call _modulate_target_nocookie,reset-build,$(2),$(4))
 $(call _modulate_target,test,$(2),$(4))
+$(call _modulate_target_nocookie,reset-test,$(2),$(4))
 $(call _modulate_target,install,$(2),$(4))
 $(call _modulate_target_nocookie,reset-install,$(2),$(4))
 #$(call _modulate_target,merge,$(2),$(4))
@@ -404,7 +405,9 @@
 extract-modulated: checksum-modulated $(EXTRACTDIR) $(COOKIEDIR) \
 		$(addprefix dep-$(GARDIR)/,$(EXTRACTDEPS)) \
 		announce-modulation \
-		pre-extract-modulated pre-extract-$(MODULATION) $(EXTRACT_TARGETS) post-extract-$(MODULATION) post-extract-modulated $(if $(filter global,$(MODULATION)),,post-extract-gitsnap)
+		pre-extract-modulated pre-extract-$(MODULATION) $(EXTRACT_TARGETS) post-extract-$(MODULATION) post-extract-modulated \
+		$(if $(filter global,$(MODULATION)),,post-extract-gitsnap) \
+		$(foreach FILE,$(EXPANDVARS),expandvars-$(FILE))
 	@$(DONADA)
 
 # This target ensures that the values used by git when making a commit
@@ -442,6 +445,15 @@
 extract-p:
 	@$(foreach COOKIEFILE,$(EXTRACT_TARGETS), test -e $(COOKIEDIR)/$(COOKIEFILE) ;)
 
+# The rule takes all files from EXPANDVARS and replaces all occurrences of @<var>@ in the file
+# with the values of <var> from the Makefile.
+_var_definitions = $(foreach VAR,$(shell perl -ne 'print "$$1 " if( /@([^@]+)@/ )' <$1),$(VAR)=$($(VAR)))
+
+expandvars-%:
+	$(call _var_definitions,$(WORKDIR)/$*) perl -i-unexpanded -npe 's/@([^@]+)@/$$ENV{$$1}/e' $(WORKDIR)/$*
+	@$(MAKECOOKIE)
+
+
 # checkpatch	- Do a "patch -C" instead of a "patch".  Note
 # 				  that it may give incorrect results if multiple
 # 				  patches deal with the same file.
@@ -555,6 +567,7 @@
 reset-configure: $(addprefix reset-configure-,$(MODULATIONS))
 	rm -f $(COOKIEDIR)/configure
 
+# XXX: pre-*, post-*
 reset-configure-modulated:
 	rm -f $(addprefix $(COOKIEDIR)/,$(CONFIGURE_TARGETS))
 
@@ -578,6 +591,16 @@
 build-modulated: verify-isa configure-modulated pre-build-modulated pre-build-$(MODULATION) $(BUILD_TARGETS) post-build-$(MODULATION) post-build-modulated
 	@$(MAKECOOKIE)
 
+.PHONY: reset-build reset-build-modulated
+rebuild: reset-build build
+
+reset-build: $(addprefix reset-build-,$(MODULATIONS))
+	rm -f $(COOKIEDIR)/build
+
+# XXX: pre-*, post-*
+reset-build-modulated: $(patsubst build-%,clean-%,$(BUILD_TARGETS))
+	rm -f $(addprefix $(COOKIEDIR)/,pre-build-modulated $(BUILD_TAGRETS) post-build-modulated))
+
 # returns true if build has completed successfully, false
 # otherwise
 build-p:
@@ -591,6 +614,8 @@
 test-modulated: build-modulated pre-test-modulated pre-test-$(MODULATION) $(TEST_TARGETS) post-test-$(MODULATION) post-test-modulated
 	$(DONADA)
 
+# XXX: retest
+
 # strip - Strip executables
 ifneq ($(GARFLAVOR),DBG)
 POST_INSTALL_TARGETS := strip $(POST_INSTALL_TARGETS)

Modified: csw/mgar/gar/v2-fortran/lib/python/pkg-review-template.html
===================================================================
--- csw/mgar/gar/v2-fortran/lib/python/pkg-review-template.html	2010-09-16 21:44:01 UTC (rev 10988)
+++ csw/mgar/gar/v2-fortran/lib/python/pkg-review-template.html	2010-09-16 22:04:22 UTC (rev 10989)
@@ -50,6 +50,18 @@
   margin: 0px;
   padding: 2px;
 }
+ul.error_tags li {
+  list-style: none;
+  background-color: #FDD;
+  padding: 0px;
+  margin: 0px;
+}
+ul.overrides li {
+  list-style: none;
+  background-color: #FFD;
+  padding: 0px;
+  margin: 0px;
+}
 </style>
 </head>
 <body>
@@ -75,6 +87,8 @@
   </h2>
       <ul>
         <li><a href="#${pkg.basic_stats.md5_sum}-pkginfo">pkginfo</a></li>
+        <li><a href="#${pkg.basic_stats.md5_sum}-error_tags">error tags</a></li>
+        <li><a href="#${pkg.basic_stats.md5_sum}-overrides">overrides</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>
@@ -192,6 +206,49 @@
   </tr>
 #end for
   </table>
+
+  <h2>
+    <a name="${pkg.basic_stats.md5_sum}-error_tags">
+      Error tags
+    </a>
+  </h2>
+#if $pkg.error_tags
+  <ul class="error_tags">
+#for etag in $pkg.error_tags
+  <li>
+      <code>
+        $etag.pkgname
+        $etag.tag_name
+        $etag.tag_info
+      </code>
+    </li>
+#end for
+  </ul>
+#else
+  <p>No error tags.</p>
+#end if
+
+  <h2>
+    <a name="${pkg.basic_stats.md5_sum}-overrides">
+      Overrides
+    </a>
+  </h2>
+#if $pkg.overrides
+  <ul class="overrides">
+#for override in $pkg.overrides
+    <li>
+      <code>
+        $override.pkgname
+        $override.tag_name
+        $override.tag_info
+      </code>
+    </li>
+#end for
+  </ul>
+#else
+  <p>No overrides.</p>
+#end if
+
 #if $pkg.binaries_dump_info
   <h2>
     <a name="${pkg.basic_stats.md5_sum}-binaries_dump_info">

Modified: csw/mgar/gar/v2-fortran/lib/python/pkgdb.py
===================================================================
--- csw/mgar/gar/v2-fortran/lib/python/pkgdb.py	2010-09-16 21:44:01 UTC (rev 10988)
+++ csw/mgar/gar/v2-fortran/lib/python/pkgdb.py	2010-09-16 22:04:22 UTC (rev 10989)
@@ -35,7 +35,62 @@
 stats_version:  $stats_version
 """
 
+DEFAULT_TEMPLATE_FILENAME = "../lib/python/pkg-review-template.html"
 
+
+class HtmlGenerator(object):
+
+  def __init__(self, md5_sums, template=None):
+    self.md5_sums = md5_sums
+    self.template = template
+
+  def GetErrorTagsResult(self, srv4):
+    res = m.CheckpkgErrorTag.select(
+        m.CheckpkgErrorTag.q.srv4_file==srv4)
+    return res
+
+  def GetOverrideResult(self, srv4):
+    res = m.CheckpkgOverride.select(
+        m.CheckpkgOverride.q.srv4_file==srv4)
+    return res
+
+  def GenerateHtml(self):
+    pkgstats = []
+    # Add error tags
+    for md5_sum in self.md5_sums:
+      srv4 = GetPkg(md5_sum)
+      data = cPickle.loads(str(srv4.data))
+      if "OPENCSW_REPOSITORY" in data["pkginfo"]:
+        build_src = data["pkginfo"]["OPENCSW_REPOSITORY"]
+        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
+      data["error_tags"] = list(self.GetErrorTagsResult(srv4))
+      data["overrides"] = list(self.GetOverrideResult(srv4))
+      pkgstats.append(data)
+    # This assumes the program is run as "bin/pkgdb", and not "lib/python/pkgdb.py".
+    if not self.template:
+      tmpl_filename = os.path.join(os.path.split(__file__)[0],
+                                   DEFAULT_TEMPLATE_FILENAME)
+    else:
+      tmpl_filename = self.template
+    tmpl_str = open(tmpl_filename, "r").read()
+    t = Template(tmpl_str, searchList=[{
+      "pkgstats": pkgstats,
+      "hachoir_machines": package_checks.HACHOIR_MACHINES,
+      }])
+    return unicode(t)
+
+
 def GetPkg(some_id):
   logging.debug("Selecting from db: %s", repr(some_id))
   res = m.Srv4FileStats.select(
@@ -99,41 +154,8 @@
       t = Template(SHOW_PKG_TMPL, searchList=[srv4])
       sys.stdout.write(unicode(t))
   if command == 'gen-html':
-    pkgstats = []
-    # Add error tags
-    for md5_sum in md5_sums:
-      srv4 = GetPkg(md5_sum)
-      data = cPickle.loads(str(srv4.data))
-      if "OPENCSW_REPOSITORY" in data["pkginfo"]:
-        build_src = data["pkginfo"]["OPENCSW_REPOSITORY"]
-        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:
-      tmpl_filename = os.path.join(os.path.split(__file__)[0],
-                                   "..",
-                                   "lib",
-                                   "python",
-                                   "pkg-review-template.html")
-    else:
-      tmpl_filename = options.pkg_review_template
-    tmpl_str = open(tmpl_filename, "r").read()
-    t = Template(tmpl_str, searchList=[{
-      "pkgstats": pkgstats,
-      "hachoir_machines": package_checks.HACHOIR_MACHINES,
-      }])
-    sys.stdout.write(unicode(t))
+    g = HtmlGenerator(md5_sums, options.pkg_review_template)
+    sys.stdout.write(g.GenerateHtml())
 
 
 if __name__ == '__main__':


Property changes on: csw/mgar/gar/v2-fortran/pkglib/csw/depend
___________________________________________________________________
Modified: svn:mergeinfo
   - /csw/mgar/gar/v2/pkglib/csw/depend:4936-6678
/csw/mgar/gar/v2-bwalton/pkglib/csw/depend:9784-10011
/csw/mgar/gar/v2-checkpkg/pkglib/csw/depend:7722-7855
/csw/mgar/gar/v2-checkpkg-override-relocation/pkglib/csw/depend:10585-10737
/csw/mgar/gar/v2-checkpkg-stats/pkglib/csw/depend:8454-8649
/csw/mgar/gar/v2-collapsed-modulations/pkglib/csw/depend:6895
/csw/mgar/gar/v2-dirpackage/pkglib/csw/depend:8125-8180
/csw/mgar/gar/v2-skayser/pkglib/csw/depend:6087-6132
/csw/mgar/gar/v2-sqlite/pkglib/csw/depend:10434-10449
   + /csw/mgar/gar/v2/pkglib/csw/depend:4936-6678,10928-10988
/csw/mgar/gar/v2-bwalton/pkglib/csw/depend:9784-10011
/csw/mgar/gar/v2-checkpkg/pkglib/csw/depend:7722-7855
/csw/mgar/gar/v2-checkpkg-override-relocation/pkglib/csw/depend:10585-10737
/csw/mgar/gar/v2-checkpkg-stats/pkglib/csw/depend:8454-8649
/csw/mgar/gar/v2-collapsed-modulations/pkglib/csw/depend:6895
/csw/mgar/gar/v2-dirpackage/pkglib/csw/depend:8125-8180
/csw/mgar/gar/v2-skayser/pkglib/csw/depend:6087-6132
/csw/mgar/gar/v2-sqlite/pkglib/csw/depend:10434-10449


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