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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Tue Jul 30 00:32:16 CEST 2013


Revision: 21577
          http://gar.svn.sourceforge.net/gar/?rev=21577&view=rev
Author:   wahwah
Date:     2013-07-29 22:32:16 +0000 (Mon, 29 Jul 2013)
Log Message:
-----------
checkpkg: Require a specific Python version

A package containing files for a specific Python version must depend on that
version.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/dependency_checks.py
    csw/mgar/gar/v2/lib/python/dependency_checks_test.py

Modified: csw/mgar/gar/v2/lib/python/dependency_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/dependency_checks.py	2013-07-29 21:38:52 UTC (rev 21576)
+++ csw/mgar/gar/v2/lib/python/dependency_checks.py	2013-07-29 22:32:16 UTC (rev 21577)
@@ -31,7 +31,12 @@
 DEPENDENCY_FILENAME_REGEXES = (
     (r".*\.pl$",   (u"CSWperl",)),
     (r".*\.pm$",   (u"CSWperl",)),
-    (r".*\.py$",   (u"CSWpython",)),
+    (r"/?opt/csw/lib/python(2\.6)?/site-packages/.+\.py$",
+                   (u"CSWpython",)),
+    (r"/?opt/csw/lib/python2\.7/site-packages/.+\.py$",
+                   (u"CSWpython27",)),
+    (r"/?opt/csw/lib/python3\.3/site-packages/.+\.py$",
+                   (u"CSWpython33",)),
     (r".*\.rb$",   (u"CSWruby", u"CSWruby18", u"CSWruby191", u"CSWlibruby1-9-1-1")),
     (r".*\.elc?$", (u"CSWemacs-common",)),
     (r"/opt/csw/apache2/", (u"CSWapache2",)),

Modified: csw/mgar/gar/v2/lib/python/dependency_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/dependency_checks_test.py	2013-07-29 21:38:52 UTC (rev 21576)
+++ csw/mgar/gar/v2/lib/python/dependency_checks_test.py	2013-07-29 22:32:16 UTC (rev 21577)
@@ -217,7 +217,7 @@
     pass
 
   def testByFilename(self):
-    self.pkg_data = tree_stats[0]
+    self.pkg_data = copy.deepcopy(tree_stats[0])
     self.pkg_data["pkgmap"] = [
         {'class': 'none',
          'line': 'not important',
@@ -237,6 +237,42 @@
         None, None)
     self.mox.VerifyAll()
 
+  def testByFilenamePython(self):
+    self.pkg_data = copy.deepcopy(tree_stats[0])
+    self.pkg_data["pkgmap"] = [
+        {'class': 'none', 'line': 'not important', 'mode': '0755',
+         'path': '/opt/csw/lib/python/site-packages/foo.py',
+         'type': 'f', 'group': 'bin', 'user': 'root'}]
+    self.error_mgr_mock.NeedPackage('CSWtree', u'CSWpython',
+        "found file(s) matching /?opt/csw/lib/python(2\\.6)?/site-packages/.+\\.py$, "
+        "e.g. '/opt/csw/lib/python/site-packages/foo.py'")
+    self.mox.ReplayAll()
+    result = dependency_checks.ByFilename(
+        self.pkg_data,
+        self.error_mgr_mock,
+        self.logger_stub,
+        self.messenger_stub,
+        None, None)
+    self.mox.VerifyAll()
+
+  def testByFilenamePython27(self):
+    self.pkg_data = copy.deepcopy(tree_stats[0])
+    self.pkg_data["pkgmap"] = [
+        {'class': 'none', 'line': 'not important', 'mode': '0755',
+         'path': '/opt/csw/lib/python2.7/site-packages/foo.py',
+         'type': 'f', 'group': 'bin', 'user': 'root'}]
+    self.error_mgr_mock.NeedPackage('CSWtree', u'CSWpython27',
+        "found file(s) matching /?opt/csw/lib/python2\\.7/site-packages/.+\\.py$, "
+        "e.g. '/opt/csw/lib/python2.7/site-packages/foo.py'")
+    self.mox.ReplayAll()
+    result = dependency_checks.ByFilename(
+        self.pkg_data,
+        self.error_mgr_mock,
+        self.logger_stub,
+        self.messenger_stub,
+        None, None)
+    self.mox.VerifyAll()
+
   def testLibraries_1(self):
     self.pkg_data = copy.deepcopy(tree_stats[0])
     path_and_pkg_by_basename = {

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