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

chninkel at users.sourceforge.net chninkel at users.sourceforge.net
Fri Jan 4 22:04:12 CET 2013


Revision: 20028
          http://gar.svn.sourceforge.net/gar/?rev=20028&view=rev
Author:   chninkel
Date:     2013-01-04 21:04:12 +0000 (Fri, 04 Jan 2013)
Log Message:
-----------
gar/v2: reverted unwanted changes in last commit

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/map.solaris10u8
    csw/mgar/gar/v2/lib/python/csw_upload_pkg.py
    csw/mgar/gar/v2/lib/python/pkgdb.py

Modified: csw/mgar/gar/v2/lib/map.solaris10u8
===================================================================
--- csw/mgar/gar/v2/lib/map.solaris10u8	2013-01-04 19:40:05 UTC (rev 20027)
+++ csw/mgar/gar/v2/lib/map.solaris10u8	2013-01-04 21:04:12 UTC (rev 20028)
@@ -2,6 +2,6 @@
 #   http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libc/port/mapfile-vers#301
 libc.so - SUNW_1.22.5 SUNWprivate_1.1 $ADDVERS=SUNW_1.22.5;
 #  http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libresolv2/common/mapfile-vers
-libresolv.so - SUNW_2.2.1 SUNWprivate_2.1 $ADDVERS=SUNW_2.2.1;
+libresolv.so - SUNW_2.2 SUNWprivate_2.1 $ADDVERS=SUNW_2.2;
 # http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libnsl/common/mapfile-vers
 libnsl.so - SUNW_1.9.1 SUNWprivate_1.5 $ADDVERS=SUNW_1.9.1;

Modified: csw/mgar/gar/v2/lib/python/csw_upload_pkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/csw_upload_pkg.py	2013-01-04 19:40:05 UTC (rev 20027)
+++ csw/mgar/gar/v2/lib/python/csw_upload_pkg.py	2013-01-04 21:04:12 UTC (rev 20028)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.6
+#!/opt/csw/bin/python2.6
 
 """csw_upload_pkg.py - uploads packages to the database.
 
@@ -55,15 +55,6 @@
 
   {{dublin,unstable,kiel,bratislava}}x{{sparc,i386}}x{{5.8,5.9.5.10,5.11}}
 
-= Removing packages from the catalog =
-
-The --remove option works the same way as the regular use, except that it
-removes assignments of a given package to catalogs, instead of adding them.
-
-When removing packages from catalogs, files on disk are passed as arguments.
-On the buildfarm, all files are available under the /home/mirror/opencsw
-directory.
-
 For more information, see:
 http://wiki.opencsw.org/automated-release-process#toc0
 """
@@ -186,7 +177,7 @@
         planned_modifications.append(
             (filename, md5_sum,
              arch, osrel, cat_arch, cat_osrel))
-    # The plan: 
+    # The plan:
     # - Create groups of files to be inserted into each of the catalogs
     # - Invoke checkpkg to check every target catalog
     checkpkg_sets = self._CheckpkgSets(planned_modifications)
@@ -199,66 +190,6 @@
           file_metadata = metadata_by_md5[md5_sum]
           self._InsertIntoCatalog(filename, arch, osrel, file_metadata)
 
-  def Remove(self):
-    for filename in self.filenames:
-      self._RemoveFile(filename)
-
-  def _RemoveFile(self, filename):
-    md5_sum = self._GetFileMd5sum(filename)
-    file_in_allpkgs, file_metadata = self._GetSrv4FileMetadata(md5_sum)
-    if not file_metadata:
-      logging.warning("Could not find metadata for file %s", repr(filename))
-      return
-    osrel = file_metadata['osrel']
-    arch = file_metadata['arch']
-    catalogs = self._MatchSrv4ToCatalogs(
-        filename, DEFAULT_CATREL, arch, osrel, md5_sum)
-    for unused_catrel, cat_arch, cat_osrel in sorted(catalogs):
-      self._RemoveFromCatalog(filename, cat_arch, cat_osrel, file_metadata)
-
-  def _RemoveFromCatalog(self, filename, arch, osrel, file_metadata):
-    print("Removing %s (%s %s) from catalog %s %s %s"
-          % (file_metadata["catalogname"],
-             file_metadata["arch"],
-             file_metadata["osrel"],
-             DEFAULT_CATREL, arch, osrel))
-    md5_sum = self._GetFileMd5sum(filename)
-    basename = os.path.basename(filename)
-    parsed_basename = opencsw.ParsePackageFileName(basename)
-    # TODO: Move this bit to a separate class (RestClient)
-    url = (
-        "%s%s/catalogs/%s/%s/%s/%s/"
-        % (self.rest_url,
-           RELEASES_APP,
-           DEFAULT_CATREL,
-           arch,
-           osrel,
-           md5_sum))
-    logging.debug("DELETE @ URL: %s %s", type(url), url)
-    c = pycurl.Curl()
-    d = StringIO()
-    h = StringIO()
-    c.setopt(pycurl.URL, str(url))
-    c.setopt(pycurl.CUSTOMREQUEST, "DELETE")
-    c.setopt(pycurl.WRITEFUNCTION, d.write)
-    c.setopt(pycurl.HEADERFUNCTION, h.write)
-    c.setopt(pycurl.HTTPHEADER, ["Expect:"]) # Fixes the HTTP 417 error
-    c = self._SetAuth(c)
-    if self.debug:
-      c.setopt(c.VERBOSE, 1)
-    c.perform()
-    http_code = c.getinfo(pycurl.HTTP_CODE)
-    logging.debug(
-        "DELETE curl getinfo: %s %s %s",
-        type(http_code),
-        http_code,
-        c.getinfo(pycurl.EFFECTIVE_URL))
-    c.close()
-    if not (http_code >= 200 and http_code <= 299):
-      raise RestCommunicationError(
-          "%s - HTTP code: %s, content: %s"
-          % (url, http_code, d.getvalue()))
-
   def _GetFileMd5sum(self, filename):
     if filename not in self.md5_by_filename:
       logging.debug("_GetFileMd5sum(%s): Reading the file", filename)
@@ -522,10 +453,6 @@
   parser.add_option("-d", "--debug",
       dest="debug",
       default=False, action="store_true")
-  parser.add_option("--remove",
-      dest="remove",
-      default=False, action="store_true",
-      help="Remove packages from catalogs instead of adding them")
   parser.add_option("--os-release",
       dest="os_release",
       help="If specified, only uploads to the specified OS release. "
@@ -586,7 +513,4 @@
                           username=username,
                           password=password,
                           catrel=options.catrel)
-  if options.remove:
-    uploader.Remove()
-  else:
-    uploader.Upload()
+  uploader.Upload()

Modified: csw/mgar/gar/v2/lib/python/pkgdb.py
===================================================================
--- csw/mgar/gar/v2/lib/python/pkgdb.py	2013-01-04 19:40:05 UTC (rev 20027)
+++ csw/mgar/gar/v2/lib/python/pkgdb.py	2013-01-04 21:04:12 UTC (rev 20028)
@@ -84,7 +84,7 @@
   "bratislava",
 ])
 CATALOGS_ALLOWED_TO_BE_IMPORTED = frozenset([
-  "unstable",
+  "current",
 ])
 
 

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