rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
def addTrove(self, troveTup, explicit, byDefault, components):
def addTrove(self, troveTup, explicit, byDefault, components, childDefaults=None):
def addTrove(self, troveTup, explicit, byDefault, components): assert(isinstance(byDefault, bool))
(oldExplicit, oldByDefault, oldComponents) = self.troves[troveTup]
(oldExplicit, oldByDefault, oldComponents, oldChildDefaults) = self.troves[troveTup]
def addTrove(self, troveTup, explicit, byDefault, components): assert(isinstance(byDefault, bool))
self.troves[troveTup] = (explicit, byDefault, components)
childDefaults = oldChildDefaults + childDefaults self.troves[troveTup] = (explicit, byDefault, components, childDefaults)
def addTrove(self, troveTup, explicit, byDefault, components): assert(isinstance(byDefault, bool))
(explicit, byDefault, comps) = self.troves[name, version, flavor]
(explicit, byDefault, comps, childByDefaults) \ = self.troves[name, version, flavor]
def delTrove(self, name, version, flavor): (explicit, byDefault, comps) = self.troves[name, version, flavor] if explicit: del self.troves[name, version, flavor] else: self.troves[name, version, flavor] = (False, False, comps)
self.troves[name, version, flavor] = (False, False, comps)
self.troves[name, version, flavor] = (False, False, comps, childByDefaults)
def delTrove(self, name, version, flavor): (explicit, byDefault, comps) = self.troves[name, version, flavor] if explicit: del self.troves[name, version, flavor] else: self.troves[name, version, flavor] = (False, False, comps)
for troveTup, (explicit, byDefault, comps) in self.troves.iteritems():
for troveTup, (explicit, byDefault, comps, childByDefaults) in self.troves.iteritems():
def iterTroveList(self, strongRefs=False, weakRefs=False): if not (strongRefs or weakRefs): strongRefs = weakRefs = True
for troveTup, (explicit, byDefault, comps) in self.troves.iteritems():
for troveTup, (explicit, byDefault, comps, childByDefaults) in self.troves.iteritems():
def iterTroveListInfo(self): for troveTup, (explicit, byDefault, comps) in self.troves.iteritems(): yield troveTup, explicit, byDefault, comps
for troveTup, (explicit, byDefault, comps) in self.troves.iteritems():
for troveTup, (explicit, byDefault, comps, childByDefaults) \ in self.troves.iteritems():
def iterDefaultTroveList(self): for troveTup, (explicit, byDefault, comps) in self.troves.iteritems(): if byDefault: yield troveTup
if childGroup.name in groupsWithConflicts:
if byDefault and childGroup.name in groupsWithConflicts:
def _sortGroups(groupList): """ Sorts groupList so that if group a includes group b, group b is before a in the returned list. Also checks for cyclic group inclusion. """ g = graph.DirectedGraph()
explicit = True)
explicit = True, childDefaults = trv)
def processOneAddAllDirective(parentGroup, troveTup, recurse, recipeObj, cache, repos): topTrove = repos.getTrove(withFiles=False, *troveTup) if recurse: groupTups = [ x for x in topTrove.iterTroveList(strongRefs=True, weakRefs=True) \ if x[0].startswith('group-') ] trvs = repos.getTroves(groupTups, withFiles=False) ...
parentGroup.addTrove(troveTup, True, byDefault, [])
parentGroup.addTrove(troveTup, True, byDefault, [], childDefaults=trv)
def processOneAddAllDirective(parentGroup, troveTup, recurse, recipeObj, cache, repos): topTrove = repos.getTrove(withFiles=False, *troveTup) if recurse: groupTups = [ x for x in topTrove.iterTroveList(strongRefs=True, weakRefs=True) \ if x[0].startswith('group-') ] trvs = repos.getTroves(groupTups, withFiles=False) ...
childChildByDefault = childByDefault and childChildByDefault
addAllByDefault = group.checkAddAllForByDefault(childGroup.name, troveTup) if addAllByDefault is not None: childChildByDefault = addAllByDefault else: childChildByDefault = childByDefault and childChildByDefault
def _componentMatches(troveName, compList): return ':' in troveName and troveName.split(':', 1)[1] in compList
if migrate or syncChildren:
if migrate:
def updateAll(cfg, info = False, depCheck = True, replaceFiles = False, test = False, showItems = False, checkPathConflicts = True, migrate = False): client = conaryclient.ConaryClient(cfg) updateItems = client.fullUpdateItemList() applyList = [ (x[0], (None, None), x[1:], True) for x in updateItems ] if showItems: ...
if migrate: removeNotByDefault = True else:
def updateAll(cfg, info = False, depCheck = True, replaceFiles = False, test = False, showItems = False, checkPathConflicts = True, migrate = False): client = conaryclient.ConaryClient(cfg) updateItems = client.fullUpdateItemList() applyList = [ (x[0], (None, None), x[1:], True) for x in updateItems ] if showItems: ...
def findTrove(repos, defaultLabel, name, flavor, versionStr = None): """ Looks up a package in the given repository based on the name and
def findTrove(self, defaultLabel, name, flavor, versionStr = None): """ Looks up a trove in the repository based on the name and
def findTrove(repos, defaultLabel, name, flavor, versionStr = None):
@param name: Package name
@param name: Trove name
def findTrove(repos, defaultLabel, name, flavor, versionStr = None):
@param versionStr: Package version
@param versionStr: Trove version
def findTrove(repos, defaultLabel, name, flavor, versionStr = None):
@rtype: list of package.Package
@rtype: list of package.Trove
def findTrove(repos, defaultLabel, name, flavor, versionStr = None):
"illegal relative interpreter path %s in %s" %(interp, path))
"illegal relative interpreter path %s in %s (%s)" %(interp, path, m.contents['line']))
def doFile(self, path):
macros.update({'m4DirArgs': '-I %s' %(self.m4Dir)})
macros.m4DirArgs = '-I %s' %(self.m4Dir) else: macros.m4DirArgs = ''
def do(self, macros):
macros['mkObjdir'] = 'mkdir -p %s; cd %s;' %(objDir, objDir) macros['configure'] = '../%s' % self.configureName
macros.mkObjdir = 'mkdir -p %s; cd %s;' %(objDir, objDir) macros.configure = '../%s' % self.configureName
def do(self, macros):
macros['mkObjdir'] = '' macros['configure'] = './%s' % self.configureName
macros.mkObjdir = '' macros.configure = './%s' % self.configureName
def do(self, macros):
macros['subDir'] = self.subDir else: macros['subDir'] = ''
macros.subDir = self.subDir else: macros.subDir = ''
def do(self, macros):
Use.builddocs.setLongDoc("""
Use.buildtests.setLongDoc("""
def _addDocs(obj): global __doc__ if __doc__ is None: return keys = obj.keys() keys.sort() _addShortDoc(obj, obj, keys) __doc__ += '\n\nMore details:\n\n' _addLongDoc(obj, obj, keys)
value = True
value = newValue
def optParamCallback(option, opt_str, value, parser, *args, **kw): value = True if option.had_explicit_value: newValue = parser.rargs[0] del parser.rargs[0] if newValue: # handle --opt= - treat like --opt value = True setattr(parser.values, option.dest, value)
otherState = nodeList[idx][3]
otherState = nodeList[idx][1]
def _findErasures(primaryErases, newJob, referencedTroves, recurse): # each node is a ((name, version, flavor), state, edgeList # fromUpdate) # state is ERASE, KEEP, or UNKNOWN # fromUpdate is True if erasing this node was suggested by # a trvCs in the newJob (an update, not an erase). We need # to track this t...
size = f.seek(0, SEEK_END) f.seek(pos, SEEK_SET)
size = self.f.seek(0, SEEK_END) self.f.seek(pos, SEEK_SET) return size
def size(self):
self.read("/etc/srsrc")
def __init__(self):
_TROVE_FLAG_ISCOLLECTION = 0
_TROVE_FLAG_ISCOLLECTION = 1 << 0
def freeze(self, skipSet = {}): if not self.sha1(): return ""
return ' '.join(label, fingerprint)
return ' '.join(val)
def format(self, val, displayOptions=None): return ' '.join(label, fingerprint)
local_scope[name] = mod
if name.__class__.__name__ == 'ModuleProxy': local_scope[name] = mod
def _loadModule(): """ Load the given module, and insert it into the parent scope, and also the original importing scope. """ mod = sys.modules.get(name, None) if mod is None or not isinstance(mod, types.ModuleType): mod = imp.load_module(name, *data) sys.modules[name] = mod scope[name] = mod
global_scope[name] = mod
if name.__class__.__name__ == 'ModuleProxy': global_scope[name] = mod
def _loadModule(): """ Load the given module, and insert it into the parent scope, and also the original importing scope. """ mod = sys.modules.get(name, None) if mod is None or not isinstance(mod, types.ModuleType): mod = imp.load_module(name, *data) sys.modules[name] = mod scope[name] = mod
mod = makeImportedModule(self.name, self.data, self.scope) sys.modules[fullname] = mod
if fullname in __builtins__: mod = imp.load_module(self.name, *self.data) sys.modules[fullname] = mod else: mod = makeImportedModule(self.name, self.data, self.scope) sys.modules[fullname] = mod
def load_module(self, fullname): mod = makeImportedModule(self.name, self.data, self.scope) sys.modules[fullname] = mod return mod
ret = self._commmitChangeSet(authToken, cs, mirror)
ret = self._commitChangeSet(authToken, cs, mirror)
def commitChangeSet(self, authToken, clientVersion, url, mirror = False):
Most C{r.GRoupRecipe} user commands accept a B{groupName}
Most C{r.GroupRecipe} user commands accept a B{groupName}
def getPrimaryGroupNames(self): """ Return the list of groups in this GroupRecipe that are not included in any other groups. """ unseen = set(self.getGroupNames())
def getFileContents(self, authToken, clientVersion, troveName, troveFlavor, troveVersion, fileId, fileVersion = None):
def getFileContents(self, authToken, clientVersion, troveName, troveVersion, troveFlavor, fileId, fileVersion = None):
def getFileContents(self, authToken, clientVersion, troveName, troveFlavor, troveVersion, fileId, fileVersion = None): if clientVersion <= 8: path = fileId fileId = None else: fileVersion = fileId fileId = troveVersion troveVersion = troveFlavor troveFlavor = None path = None fileId = self.toFileId(fileId)
fileId = troveVersion troveVersion = troveFlavor
fileId = troveFlavor
def getFileContents(self, authToken, clientVersion, troveName, troveFlavor, troveVersion, fileId, fileVersion = None): if clientVersion <= 8: path = fileId fileId = None else: fileVersion = fileId fileId = troveVersion troveVersion = troveFlavor troveFlavor = None path = None fileId = self.toFileId(fileId)
if not self.commentexp.search(line[:-1]):
if len(line) > 1 and not self.commentexp.search(line[:-1]):
def _sosymlink(self, dirname, names):
self.soexp = re.compile('^\.so (.*\...*)$') self.commentexp = re.compile('^\.\\\\"')
self.soexp = re.compile(r'^\.so (.*\...*)$') self.commentexp = re.compile(r'^\.\\"')
def __init__(self, *args, **keywords):
import lib lib.epdb.st('f')
def _newBase(newTrv): """ This creates three different troves. Read carefully or it's really confusing:
C{r.PythonSetup(I{srcname}, I{destname})}
C{r.PythonSetup([I{setupfile}])}
def do(self, macros):
'%%(pythonsetup)s'
' CFLAGS="%%(cflags)s" CXXFLAGS="%%(cflags)s %%(cxxflags)s"' ' CPPFLAGS="%%(cppflags)s"' ' LDFLAGS="%%(ldflags)s" CC=%%(cc)s CXX=%%(cxx)s' ' %%(pythonsetup)s'
def do(self, macros):
def genExcepthook(debug=True, dumpStack=False, debugCtrlC=False, prefix='conary-stack-', catchSIGUSR1=True):
def genExcepthook(debug=True, debugCtrlC=False, prefix='conary-error-', catchSIGUSR1=True, error=errorMessage):
def genExcepthook(debug=True, dumpStack=False, debugCtrlC=False, prefix='conary-stack-', catchSIGUSR1=True): def SIGUSR1Handler(signum, frame): global _debugAll _debugAll = True print >>sys.stderr, '<Turning on KeyboardInterrupt catching>' def excepthook(type, value, tb): if type is bdb.BdbQuit: sys.exit(1) sys.except...
tmpfd, stackfile = tempfile.mkstemp('.txt', 'conary-error-')
tmpfd, stackfile = tempfile.mkstemp('.txt', prefix)
def excepthook(type, value, tb): if type is bdb.BdbQuit: sys.exit(1) sys.excepthook = sys.__excepthook__ if not _debugAll and (type == KeyboardInterrupt and not debugCtrlC): sys.exit(1)
schema.createTrove(db)
schema.createTroves(db)
def __init__(self, db): self.db = db schema.createTrove(db)
return long(time.strftime("%Y%m%d%H%M%S"))
return long(time.strftime("%Y%m%d%H%M%S", time.gmtime(time.time())))
def _timestamp(): return long(time.strftime("%Y%m%d%H%M%S"))
To get a debug prompt, rerun this command with --config 'debugExceptions True'
To get a debug prompt, rerun this command with --debug-all
def findFile(file, searchdirs): return searchFile(file, searchdirs, error=1)
raise ParseError, 'expected integeter'
raise ParseError, 'expected integer'
def parseString(self, val): try: return int(val) except ValueError, msg: raise ParseError, 'expected integeter'
if not m or (m.name != "ELF" and m.name != "ar"): log.warning("non-executable object with library name %s", path)
if stat.S_ISREG(mode) and ( not m or (m.name != "ELF" and m.name != "ar")): log.warning("non-object file with library name %s", path)
def doFile(self, path):
destdir = self.macros.destdir
def doFile(self, path):
util.mkdirChain(destdir + targetdir) util.rename(destdir + path, destdir + target)
util.mkdirChain(destdir + targetdir) if stat.S_ISREG(mode): util.rename(destdir + path, destdir + target) else: contents = os.readlink(fullpath) if contents.find('/') == -1: util.rename(destdir + path, destdir + target) else: contentdir = os.path.dirname(contents) contenttarget = os.path.basename(contents) olddir =...
def doFile(self, path):
self.log(2, authToken[0],
self.log(3, authToken[0],
def check(self, authToken, write = False, admin = False, label = None, trove = None, mirror = False): self.log(2, authToken[0], "entitlement=%s write=%s admin=%s label=%s trove=%s mirror=%s" %( authToken[2], int(bool(write)), int(bool(admin)), label, trove, int(bool(mirror))))
('runtime', ('%(essentiallibdir)s/security/', '/lib/security/', r'%(libdir)s/perl./vendor_perl/', '%(datadir)s/gnome/help/.*/C/')),
('runtime', ('%(datadir)s/gnome/help/.*/C/')),
def updateArgs(self, *args, **keywords):
('devellib', (r'\.a')),
('devellib', (r'\.a', '%(libdir)s/pkgconfig/')),
def updateArgs(self, *args, **keywords):
'%(libdir)s/pkgconfig/',
def updateArgs(self, *args, **keywords):
query = dict.fromkeys(troveNames, {sourceVersion.branch() : None })
query = dict.fromkeys(troveNames, {sourceVersion.getBinaryVersion().branch() : None })
def nextVersion(repos, troveNames, sourceVersion, troveFlavor, targetLabel=None, alwaysBumpCount=False): """ Calculates the version to use for a newly built trove which is about to be added to the repository. @param repos: repository proxy @type repos: NetworkRepositoryClient @param troveNames: name(s) of the trove(s)...
@param itemList: A list of 3-length tuples: (troveName, version, flavor). If updateByDefault is True, trove names in itemList prefixed
@param itemList: A list of change specs: (troveName, (oldVersionSpec, oldFlavor), (newVersionSpec, newFlavor), isAbsolute). isAbsolute specifies whether to try to find an older version of trove on the system to replace if none is specified. If updateByDefault is True, trove names in itemList prefixed
def updateChangeSet(self, itemList, keepExisting = False, recurse = True, resolveDeps = True, test = False, updateByDefault = True, callback = UpdateCallback(), split = False, sync = False, fromChangesets = [], checkPathConflicts = True, ignorePrimaryPins = True, resolveRepos = True): """ Creates a changeset to update ...
@type itemList: [(troveName, version, flavor), ...]
@type itemList: [(troveName, (oldVer, oldFla), (newVer, newFla), isAbs), ...]
def updateChangeSet(self, itemList, keepExisting = False, recurse = True, resolveDeps = True, test = False, updateByDefault = True, callback = UpdateCallback(), split = False, sync = False, fromChangesets = [], checkPathConflicts = True, ignorePrimaryPins = True, resolveRepos = True): """ Creates a changeset to update ...
db = openDatabase(cfg.root, cfg.dbPath) args = [db, cfg] + otherArgs[2:]
args = [cfg] + otherArgs[2:]
def realMain(argv=sys.argv): argDef = {} cfgMap = {} cfgMap["build-label"] = "buildLabel" cfgMap["root"] = "root" (NO_PARAM, ONE_PARAM) = (options.NO_PARAM, options.ONE_PARAM) (OPT_PARAM, MULT_PARAM) = (options.OPT_PARAM, options.MULT_PARAM) argDef["all"] = NO_PARAM argDef["config"] = MULT_PARAM argDef["config-fil...
'%(mandir)s/man(2|3)/',
def updateArgs(self, *args, **keywords):
if self._parent:
if self._parent is not None:
def _reverseParents(self): if self._parent: for parent in self._parent._reverseParents(): yield parent yield self._parent
'flavor' : deps.formatFlavor(pkCs.getFlavor()),
'flavor' : deps.formatFlavor(pkgCs.getFlavor()),
def commitChangeSet(self, authToken, clientVersion, url):
cu.execute("CREATE TEMPORARY TABLE Fixes " "(instanceId INTEGER, sigs BLOB)")
cu.execute(""" CREATE TEMPORARY TABLE Fixes( instanceId INTEGER, sigs %(BLOB)s)""" % self.db.keywords)
def migrate(self): cu = self.db.cursor() cu.execute("DROP TABLE Latest") self.db.loadSchema() createLatest(self.db)
cu.execute("""DELETE FROM TroveInfo WHERE instanceId IN (SELECT instanceId FROM Fixes) AND infoType = %d""" % trove._TROVEINFO_TAG_SIGS) cu.execute("""INSERT INTO TroveInfo (instanceId, infoType, data) SELECT instanceId, %d, sigs FROM Fixes""" % trove._TROVEINFO_TAG_SIGS)
cu.execute(""" DELETE FROM TroveInfo WHERE instanceId IN (SELECT instanceId FROM Fixes) AND infoType = %d""" % trove._TROVEINFO_TAG_SIGS) cu.execute(""" INSERT INTO TroveInfo (instanceId, infoType, data) SELECT instanceId, %d, sigs FROM Fixes""" % trove._TROVEINFO_TAG_SIGS) cu.execute("DROP TABLE Fixes")
def migrate(self): cu = self.db.cursor() cu.execute("DROP TABLE Latest") self.db.loadSchema() createLatest(self.db)
C{r.Requires('soname: %(libdir)/kde3/kgreet_classic.so', '%(bindir)/kdm')
C{r.Requires('soname: %(libdir)/kde3/kgreet_classic.so', '%(bindir)/kdm')}
def _markProvides(self, path, fullpath, provision, pkg, m, f): if path not in pkg.providesMap: # BuildPackage only fills in providesMap for ELF files; we may # need to create a few more DependencySets. pkg.providesMap[path] = deps.DependencySet()
print "Including extra troves to resolve dependencies" print " %s" % " ".join(suggMap.itervalues())
print "Including extra troves to resolve dependencies:" print " ", for suggList in suggMap.itervalues(): print "%s" % (" ".join([x[0] for x in suggList])), print
def doUpdate(repos, cfg, pkgList, replaceFiles = False, tagScript = None, keepExisting = False, depCheck = True, recurse = True): client = conaryclient.ConaryClient(repos, cfg) applyList = [] if type(pkgList) is str: pkgList = ( pkgList, ) for pkgStr in pkgList: if os.path.exists(pkgStr) and os.path.isfile(pkgStr): t...
'cooking is not possible' % cfg.archDir)
'cooking is not possible' % ' '.join(cfg.archDirs))
def cookObject(repos, cfg, recipeClass, sourceVersion, changeSetFile = None, prep=True, macros={}, targetLabel = None, resume = None, alwaysBumpCount = False, allowUnknownFlags = False, allowMissingSource = False, ignoreDeps = False, logBuild = False, callback = None): """ Turns a recipe object into a change set, and s...
code = compile('\n'.join(full_input) + '\n', '<stdin>', 'exec')
code = compile('\n'.join(full_input) + '\n', '<stdin>', 'single')
def multiline(self, firstline=''): full_input = [] if firstline: print ' ' + firstline full_input.append(firstline) while True: if self.use_rawinput: try: line = raw_input('| ') except EOFError: line = 'EOF' else: self.stdout.write('| ') self.stdout.flush() line = self.stdin.readline() if not len(line): line = 'EOF' e...
(data, trove._TROVEINFO_TAG_PATH_HASHES, instanceId))
(cu.binary(data), trove._TROVEINFO_TAG_PATH_HASHES, instanceId))
def migrate(self): from conary import trove cu = self.cu cu2 = self.db.cursor()
cu.execute(full).fetchall()
def _resolve(self, depSetList, selectTemplate, restrictor=None, restrictBy=None):
docs = {'message': 'Use MESSAGE to describe why the commit was performed'} docs = {'test': ('Runs through all the steps of committing but does not'
docs = {'message': 'Use MESSAGE to describe why the commit was performed', 'test': ('Runs through all the steps of committing but does not'
def runCommand(self, repos, cfg, argSet, args, profile = False, callback = None): if len(args) < 3: return self.usage()
if len(parts) != 1: if parts[1] in componentsToRemove: byDefault = False
if len(parts) == 2 and parts[1] in componentsToRemove: byDefault = False
def _addImplicitTroves(self, childGroups): componentsToRemove = self.removeComponentList
if childTrove in components:
parts = childTrove[0].split(':', 1) if len(parts) == 2 and parts[1] in components:
def _addImplicitTroves(self, childGroups): componentsToRemove = self.removeComponentList
byDefault = None, groupName = None, ref=None):
byDefault = None, groupName = None, ref = None, components = None):
def add(self, name, versionStr = None, flavor = None, source = None, byDefault = None, groupName = None, ref=None): groupNames = self._parseGroupNames(groupName) flavor = self._parseFlavor(flavor) # track this trove in the GroupRecipe so that it can be found # as a group with the rest of the troves. self.toFind.setdefa...
flavor = flavor, source = source, byDefault = byDefault, ref = ref)
flavor = flavor, source = source, byDefault = byDefault, ref = ref, components = components)
def add(self, name, versionStr = None, flavor = None, source = None, byDefault = None, groupName = None, ref=None): groupNames = self._parseGroupNames(groupName) flavor = self._parseFlavor(flavor) # track this trove in the GroupRecipe so that it can be found # as a group with the rest of the troves. self.toFind.setdefa...
builddirlen = len(topbuilddir) if self.macros.lib == 'lib': builddirlen += 2
def preProcess(self): self.invariantsubtrees = [x[0] for x in self.invariantinclusions] # see if we can do debuginfo self.debuginfo = False # we need this for the debuginfo case self.dm = macros.Macros() self.dm.update(self.macros) # we need to start searching from just below the build directory topbuilddir = '/'.join(...
len(self.macros.debugsrcdir) <= builddirlen:
len(self.macros.debugsrcdir) <= len(topbuilddir):
def preProcess(self): self.invariantsubtrees = [x[0] for x in self.invariantinclusions] # see if we can do debuginfo self.debuginfo = False # we need this for the debuginfo case self.dm = macros.Macros() self.dm.update(self.macros) # we need to start searching from just below the build directory topbuilddir = '/'.join(...
if job[1][0] is not None and job[2][0] is not None and \ job[1][0].branch() == job[2][0].branch() and \ (job[0], job[1][0], job[1][1]) not in avail: del localUpdatesByPresent[(job[0], job[2][0], job[2][1])] del localUpdatesByMissing[(job[0], job[1][0], job[1][1])] referencedNotInstalled.remove((job[0], job[1][0], job[1...
if job[1][0] is not None and job[2][0] is not None: oldArches = [ x.name for x in job[1][1].iterDepsByClass(ISD) ] newArches = [ x.name for x in job[2][1].iterDepsByClass(ISD) ] if set(newArches) != set(oldArches): del localUpdatesByPresent[(job[0], job[2][0], job[2][1])] del localUpdatesByMissing[(job[0], job[1][0], j...
# def _mergeGroupChanges -- main body begins here
cs.writeToFile("FOO") from repository import changeset cs = changeset.ChangeSetFromFile("FOO")
def checkout(repos, cfg, workDir, name, versionStr = None): # We have to be careful with labels name += ":source" try: trvList = repos.findTrove(cfg.buildLabel, name, None, versionStr = versionStr) except repository.repository.PackageNotFound, e: log.error(str(e)) return if len(trvList) > 1: log.error("branch %s matche...
(p, fileMap) = _createPackage(repos, buildBranch, srcBldPkg, ident) packageList.append((p, fileMap))
def _cook(repos, cfg, recipeFile, prep=0, macros=()): repos.open("r") buildBranch = cfg.defaultbranch if type(recipeFile) is types.ClassType: classList = {recipeFile.__name__: recipeFile} else: try: classList = recipe.RecipeLoader(recipeFile) except recipe.RecipeFileError, msg: raise CookError(str(msg)) built = [] f...
(p, fileMap) = _createPackage(repos, buildBranch, srcBldPkg, ident) packageList.append((p, fileMap))
def _cook(repos, cfg, recipeFile, prep=0, macros=()): repos.open("r") buildBranch = cfg.defaultbranch if type(recipeFile) is types.ClassType: classList = {recipeFile.__name__: recipeFile} else: try: classList = recipe.RecipeLoader(recipeFile) except recipe.RecipeFileError, msg: raise CookError(str(msg)) built = [] f...
if (self._privateDepMap and m and m.name == 'ELF'
if (m and m.name == 'ELF'
def doFile(self, path):
grp.addPackage(name, versionList)
for v in versionList: grp.addPackageVersion(name, v)
def cookGroupObject(repos, cfg, recipeClass, newVersion, buildBranch, macros=()): """ Turns a group recipe object into a change set. Returns the absolute changeset created, a list of the names of the packages built, and and None (for compatibility with cookPackageObject). @param repos: Repository to both look for sour...
for name, versionD in troveDict.iterkeys(): for version, flavorList in versionD.iterkeys(): sigList += [ (name, version, x) for x in flavorList ]
for name, versionD in troveDict.iteritems(): for version, flavorList in versionD.iteritems(): for flavor in flavorList: sigList.append((currentMark, (name, version, flavor)))
def mirrorSignatures(sourceRepos, targetRepos, currentMark, cfg, test = False, syncSigs = False): log.debug("looking for new pgp keys") keyList = sourceRepos.getNewPGPKeys(cfg.host, currentMark) if test: log.debug("(not adding %d keys due to test mode)", len(keyList)) else: log.debug("adding %d keys to target", len(key...
updateCount = targetRepos.setTroveSigs( [ (x[0][1], x[1]) for x in itertools.izip(sigList, sigs) ])
updateCount = targetRepos.setTroveSigs(sigs)
def mirrorSignatures(sourceRepos, targetRepos, currentMark, cfg, test = False, syncSigs = False): log.debug("looking for new pgp keys") keyList = sourceRepos.getNewPGPKeys(cfg.host, currentMark) if test: log.debug("(not adding %d keys due to test mode)", len(keyList)) else: log.debug("adding %d keys to target", len(key...
request, present, value)
(request, present, value))
def createFlavors(db): cu = db.cursor() commit = False if "Flavors" not in db.tables: cu.execute(""" CREATE TABLE Flavors( flavorId %(PRIMARYKEY)s, flavor VARCHAR(767) ) %(TABLEOPTS)s""" % db.keywords) cu.execute("INSERT INTO Flavors (flavorId, flavor) VALUES (0, '')") db.tables["Flavors"] = [] commit =...
db.createIndex("Entitlements", "EntitlementsEntGroupEntitlementIdx",
db.createIndex("Entitlements", "EntitlementsEgEIdx",
def createUsers(db): cu = db.cursor() commit = False if "Users" not in db.tables: cu.execute(""" CREATE TABLE Users ( userId %(PRIMARYKEY)s, userName VARCHAR(254) NOT NULL, salt %(BINARY4)s NOT NULL, password %(BINARY254)s, changed NUMERIC(14,0) NOT NULL DEFAULT 0 ) %(TABLEOPT...
fingerprint CHAR(40) PRIMARY KEY,
fingerprint CHAR(40) PRIMARY KEY NOT NULL,
def createPGPKeys(db): cu = db.cursor() commit = False if "PGPKeys" not in db.tables: # userId can be null (and hence so not in the usertable) when pgp # keys are imported by mirrors or proxies cu.execute(""" CREATE TABLE PGPKeys( keyId %(PRIMARYKEY)s, userId INTEGER, fingerprint CHAR(40) NOT NUL...
CONSTRAINT TroveRedirects_branchId_fk,
CONSTRAINT TroveRedirects_branchId_fk
def createTroves(db): cu = db.cursor() commit = False if 'FileStreams' not in db.tables: cu.execute(""" CREATE TABLE FileStreams( streamId %(PRIMARYKEY)s, fileId %(BINARY20)s, stream %(MEDIUMBLOB)s, changed NUMERIC(14,0) NOT NULL DEFAULT 0 ) %(TABLEOPTS)s""" % db.keywords) db.tables["FileStreams"] = []...
CONSTRAINT TroveRedirects_flavorId_fk,
CONSTRAINT TroveRedirects_flavorId_fk
def createTroves(db): cu = db.cursor() commit = False if 'FileStreams' not in db.tables: cu.execute(""" CREATE TABLE FileStreams( streamId %(PRIMARYKEY)s, fileId %(BINARY20)s, stream %(MEDIUMBLOB)s, changed NUMERIC(14,0) NOT NULL DEFAULT 0 ) %(TABLEOPTS)s""" % db.keywords) db.tables["FileStreams"] = []...
self.repos = netclient.NetworkRepositoryClient(cfg.repositoryMap)
client = conaryclient.ConaryClient(cfg) self.repos = client.getRepos()
def __init__(self, passwd, getPerson=None, host='localhost', user='bugs', database='bugs', verbose=False):
if set(flags).issubset(set(provided.flags.keys())):
requiredSet = set(x[0] for x in flags) providedSet = set(provided.flags.keys()) if requiredSet.issubset(providedSet):
def _createELFDepSet(self, m, elfinfo, recipe=None, basedir=None, soname=None, soflags=None, libPathMap={}, getRPATH=None): """ Add dependencies from ELF information.
sorted(list(set(flags)-set(provided.flags.keys()))))
sorted(list(requiredSet-providedSet)))
def _createELFDepSet(self, m, elfinfo, recipe=None, basedir=None, soname=None, soflags=None, libPathMap={}, getRPATH=None): """ Add dependencies from ELF information.
if basedir: recipe.Requires(_privateDepMap=(oldname, dep))
def _createELFDepSet(self, m, elfinfo, recipe=None, basedir=None, soname=None, soflags=None, libPathMap={}, getRPATH=None): """ Add dependencies from ELF information.
B{C{r.addAction()}} - Copies a file into the build directory
B{C{r.addAction()}} - Performs the specified shell command in the first pass of the build (similar to r.Run() but performed during the prep stage).
def do(self):
else: self.errors.append("%s is in the way of a newly " "created file" % headRealPath) fullyUpdated = False continue
inWay = False if inWay: self.errors.append("%s is in the way of a newly " "created file" % headRealPath) fullyUpdated = False continue
def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags):
notSelected = [ '%s=%s' % (name, x[1].branch()) for x in trvList[1:]] log.warning('The following source branches were matched by your' ' checkout command but not chosen. To check them out' ' use cvc co %s=<branch> for the following branches:\n\n' ' %s\n' % (name, '\n'.join(notSelected)))
notSelected = [ '%s=%s' % (name, x[1].branch()) for x in trvList[:-1]]
def checkout(repos, cfg, workDir, name, callback=None): if not callback: callback = CheckinCallback() # We have to be careful with labels name, versionStr, flavor = cmdline.parseTroveSpec(name) if flavor: log.error('source troves do not have flavors') return sourceName = name + ":source" try: trvList = repos.findTrov...
% (File, self.lineno, key))
% (file, self.lineno, key))
def parseString(self, str): val = str.split() if len(val) < 2 or len(val) > 3: raise ParseError, ("%s:%s: expected <hostglob> <user> " "<password> for configuration value %s" % (File, self.lineno, key)) elif len(val) == 2: return (val[0], val[1], None) else: return tuple(val)
import lib lib.epdb.st()
def _resolveDependencies(self, cs, keepExisting = None, depsRecurse = True): pathIdx = 0 foundSuggestions = False (depList, cannotResolve) = self.db.depCheck(cs)[0:2] suggMap = {}
clonedVer = None
clonedVer = trv.getVersion()
def _createBinaryVersions(versionMap, leafMap, repos, srcVersion, infoList): # this works on a single flavor at a time singleFlavor = list(set(x[2] for x in infoList)) assert(len(singleFlavor) == 1) singleFlavor = singleFlavor[0]