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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Nov 26 09:50:19 CET 2010


Revision: 11727
          http://gar.svn.sourceforge.net/gar/?rev=11727&view=rev
Author:   wahwah
Date:     2010-11-26 08:50:19 +0000 (Fri, 26 Nov 2010)

Log Message:
-----------
mGAR v2: checkpkg, throwing an error in the presence of .git and/or .CVS files.

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-11-26 08:49:09 UTC (rev 11726)
+++ csw/mgar/gar/v2/lib/python/package_checks.py	2010-11-26 08:50:19 UTC (rev 11727)
@@ -84,6 +84,10 @@
     (r"opt/csw/var($|/)", ("The /opt/csw/var directory is not writable on "
                             "sparse non-global zones.  "
                             "Please use /var/opt/csw instead.")),
+    (r"\.git", ("Git files in most cases shouldn't be included in "
+                "a package.")),
+    (r"\.CVS", ("CVS files in most cases shouldn't be included in "
+                "a package.")),
 )
 RPATH_PARTS = {
     'prefix': r"(?P<prefix>/opt/csw)",

Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py	2010-11-26 08:49:09 UTC (rev 11726)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py	2010-11-26 08:50:19 UTC (rev 11727)
@@ -1142,6 +1142,19 @@
         'discouraged-path-in-pkgmap', '/opt/csw/var')
 
 
+class TestCheckDiscouragedFileNamePatternsGit(CheckpkgUnitTestHelper,
+                                              unittest.TestCase):
+  FUNCTION_NAME = 'CheckDiscouragedFileNamePatterns'
+  def CheckpkgTest(self):
+    # The data need to be copied, because otherwise all other tests will
+    # also process modified data.
+    self.pkg_data = copy.deepcopy(rsync_stats[0])
+    self.pkg_data["pkgmap"].append(
+            { "type": "f", "path": "/opt/csw/share/.git/foo", })
+    self.error_mgr_mock.ReportError(
+            'discouraged-path-in-pkgmap', '/opt/csw/share/.git/foo')
+
+
 class TestSetCheckDirectoryDepsTwoPackages(CheckpkgUnitTestHelper,
                                            unittest.TestCase):
   """Test whether appropriate files are provided.


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