Anonymous committed 8273dee

Backing out changes to config

Comments (0)

Files changed (3)


 from import Bot
 from updatebot.current import Bot as CurrentBot
+from updatebot.native import Bot as NativeBot
 from updatebot.config import UpdateBotConfig


-# Copyright (c) 2008-2010 rPath, Inc.
+# Copyright (c) SAS Institute, Inc.
-# This program is distributed under the terms of the Common Public License,
-# version 1.0. A copy of this license should have been distributed with this
-# source file in a file called LICENSE. If it is not present, the license
-# is always available at
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
-# This program is distributed in the hope that it will be useful, but
-# without any warranty; without even the implied warranty of merchantability
-# or fitness for a particular purpose. See the Common Public License for
-# full details.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# See the License for the specific language governing permissions and
+# limitations under the License.
 Configuration module for updatebot.
     _defaultSectionType = UpdateBotConfigSection
-    def __init__(self):
-        cfg.SectionedConfigFile.__init__(self)
-        for info in self._defaultSectionType._getConfigOptions():
-            if info[0] not in self:
-                self.addConfigOption(*info)
+    _cfg_bases = [ UpdateBotConfigSection ]
     def read(self, *args, **kwargs):


                     removePackages.setdefault(pkg, []).append(pkgs)
         # Don't taint group model unless something has actually changed.
         if addPackages or removePackages:
   'modifying group model')
     def _useOldVersions(self, updateId, pkgMap):
         # When deriving from an upstream platform sometimes we don't want
         # the latest versions.
-        # oldVersions = self._cfg.useOldVersion.get(updateId, None)
+        #oldVersions = self._cfg.useOldVersion.get(updateId, None)
         # Since we want this to expire in the new mode useOldVersion timestamp 
         # Should be in the future. This way an old version will not remain 
         # pinned forever. If group breaks move the useOldVersion into the 
             itertools.chain(*self._cfg.ignoreSourceUpdate.values()) ])
         # Iterate over all of the available source rpms to find any versions
         # that have not been imported into the conary repository.
         toUpdate = set()
         toUpdateMap = {}
         for binPkg, srcPkg in self._pkgSource.binPkgMap.iteritems():
             # Skip updating pkg if explicitly ignored
             if srcPkg.getNevra() in explicitIgnoreSources:
                 log.warn('explicitly ignoring %s in %s' % (binPkg, srcPkg))
                 rem = toAdd.pop(newPkgs[name])
                 removedPkgs.append((name, rem))
-        # Need to use specific older versions 
-        # because Red Hat are ass monkeys and 
-        # Broke the crap out of the dependencies for some rpms
-        oldVersions = [ x for x in self._cfg.useOldVersion.items()
-                                if x >= self._updateId ]
-        versionExceptions = self._getOldVersionExceptions(self._updateId)
-        for name, pkg in newPkgs.iteritems():
-            if name in versionExceptions:
-                # look in the group for the specified version
-                # if exists pass
-                # if not add it to group
-                #rem = toAdd.pop(newPkgs[name])
-                # add newer version to remove
-                #removedPkgs.append((name, rem))
-                #for n2, v2, f2 in nvfs:
-                #    toAdd.setdefault((n2, v2), set()).add(f2)
-                pass
         # Remove any packages that were flagged for removal.
                 toRemove.add((name, version, flavor))
                 n2, v2, f2 = nevra
                 toProd.setdefault((n2, v2), set()).add(f2)
         # Remove any packages that were flagged for removal.
         for n, v, f in toRemove:
   'removing %s[%s]' % (n, f))
             group.removePackage(n, flavor=f)