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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri May 20 09:46:37 CEST 2011


Revision: 14626
          http://gar.svn.sourceforge.net/gar/?rev=14626&view=rev
Author:   wahwah
Date:     2011-05-20 07:46:37 +0000 (Fri, 20 May 2011)

Log Message:
-----------
checkpkg: A check for OPENCSW_REPOSITORY

A check that OPENCSW_REPOSITORY is in pkginfo, and that it does not
contain the "uncommitted" tag.

Original discussion:
  http://lists.opencsw.org/pipermail/pkgsubmissions/2011-May/002883.html

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/package_checks.py
    csw/mgar/gar/v2/lib/python/package_checks_test.py

Modified: csw/mgar/gar/v2/lib/python/package_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks.py	2011-05-19 22:24:57 UTC (rev 14625)
+++ csw/mgar/gar/v2/lib/python/package_checks.py	2011-05-20 07:46:37 UTC (rev 14626)
@@ -1272,3 +1272,14 @@
 def CheckLinkableSoFileMustBeAsymlink(
     pkg_data, error_mgr, logger, messenger):
   pass
+
+
+def CheckPkginfoOpencswRepository(
+    pkg_data, error_mgr, logger, messenger):
+  repotag = "OPENCSW_REPOSITORY"
+  pkginfo = pkg_data["pkginfo"]
+  if repotag not in pkginfo:
+    error_mgr.ReportError("pkginfo-opencsw-repository-missing")
+    return
+  if "UNCOMMITTED" in pkginfo[repotag]:
+    error_mgr.ReportError("pkginfo-opencsw-repository-uncommitted")

Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py	2011-05-19 22:24:57 UTC (rev 14625)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py	2011-05-20 07:46:37 UTC (rev 14626)
@@ -1715,5 +1715,25 @@
     self.RunCheckpkgTest(self.CheckpkgTest2)
 
 
+class TestCheckCatalognameMatchesPkgname(CheckpkgUnitTestHelper,
+                                         unittest.TestCase):
+  FUNCTION_NAME = 'CheckPkginfoOpencswRepository'
+
+  def CheckpkgTest(self):
+    self.pkg_data = copy.deepcopy(tree_stats[0])
+    del self.pkg_data["pkginfo"]["OPENCSW_REPOSITORY"]
+    self.error_mgr_mock.ReportError('pkginfo-opencsw-repository-missing')
+
+  def CheckpkgTest2(self):
+    self.pkg_data = copy.deepcopy(tree_stats[0])
+    self.pkg_data["pkginfo"]["OPENCSW_REPOSITORY"] = (
+        "https://gar.svn.sourceforge.net/svnroot/gar/"
+        "csw/mgar/pkg/puppet/trunk at UNCOMMITTED")
+    self.error_mgr_mock.ReportError('pkginfo-opencsw-repository-uncommitted')
+
+  def testTwo(self):
+    self.RunCheckpkgTest(self.CheckpkgTest2)
+
+
 if __name__ == '__main__':
   unittest.main()


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