Example #1
0
 def ToSrv4(self, dest_dir):
     self.Transform()
     pkginfo = self.dir_pkg.GetParsedPkginfo()
     date_str = datetime.datetime.now().strftime("%Y.%m.%d")
     self.parsed_filename["revision_info"]["REV"] = date_str
     new_filename = opencsw.ComposePackageFileName(self.parsed_filename)
     # Plan:
     # - Update the version in the pkginfo
     version_string = opencsw.ComposeVersionString(
         self.parsed_filename["version"],
         self.parsed_filename["revision_info"])
     logging.debug("New version string: %s", repr(version_string))
     self.dir_pkg.SetPkginfoEntry("VERSION", version_string)
     # - Update the pkgmap file, setting the checksums
     # - Transform it back to the srv4 form
     target_dir, old_path = os.path.split(self.pkg_path)
     logging.debug("Transforming into %s", new_filename)
     self.dir_pkg.ToSrv4(target_dir, new_filename)
     # - Update the pkgmap file, setting the checksums
     # - Transform it back to the srv4 form
     target_dir, old_path = os.path.split(self.pkg_path)
     logging.debug("Transforming into %s", new_filename)
     self.dir_pkg.ToSrv4(target_dir, new_filename)
Example #2
0
 def testMoreRev(self):
     file_name = 'mysql5client-5.0.87,REV=2010.02.28_foo=bar-SunOS5.8-i386-CSW.pkg'
     self.parsed["revision_info"]["foo"] = "bar"
     self.assertEquals(file_name,
                       opencsw.ComposePackageFileName(self.parsed))
Example #3
0
 def testSimple(self):
     file_name = 'mysql5client-5.0.87,REV=2010.02.28-SunOS5.8-i386-CSW.pkg'
     self.assertEquals(file_name,
                       opencsw.ComposePackageFileName(self.parsed))