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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Thu Apr 18 17:17:34 CEST 2013


Revision: 20797
          http://gar.svn.sourceforge.net/gar/?rev=20797&view=rev
Author:   wahwah
Date:     2013-04-18 15:17:33 +0000 (Thu, 18 Apr 2013)
Log Message:
-----------
pkgdb: Throw away the unused PackageSurgeon class

Will will not be doing surgery on existing packages.

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

Added Paths:
-----------
    csw/mgar/gar/v2/lib/web/__init__.py

Modified: csw/mgar/gar/v2/lib/python/package.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package.py	2013-04-18 15:17:17 UTC (rev 20796)
+++ csw/mgar/gar/v2/lib/python/package.py	2013-04-18 15:17:33 UTC (rev 20797)
@@ -451,69 +451,3 @@
       less_proc.wait()
     else:
       print "No differences found."
-
-
-class PackageSurgeon(shell.ShellMixin):
-  """Takes an OpenCSW gzipped package and performs surgery on it.
-
-  Sows it up, adjusts checksums, and puts it back together.
-  """
-
-  def __init__(self, pkg_path, debug):
-    self.debug = debug
-    self.pkg_path = pkg_path
-    self.srv4 = CswSrv4File(pkg_path)
-    self.dir_pkg = None
-    self.exported_dir = None
-    self.parsed_filename = opencsw.ParsePackageFileName(self.pkg_path)
-
-  def Transform(self):
-    if not self.dir_pkg:
-      self.dir_pkg = self.srv4.GetDirFormatPkg()
-      logging.debug(repr(self.dir_pkg))
-
-  def Export(self, dest_dir):
-    self.Transform()
-    if not self.exported_dir:
-      basedir, pkgname = os.path.split(self.dir_pkg.directory)
-      self.exported_dir = os.path.join(dest_dir, pkgname)
-      shutil.copytree(
-          self.dir_pkg.directory,
-          self.exported_dir)
-      subprocess.call(["git", "init"], cwd=self.exported_dir)
-      subprocess.call(["git", "add", "."], cwd=self.exported_dir)
-      subprocess.call(["git", "commit", "-a", "-m", "Initial commit"],
-                      cwd=self.exported_dir)
-    else:
-      logging.warn("The package was already exported to %s",
-                   self.exported_dir)
-
-  def Patch(self, patch_file):
-    self.Transform()
-    args = ["gpatch", "-p", "1", "-d", self.dir_pkg.directory, "-i", patch_file]
-    logging.debug(args)
-    subprocess.call(args)
-
-  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)

Added: csw/mgar/gar/v2/lib/web/__init__.py
===================================================================
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