Anonymous avatar Anonymous committed 0a0a1c8

Adding addSource function to getUpdatePackages

Comments (0)

Files changed (2)

updatebot/build/dispatcher.py

                 # It might take a few iterations through the loop for the
                 # result to show up.
                 if not result:
+                    log.info('No results state is %s' % str(state))
                     continue
 
                 # Make result hashable
         toRemove = set()
         for jobId, startTime in self._status.iteritems():
             if time.time() - startTime > (60 * 20):
+                log.info('JobId ID: %s' % jobId)
                 #log.info('Completely silly promote times have been reached')
                 if time.time() - startTime > (60 * 40):
-                    log.info('Ok ludicrous promote times reached...time to debug')
-                    #import epdb; epdb.st()
+                    log.info('Ok ludicrous promote times reached %s' % jobId)
+                    log.warn('JobId info: %s' % str(self._jobs[jobId]))
+                    for job in self._jobs:
+                        if self._jobs[job][1] != -11:
+                            log.warn('Waiting on job status for  %s : %s ' % 
+                                        (job,self._jobs[job][1])) 
+                            if time.time() - startTime > (60 * 80):
+                                import epdb; epdb.st()
                     #if self._jobs[jobId][1] == -11 and jobId not in toRemove:
                         #toRemove.add(jobId)
         for jobId in toRemove:

updatebot/current.py

         explicitIgnoreSources = set([ x for x in 
             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.setdefault(srcPkg, set()).add(binPkg)
                 toUpdate.add(srcPkg)
 
+        # add a source to a specific bucket, used to "promote" newer versions
+        # forward.
+        nevras = dict([ (x.getNevra(), x)
+                         for x in self._pkgSource.srcPkgMap ])
+
+        for srcNevras in self._cfg.addSource[self._updateId]:
+            sources = set(nevras[x] for x in srcNevras)
+            for sPkg in sources:
+                if sPkg in self._pkgSource.srcPkgMap:
+                    for bPkg in self._pkgSource.srcPkgMap[sPkg]:
+                        if bPkg.arch == 'src':
+                            continue
+                        toUpdateMap.setdefault(sPkg, set()).add(bPkg)
+                        toUpdate.add(sPkg)
+                else:
+                    log.warn('addSource failed for %s' % str(sPkg))
+
         import epdb;epdb.st()
 
         return UpdateSet(toUpdate)
                 # remove it.
                 if nevra is None and not [ x for x in nevraMap
                     if x[0] == n and x[2] == f ]:
-                    log.warn('%s %s isnt actually attached to a nevra' % (n,f))
+                    #log.warn('%s %s isnt actually attached to a nevra' % (n,f))
                     toRemove.add((n, v, f))
                     continue
 
                 if not nevra and (name,version,flavor) in clonedFromMap.values():
                     continue
 
+                # Another hack for rhel 5 client workstation
+                if self._cfg.topParentSourceGroup != self._cfg.topSourceGroup:
+                    parent = True
+
+                if not nevra and parent:
+                    log.warn('Child platform')
+                    for original, clone in clonedFromMap.iteritems(): 
+                        if (name == original[0] and 
+                            version.trailingRevision() == original[1].trailingRevision() 
+                            and flavor == original[2]):
+                            log.warn('adding %s' % str(clone))
+                            n2, v2, f2 = clone
+                            toProd.setdefault((n2, v2), set()).add(f2)
+                            toRemove.add((name, version, flavor))
+                            break
+                    continue
+
                 # Feels like a hack for RHEL4AS... might revisit this later
                 if not flavor.thaw():
-                    log.warn('No flavor for %s %s %s removing from group' % (name, version, flavor))
+                    log.warn('No flavor for %s %s %s' % (name, version, flavor))
+                    for original, clone in clonedFromMap.iteritems(): 
+                        if original[0] == name and original[1] == version:
+                            n2, v2, f2 = clone
+                            toProd.setdefault((n2, v2), set()).add(f2)
                     toRemove.add((name, version, flavor))
                     continue
 
         self._updateId = updateId
         log.info('UpdateID is %s' % self._updateId)
         # Figure out what packages still need to be promoted.
-        #promotePkgs = self._getPromotePackages()
+        promotePkgs = self._getPromotePackages()
 
         # Go ahead and promote any packages that didn't get promoted during the
         # last run or have been rebuilt since then.
-        #if promotePkgs:
-        #    log.info('found %s packages that need to be promoted' %
-        #        len(promotePkgs))
-        #    self._updater.publish(promotePkgs, promotePkgs, self._cfg.targetLabel)
+        if promotePkgs:
+            log.info('found %s packages that need to be promoted' %
+                len(promotePkgs))
+            self._updater.publish(promotePkgs, promotePkgs, self._cfg.targetLabel)
 
         # Find and add new packages
         self._addNewPackages(group)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.