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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri May 28 16:36:46 CEST 2010


Revision: 10030
          http://gar.svn.sourceforge.net/gar/?rev=10030&view=rev
Author:   wahwah
Date:     2010-05-28 14:36:46 +0000 (Fri, 28 May 2010)

Log Message:
-----------
mGAR v2: Devel packages shouldn't be ARCHALL = 1

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	2010-05-28 04:32:35 UTC (rev 10029)
+++ csw/mgar/gar/v2/lib/python/package_checks.py	2010-05-28 14:36:46 UTC (rev 10030)
@@ -48,6 +48,10 @@
 MAX_PKGNAME_LENGTH = 20
 ARCH_LIST = ["sparc", "i386", "all"]
 VERSION_RE = r".*,REV=(20[01][0-9]\.[0-9][0-9]\.[0-9][0-9]).*"
+# Pkgnames matching these regexes must not be ARCHALL = 1
+ARCH_SPECIFIC_PKGNAMES_RE_LIST = [
+    re.compile(r".*dev(el)?$"),
+]
 
 # At some point, it was used to prevent people from linking against
 # libX11.so.4, but due to issues with 3D acceleration.
@@ -361,6 +365,10 @@
         "archall-with-binaries",
         binary,
         "package contains binary %s" % binary))
+  for pkgname_re in ARCH_SPECIFIC_PKGNAMES_RE_LIST:
+    if pkgname_re.match(pkgname):
+      reasons_to_be_arch_specific.append((
+          "archall-devel-package", None, None))
   if arch == "all":
     for tag, param, desc in reasons_to_be_arch_specific:
       error_mgr.ReportError(tag, param, desc)

Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py	2010-05-28 04:32:35 UTC (rev 10029)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py	2010-05-28 14:36:46 UTC (rev 10030)
@@ -223,17 +223,26 @@
         'srv4-filename-architecture-mismatch',
         'pkginfo=i386 filename=rsync-3.0.7,REV=2010.02.17-SunOS5.8-sparc-CSW.pkg.gz')
 
-class TestCheckArchitectureVsContents(CheckpkgUnitTestHelper, unittest.TestCase):
+class TestCheckArchitectureVsContents_Devel_1(CheckpkgUnitTestHelper, unittest.TestCase):
   FUNCTION_NAME = 'CheckArchitectureVsContents'
   def CheckpkgTest(self):
-    # TODO: Update this.
-    # self.pkg_data["pkgmap"] = self.LoadData("example-1-pkgmap")
-    # self.pkg_data["binaries"] = []
-    # self.pkg_data["pkginfo"] = self.LoadData("example-1-pkginfo")
-    # errors = pc.CheckArchitectureVsContents(self.pkg_data_2, False)
-    # self.failIf(errors)
-    pass
+    self.pkg_data["binaries"] = []
+    self.pkg_data["binaries_dump_info"] = []
+    self.pkg_data["pkgmap"] = []
+    self.pkg_data["basic_stats"]["pkgname"] = "CSWfoo_devel"
+    self.pkg_data["pkginfo"]["ARCH"] = "all"
+    self.error_mgr_mock.ReportError('archall-devel-package', None, None)
 
+class TestCheckArchitectureVsContents_Devel_2(CheckpkgUnitTestHelper, unittest.TestCase):
+  FUNCTION_NAME = 'CheckArchitectureVsContents'
+  def CheckpkgTest(self):
+    self.pkg_data["binaries"] = []
+    self.pkg_data["binaries_dump_info"] = []
+    self.pkg_data["pkgmap"] = []
+    self.pkg_data["basic_stats"]["pkgname"] = "CSWfoodev"
+    self.pkg_data["pkginfo"]["ARCH"] = "all"
+    self.error_mgr_mock.ReportError('archall-devel-package', None, None)
+
 class TestCheckFileNameSanity(CheckpkgUnitTestHelper, unittest.TestCase):
   FUNCTION_NAME = 'CheckFileNameSanity'
   def CheckpkgTest(self):


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