rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
cont = filecontents.FromFile(gzip.GzipFile(None, "r", fileobj = f)) | cont = filecontents.FromFile(gzip.GzipFile(None, 'r', fileobj = f)) | def __init__(self, fileName, skipValidate = 1): if type(fileName) is str: f = open(fileName, "r") csf = filecontainer.FileContainer(f) else: csf = filecontainer.FileContainer(fileName) |
gzf = gzip.GzipFile(path, "wb", fileobj = os.fdopen(os.dup(fd), "w")) | gzf = gzip.GzipFile('', "wb", fileobj = os.fdopen(os.dup(fd), "w")) | def getNextFile(self): if not self.items: return None |
return urllib2.urlopen(val) | return urllib2.urlopen(url) | def _openUrl(self, url): try: return urllib2.urlopen(val) except urllib2.HTTPError, err: raise CfgEnvironmentError(err.filename, err.msg) except urllib2.URLError, err: raise CfgEnvironmentError(val, err.reason.args[1]) except EnvironmentError, err: raise CfgEnvironmentError(err.filename, err.msg) |
raise CfgEnvironmentError(val, err.reason.args[1]) | raise CfgEnvironmentError(url, err.reason.args[1]) | def _openUrl(self, url): try: return urllib2.urlopen(val) except urllib2.HTTPError, err: raise CfgEnvironmentError(err.filename, err.msg) except urllib2.URLError, err: raise CfgEnvironmentError(val, err.reason.args[1]) except EnvironmentError, err: raise CfgEnvironmentError(err.filename, err.msg) |
for i in range(b): r = r*256 + ord(rand.read(1)) | while r < 2: for i in range(b): r = r*256 + ord(rand.read(1)) r %= q while self._gcf(r, q-1) != 1: r = (r+1) % q | def _getRelPrime(self, q): # We /dev/random instead of /dev/urandom. This was not a mistake; # we want the most random data available rand=open('/dev/random','r') b = self._bitLen(q)/8 + 1 r = 0L for i in range(b): r = r*256 + ord(rand.read(1)) rand.close() r %= q while self._gcf(r, q-1) != 1: r = (r+1) % q return r |
r %= q while self._gcf(r, q-1) != 1: r = (r+1) % q | def _getRelPrime(self, q): # We /dev/random instead of /dev/urandom. This was not a mistake; # we want the most random data available rand=open('/dev/random','r') b = self._bitLen(q)/8 + 1 r = 0L for i in range(b): r = r*256 + ord(rand.read(1)) rand.close() r %= q while self._gcf(r, q-1) != 1: r = (r+1) % q return r | |
if isinstance(self.cryptoKey, DSA.DSAobj_c): | if isinstance(self.cryptoKey,(DSA.DSAobj_c, DSA.DSAobj)): | def signString(self, data): if isinstance(self.cryptoKey, DSA.DSAobj_c): K = self.cryptoKey.q + 1 while K > self.cryptoKey.q: K = self._getRelPrime(self.cryptoKey.q) else: K = 0 timeStamp = int(time()) return (self.fingerprint, timeStamp, self.cryptoKey.sign(data+str(timeStamp), K)) |
Demonstrates calling C{r.Environment()} to install the file | Demonstrates calling C{r.Install()} to install the file | def __init__(self, recipe, *args, **keywords): _FileAction.__init__(self, recipe, *args, **keywords) |
def __init__(self, driver=None, path=None, db=None): | _historyPath = os.path.expanduser('~/.dbsqlhistory') def __init__(self, db = None, driver = None, path = None): | def __init__(self, driver=None, path=None, db=None): cmd.Cmd.__init__(self) self.prompt = 'dbsql> ' self.doc_header = "Documented commands (type .help <topic>):" self.intro = 'dbstore sql shell. type ".quit" to exit' if driver and path: self.db = dbstore.connect(path, driver=driver) elif db: self.db = db else: raise R... |
sys.exit() | return True | def do_quit(self, arg): sys.exit() |
for name in added.keys(): for newFlavor in added[name].keys(): if removed[name].has_key(newFlavor): changePair.append((name, added[name][newFlavor], newFlavor, removed[name][newFlavor], newFlavor)) del added[name][newFlavor] del removed[name][newFlavor] if not added[name]: del added[name] if not removed[name]: del re... | def diff(self, them, absolute = 0): | |
for newFlavor in added[name].keys(): if not newFlavor: continue oldFlavor = None scores = ((newFlavor.score(x), x) for x in removed[name] if x) scores = [ x for x in scores if x[0] is not False] if scores: oldFlavor = max(scores)[1] else: scores = ((x.score(newFlavor), x) \ for x in removed[name] if x) scores = [ x... | addedByBranch = {} removedByBranch = {} for flavor, versionList in added[name].iteritems(): for version in versionList: d = addedByBranch.setdefault(version.branch(), {}) d.setdefault(flavor, []).append(version) for flavor, versionList in removed[name].iteritems(): for version in versionList: d = removedByBranch.setde... | def diff(self, them, absolute = 0): |
def merge(self, cs, src): | def merge(self, cs, src = None): | def merge(self, cs, src): changeset.MergeableChangeSet.merge(self, cs) self.contents.append(src) self.empty = False |
self.contents.append(src) | if isinstance(cs, UpdateChangeSet): self.contents += cs.contents else: self.contents.append(src) | def merge(self, cs, src): changeset.MergeableChangeSet.merge(self, cs) self.contents.append(src) self.empty = False |
cs.merge(newCs, (self.repos.createChangeSet, troves)) | cs.merge(newCs) | def _resolveDependencies(self, cs, keepExisting = None, recurse = True): pathIdx = 0 foundSuggestions = False depList = self.db.depCheck(cs)[1] suggMap = {} |
client.updateChangeSet(applyList, replaceFiles, recurse = recurse, | client.updateChangeSet(applyList, recurse = recurse, | 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... |
print "Extra packages are needed for the install" | print "Additional packages are needed for the install" | 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... |
return | 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... | |
except database.MissingDependencies, e: print "Dependency check failure:" print "\t" + "\n\t".join(str(e).split("\n")) | 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... | |
'Conary Repository Unhandled Exception Report') | 'Conary Repository Error Message') | def __init__(self, cfg): self.log = tracelog.getLog(None) self.cfg = cfg |
vers = repos.getTroveVersionsByLabel([troveName], newV.branch().label()) | vers = repos.getTroveVersionsByBranch( { troveName : { newV.branch() : None } } ) | def rdiff(repos, buildLabel, troveName, oldVersion, newVersion): if not troveName.endswith(":source"): troveName += ":source" new = repos.findTrove(buildLabel, troveName, None, versionStr = newVersion) if len(new) > 1: log.error("%s matches multiple versions" % newVersion) return new = new[0] newV = new.getVersion() ... |
print "HERE", badId | def versionCheck(self): cu = self.db.cursor() count = cu.execute("SELECT COUNT(*) FROM sqlite_master WHERE " "name='DatabaseVersion'").next()[0] if count == 0: # if DatabaseVersion does not exist, but any other tables do exist, # then the database version is old count = cu.execute("SELECT count(*) FROM sqlite_master").... | |
@type newVersion | @type newVersion: versions.NewVersion | def _localChanges(repos, changeSet, curPkg, srcPkg, newVersion, root, flags): """ Populates a change set against the files in the filesystem and builds a package object which describes the files installed. The return is a tuple with a boolean saying if anything changes and a package reflecting what's in the filesystem... |
raise DestdirPolicyError("Interpreter %s for file %s not found, could not convert from /usr/bin/env syntax " % (path, wordlist[0])) | raise DestdirPolicyError("Interpreter %s for file %s not found, could not convert from /usr/bin/env syntax " % (wordlist[0], path)) | def doFile(self, path): |
raise builderrors.LoadRecipeError('unable to load recipe file %s: %s'\ | raise builderrors.LoadRecipeError('unable to load recipe file %s:\n%s'\ | def __init__(self, filename, cfg=None, repos=None, component=None, branch=None, ignoreInstalled=False, directory=None): try: self._load(filename, cfg, repos, component, branch, ignoreInstalled, directory) except Exception, err: raise builderrors.LoadRecipeError('unable to load recipe file %s: %s'\ % (filename, err)) |
except errors.TroveNotFound: | except (errors.TroveNotFound, errors.OpenError), err: | def recipeLoaderFromSourceComponent(name, cfg, repos, versionStr=None, labelPath=None, ignoreInstalled=False, filterVersions=False, parentDir=None): # FIXME parentDir specifies the directory to look for # local copies of recipes called with loadRecipe. If # empty, we'll look in the tmp directory where we create the re... |
'cannot find source component %s' % component) | 'cannot find source component %s: %s' % (component, err)) | def recipeLoaderFromSourceComponent(name, cfg, repos, versionStr=None, labelPath=None, ignoreInstalled=False, filterVersions=False, parentDir=None): # FIXME parentDir specifies the directory to look for # local copies of recipes called with loadRecipe. If # empty, we'll look in the tmp directory where we create the re... |
self._markRequirement(info, path) | self._markManualRequirement(info, path, pkg) | def runInfo(self, path): |
def _markManualRequirement(self, info, path): | def _markManualRequirement(self, info, path, pkg): | def _markManualRequirement(self, info, path): if self._checkInclusion(info, path): if info[0] == "/": depClass = deps.FileDependencies else: # by process of elimination, must be a trove depClass = deps.TroveDependencies self._addRequirement(path, info, pkg, depClass) |
return realMain(ccfg, argv) except errors.InternalConaryError, err: | return realMain(ccfg, argv) except debuggerException, err: | def main(argv=sys.argv): try: if '--skip-default-config' in argv: argv = argv[:] argv.remove('--skip-default-config') ccfg = conarycfg.ConaryConfiguration() else: ccfg = conarycfg.ConaryConfiguration(readConfigFiles=True) # reset the excepthook (using cfg values for exception settings) sys.excepthook = util.genExceptho... |
cwd = os.getcwd() | def _setupRemoves(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, flags): # Remove old files. if the files have already been removed, just # mention that fact and continue. Don't erase files which # have changed contents. | |
cwd = os.getcwd() | def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags): | |
""" return troves contained in troves on this system, whether or not they are installed | """ return trove tuples that a) have a name in the given list of names and b) are referenced by the pristine version of troves installed in this system. Note that the trove tuples returned may not be installed - they merely must be referenced by an installed trove. | def findTroveReferences(self, names): """ return troves contained in troves on this system, whether or not they are installed """ cu = self.db.cursor() cu.execute("CREATE TEMPORARY TABLE ftc(idx INTEGER, name STRING)", start_transaction = False) for idx, name in enumerate(names): cu.execute("INSERT INTO ftc VALUES(?, ?... |
fileObj.restore(*tup) | fileObj.restore(None, '/', fullPath, 1) | 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... |
labelPath = set(x.keys()[0] for x in self.query[name] if x.keys()) | labelPath = itertools.chain(*(x.keys() for x in self.query[name])) | def missingMsg(self, name): # collapse all the labels searched in the queries to a unique list labelPath = set(x.keys()[0] for x in self.query[name] if x.keys()) if labelPath: return "%s was not found on path %s" \ % (name, ', '.join(x.asString() for x in labelPath)) else: return "%s was not found" % name |
self.autoResolveLabelPath = labelPath cfg.installLabelPath = self.autoResolveLabelPath | resolveLabelPath = labelPath else: resolveLabelPath = [versions.Label(x) for x in self.autoResolveLabelPath] cfg.installLabelPath = resolveLabelPath | def _findTroves(addTroveList): validSize = True troveList = [] flavorMap = {} findTroveList = [] size = 0 troveVersionFlavors = {} for (name, versionStr, flavor, source, byDefault) in addTroveList: desFlavor = cfg.buildFlavor.copy() if flavor is not None: desFlavor = deps.overrideFlavor(desFlavor, flavor) findTroveList... |
branches = self.f.branchList() | branches = self.branchList() | def fullVersionList(self): |
rc += self.f.versionList(branch) | rc += self.versionList(branch) | def fullVersionList(self): |
raise ParseError, "two many shadow serial numbers in '%s'" \ | raise ParseError, "too many shadow serial numbers in '%s'" \ | def _VersionFromString(ver, defaultBranch = None, frozen = False, timeStamps = []): """ Provides a version object from a string representation of a version. The time stamp is set to 0, so this object cannot be properly ordered with respect to other versions. @param ver: string representation of a version @type ver: s... |
for version in d[name].keys(): | for version in d.get(name, {}).keys(): | def findTrove(self, labelPath, name, defaultFlavor, versionStr = None, acrossRepositories = False, withFiles = True, affinityDatabase = None, flavor = None): |
if not d[name]: | if not d.has_key(name): | def findTrove(self, labelPath, name, defaultFlavor, versionStr = None, acrossRepositories = False, withFiles = True, affinityDatabase = None, flavor = None): |
thisdest = dest if dest[-1:] == '/': thisdest = dest + os.path.basename(sources) elif len(sourcelist) > 1: | if dest[-1:] != '/' and len(sourcelist) > 1: | def doInstall(self, macros): |
if not self.repServer.repos.auth.check(authToken, admin=True): | if not admin: | def chPassCmd(self, authToken, fields): username = fields["username"].value if username != authToken[0]: if not self.repServer.repos.auth.check(authToken, admin=True): raise InsufficientPermission if fields.has_key("oldPassword"): oldPassword = fields["oldPassword"].value else: oldPassword = None p1 = fields["password... |
if authToken[1] != oldPassword and authToken[0] == username: | if authToken[1] != oldPassword and authToken[0] == username and not admin: | def chPassCmd(self, authToken, fields): username = fields["username"].value if username != authToken[0]: if not self.repServer.repos.auth.check(authToken, admin=True): raise InsufficientPermission if fields.has_key("oldPassword"): oldPassword = fields["oldPassword"].value else: oldPassword = None p1 = fields["password... |
logMe(3, "migrating schema from version", version) | def versionCheck(self): logMe(3) cu = self.db.cursor() count = cu.execute("SELECT COUNT(*) FROM sqlite_master WHERE " "name='DatabaseVersion'").next()[0] if count == 0: # if DatabaseVersion does not exist, but any other tables do exist, # then the database version is old count = cu.execute("SELECT count(*) FROM sqlite_... | |
(troveName, troveVersion, troveFile) = self.map[fileName] f = self.repos.getNewFileContents(troveName, troveVersion, troveFlavor, troveFile) util.copyfileobj(f, f.open(cachedname, "w")) | (troveName, troveVersion, troveFlavor, troveFile) = self.map[fileName] f = self.repos.getFileContents(troveName, troveVersion, troveFlavor, troveFile) util.copyfileobj(f, open(cachedname, "w")) | def moveFileToCache(self, cfg, fileName, location): |
if cfg.dumpStackOnError: try: (tbfd,path) = tempfile.mkstemp('', 'conary-stack-') output = os.fdopen(tbfd, 'w') stackutil.printTraceBack(tb, output, type, exc_msg) log.info("** NOTE ** Extended traceback written to %s\n" % path) except Exception, msg: log.warning("Could not write extended traceback: %s" % msg) | def excepthook(type, exc_msg, tb): cfg = self.recipe.cfg sys.excepthook = sys.__excepthook__ if cfg.debugRecipeExceptions: lines = traceback.format_exception(type, exc_msg, tb) print string.joinfields(lines, "") if self.linenum is not None: prefix = "%s:%s:" % (self.file, self.linenum) prefix_len = len(prefix) if str(e... | |
""" Takes a binary branch and returns its associated source branch. (any trailing version info is left untouched). If source is branched off of <repo1>-2 into <repo2>, its new version will be <repo1>-2/<repo2>/2. The corresponding build will be on branch <repo1>-2-0/<repo2>/2-1. getSourceBranch converts from the latte... | """ Takes a binary version and returns its associated source version (any trailing version info is left untouched). If source is branched off of <repo1>-2 into <repo2>, its new version will be <repo1>-2/<repo2>/2. The corresponding build will be on branch <repo1>-2-0/<repo2>/2-1. getSourceBranch converts from the latt... | def getSourceBranch(self): """ Takes a binary branch and returns its associated source branch. (any trailing version info is left untouched). If source is branched off of <repo1>-2 into <repo2>, its new version will be <repo1>-2/<repo2>/2. The corresponding build will be on branch <repo1>-2-0/<repo2>/2-1. getSourceBra... |
p = v.branch() if p.hasParent(): p = p.parentNode() p.trailingVersion().buildCount = None while p.hasParent(): p = p.parent() p.trailingVersion().buildCount = None | for item in v.items(): if isinstance(item, VersionRelease): item.buildCount = None | def getSourceBranch(self): """ Takes a binary branch and returns its associated source branch. (any trailing version info is left untouched). If source is branched off of <repo1>-2 into <repo2>, its new version will be <repo1>-2/<repo2>/2. The corresponding build will be on branch <repo1>-2-0/<repo2>/2-1. getSourceBra... |
for path, in cu: | for path, in cu2: | def migrate(self): from conary import trove cu = self.cu logMe(3, "Fixing NULL path hashes...") cu.execute("SELECT instanceId FROM TroveInfo " "WHERE data IS NULL and infotype = ?", trove._TROVEINFO_TAG_PATH_HASHES) cu2 = self.db.cursor() for instanceId, in cu: cu2.execute("SELECT path FROM TroveFiles WHERE instanceId... |
self.recipe.ExecutableLibraries(*args, **keywords) self.recipe.CheckSonames(*args, **keywords) | def updateArgs(self, *args, **keywords): | |
return cs, extraTroveList, extraFileList | return (cs, _cvtTroveList(extraTroveList), _cvtFileList(extraFileList)) | def _getCsFromRepos(target, cs, server, job, recurse, withFiles, withFileContents, excludeAutoSource, filesNeeded, chgSetList): abortCheck = None if callback: callback.requestingChangeSet() abortCheck = callback.checkAbort server.setAbortCheck(abortCheck) (url, sizes, extraTroveList, extraFileList) = \ server.getChange... |
self.tarballs.append((file, extractDir)) | self.sources.append((file, 'tarball', extractDir, ())) | def addArchive(self, file, extractDir='', keyid=None): |
def addTarball(self, file, extractDir='', keyid=None): warnings.warn("recipe.addTarball is deprecated - use recipe.addArchive", DeprecationWarning, stacklevel=2) self.addArchive(file, extractDir, keyid) | def addTarball(self, file, extractDir='', keyid=None): warnings.warn("recipe.addTarball is deprecated - use recipe.addArchive", DeprecationWarning, stacklevel=2) self.addArchive(file, extractDir, keyid) | |
self.tarballs.append((file, extractDir)) | self.sources.append((file, 'tarball', extractDir, ())) | def addArchiveFromRPM(self, rpm, file, extractDir='', keyid=None): |
def addTarballFromRPM(self, rpm, file, extractDir='', keyid=None): warnings.warn("recipe.addTarballFromRPM is deprecated - use recipe.addArchiveFromRPM", DeprecationWarning, stacklevel=2) self.addArchiveFromRPM(rpm, file, extractDir, keyid) | def addTarballFromRPM(self, rpm, file, extractDir='', keyid=None): warnings.warn("recipe.addTarballFromRPM is deprecated - use recipe.addArchiveFromRPM", DeprecationWarning, stacklevel=2) self.addArchiveFromRPM(rpm, file, extractDir, keyid) | |
self.patches.append((file, level, backup)) | self.sources.append((file, 'patch', '', (level, backup))) | def addPatch(self, file, level='1', backup='', keyid=None): |
def addSource(self, file, keyid=None): self.sources.append(file) | def addSource(self, file, keyid=None, extractDir='', apply=None): self.sources.append((file, 'source', extractDir, (apply))) | def addSource(self, file, keyid=None): |
for (tarball, extractdir) in self.tarballs: sources.append(tarball) for (patch, level, backup) in self.patches: sources.append(patch) | for (file, filetype, extractDir, args) in self.sources: sources.append(file) | def allSources(self): sources = [] for (tarball, extractdir) in self.tarballs: sources.append(tarball) for (patch, level, backup) in self.patches: sources.append(patch) |
return sources + self.sources | return sources | def allSources(self): sources = [] for (tarball, extractdir) in self.tarballs: sources.append(tarball) for (patch, level, backup) in self.patches: sources.append(patch) |
for (file, extractdir) in self.tarballs: f = lookaside.findAll(self.cfg, self.laReposCache, file, self.name, self.srcdirs) self.checkSignatures(f, file) if f.endswith(".bz2"): tarflags = "-jxf" elif f.endswith(".gz") or f.endswith(".tgz"): tarflags = "-zxf" else: raise RuntimeError, "unknown archive compression" if ext... | for (file, filetype, targetdir, args) in self.sources: if filetype == 'tarball': f = lookaside.findAll(self.cfg, self.laReposCache, file, self.name, self.srcdirs) self.checkSignatures(f, file) if f.endswith(".bz2"): tarflags = "-jxf" elif f.endswith(".gz") or f.endswith(".tgz"): tarflags = "-zxf" else: raise RuntimeErr... | def unpackSources(self, builddir): |
self.tarballs = [] self.patches = [] | def __init__(self, cfg, laReposCache, srcdirs, extraMacros=()): | |
if version == 1: version = MigrateTo_2(db)() if version == 2: version = MigrateTo_3(db)() if version == 3: version = MigrateTo_4(db)() if version == 4: version = MigrateTo_5(db)() if version == 5: version = MigrateTo_6(db)() if version == 6: version = MigrateTo_7(db)() if version == 7: version = MigrateTo_8(db)() if ve... | if version != 0 and version < 13: | def loadSchema(db): global VERSION version = db.getVersion() logMe(1, "current =", version, "required =", VERSION) # load the current schema object list db.loadSchema() # surely there is a more better way of handling this... if version == 1: version = MigrateTo_2(db)() if version == 2: version = MigrateTo_3(db)() if v... |
if versionFilter == VERSION_FILTER_LATEST: versionsByBranch = {} for version in versionDict: versionsByBranch.setdefault(version.branch(), []).append(version) maxVersions = [ max(x) for x in versionsByBranch.itervalues() ] versionDict = dict((x, versionDict[x]) for x in maxVersions) | versionsByBranch = {} | def _merge(resultD, response): for troveName, troveVersions in response.iteritems(): d = resultD.setdefault(troveName, {}) for version, flavors in troveVersions.iteritems(): d.setdefault(version, []).extend(flavors) return resultD |
if flavorFilter == FLAVOR_FILTER_BEST: best = None for systemFlavor in defaultFlavor: mathing = [] matchScores = [] | versionsByBranch.setdefault(version.branch(), []).append((version, flavorList)) for versionDict in versionsByBranch.itervalues(): for version, flavorList in sorted(versionDict, reverse=True): if flavorFilter == FLAVOR_FILTER_BEST: best = None for systemFlavor in defaultFlavor: mathing = [] matchScores = [] if localFl... | def _merge(resultD, response): for troveName, troveVersions in response.iteritems(): d = resultD.setdefault(troveName, {}) for version, flavors in troveVersions.iteritems(): d.setdefault(version, []).extend(flavors) return resultD |
matchFlavors = [ deps.overrideFlavor(systemFlavor, x) for x in localFlavors] | matchFlavors = [] for systemFlavor in defaultFlavor: matchFlavors.extend(deps.overrideFlavor(systemFlavor, x) for x in localFlavors) | def _merge(resultD, response): for troveName, troveVersions in response.iteritems(): d = resultD.setdefault(troveName, {}) for version, flavors in troveVersions.iteritems(): d.setdefault(version, []).extend(flavors) return resultD |
matchFlavors = [systemFlavor] for f in flavorList: scores = ( (x.score(f), f) for x in matchFlavors) scores = [ x for x in scores if x[0] is not False] if scores: matchScores.append(max(scores)) if matchScores: best = max(matchScores)[1] break if best is not None: flavorList = [best] else: | matchFlavors = defaultFlavor added = False for flavor in flavorList: if flavorFilter == FLAVOR_FILTER_AVAIL: found = False for matchFlavor in matchFlavors: if matchFlavor.satisfies(flavor): found = True break if not found: continue troveTups.append((name, version, flavor)) added = True if added and versionFilter == VER... | def _merge(resultD, response): for troveName, troveVersions in response.iteritems(): d = resultD.setdefault(troveName, {}) for version, flavors in troveVersions.iteritems(): d.setdefault(version, []).extend(flavors) return resultD |
elif flavorFilter == FLAVOR_FILTER_AVAIL: if localFlavors: matchFlavors = [] for systemFlavor in defaultFlavor: matchFlavors.extend(deps.overrideFlavor(systemFlavor, x) for x in localFlavors) else: matchFlavors = defaultFlavor for flavor in flavorList: if flavorFilter == FLAVOR_FILTER_AVAIL: found = False for matchFlav... | def _merge(resultD, response): for troveName, troveVersions in response.iteritems(): d = resultD.setdefault(troveName, {}) for version, flavors in troveVersions.iteritems(): d.setdefault(version, []).extend(flavors) return resultD | |
extraJoin = "ffFlavor.flavorId = tmpQ.flavorId AND" | extraJoin = "ffFlavor.flavorId = gtlTmp.localFlavorId AND" | def _getTroveList(self, authToken, clientVersion, troveSpecs, versionType = _GTL_VERSION_TYPE_NONE, latestFilter = _GET_TROVE_ALL_VERSIONS, flavorFilter = _GET_TROVE_ALL_FLAVORS, withFlavors = False): self.log(3, versionType, latestFilter, flavorFilter) cu = self.db.cursor() singleVersionSpec = None dropTroveTable = Fa... |
order.append(nodeIdx) | def _orderDFS(compGraph, nodeIdx, seen, order): order.append(nodeIdx) seen[nodeIdx] = True for otherNode in compGraph[nodeIdx][1]: if not seen[otherNode]: _orderDFS(compGraph, otherNode, seen, order) | |
order.reverse() | def _orderComponents(compGraph): # returns a topological sort of compGraph order = [] seen = [ False ] * len(compGraph) nextIndex = 0 while (nextIndex < len(compGraph)): if not seen[nextIndex]: _orderDFS(compGraph, nextIndex, seen, order) | |
import lib lib.epdb.st() | def _orderComponents(compGraph): # returns a topological sort of compGraph order = [] seen = [ False ] * len(compGraph) nextIndex = 0 while (nextIndex < len(compGraph)): if not seen[nextIndex]: _orderDFS(compGraph, nextIndex, seen, order) | |
twmSkipList = { "inode" : True } | twmSkipList = { "contents" : True } | def _singleTrove(self, repos, pkgCs, changeSet, basePkg, fsPkg, root, flags): |
list.append(self, CfgRegExp.parseString(val)) | list.append(self, CfgRegExp().parseString(val)) | def addExp(self, val): list.append(self, CfgRegExp.parseString(val)) |
list.append(self, CfgSignedRegExp.parseString(val)) | list.append(self, CfgSignedRegExp().parseString(val)) | def addExp(self, val): list.append(self, CfgSignedRegExp.parseString(val)) |
return self.__class__(self.repos, self.sha1, self.theSize) | return self.__class__(self.store, self.sha1, self.theSize) | def copy(self): return self.__class__(self.repos, self.sha1, self.theSize) |
suggList = [ (x[0], x[1]) for x in sugg[depSet] ] | suggList = [ (x[0], x[1], None) for x in sugg[depSet] ] | def _resolveDependencies(self, cs, keepExisting = None, recurse = True): pathIdx = 0 foundSuggestions = False (depList, cannotResolve) = self.db.depCheck(cs) suggMap = {} |
raise OldDatabaseSchema, \ "The Conary database on this system is too old. " \ "For information on how\nto convert this database, " \ "please visit:\n" \ "\thttp://wiki.rpath.com/ConaryConversion" | raise OldDatabaseSchema | def __init__(self, path): |
return "Repository needs conversion for this version of conary." | return "The Conary database on this system is too old. " \ "For information on how to\nconvert this database, " \ "please visit http://wiki.rpath.com/ConaryConversion." | def __str__(self): |
if self._name == '3dnow': from lib import epdb epdb.set_trace('foo') | def _toDependency(self): """ Creates a DependencySet with the subarch in it. Also includes any subsumed subarches if the value of this subarch is true (better comment about why we do that here) """ if self._name == '3dnow': from lib import epdb epdb.set_trace('foo') set = deps.DependencySet() sense = self._getDepSense... | |
C{r.ComponentSpec(I{packagename}, I{filterexp}...)} or C{r.ComponentSpec(I{packagename:component}, I{filterexp}...)} | C{r.PackageSpec(I{packagename}, I{filterexp}...)} | def doProcess(self, recipe): |
return "%s was not on found" % name | return "%s was not found" % name | def missingMsg(self, name): # collapse all the labels searched in the queries to a unique list labelPath = set(x.keys()[0] for x in self.query[name] if x.keys()) if labelPath: return "%s was not found on path %s" \ % (name, ', '.join(x.asString() for x in labelPath)) else: return "%s was not on found" % name |
behavior; for example, if addTrove is overridden no pacakges will | behavior; for example, if addTrove is overridden no packages will | def __init__(self): |
v1 = trove1.getNewVersion().trailingRevision().asString() v2 = trove2.getNewVersion().trailingRevision().asString() | v1 = trove1.getNewVersion().trailingRevision() v2 = trove2.getNewVersion().trailingRevision() trove1Info = '(%s %s)' % (trove1.getName(), v1) trove2Info = '(%s %s)' % (trove2.getName(), v2) if path1: trove1Info = path1 + ' ' + trove1Info if path2: trove2Info = path2 + ' ' + trove2Info | def __str__(self): if self.trove1 is None: return 'PathIdsConflict: %s' % sha1helper.md5ToString(self.pathId) else: path1, path2 = self.getPaths() trove1, trove2 = self.getTroves() v1 = trove1.getNewVersion().trailingRevision().asString() v2 = trove2.getNewVersion().trailingRevision().asString() return (('PathIdConflic... |
' %s (%s %s)\n' | ' %s\n' | def __str__(self): if self.trove1 is None: return 'PathIdsConflict: %s' % sha1helper.md5ToString(self.pathId) else: path1, path2 = self.getPaths() trove1, trove2 = self.getTroves() v1 = trove1.getNewVersion().trailingRevision().asString() v2 = trove2.getNewVersion().trailingRevision().asString() return (('PathIdConflic... |
' %s (%s %s)') % (path1, trove1.getName(), v1, path2, trove2.getName(), v2)) | ' %s') % (trove1Info, trove2Info)) | def __str__(self): if self.trove1 is None: return 'PathIdsConflict: %s' % sha1helper.md5ToString(self.pathId) else: path1, path2 = self.getPaths() trove1, trove2 = self.getTroves() v1 = trove1.getNewVersion().trailingRevision().asString() v2 = trove2.getNewVersion().trailingRevision().asString() return (('PathIdConflic... |
conflict1 = [ x for x in \ myTrove.getNewFileList() if x[0] == pathId] | files = (myTrove.getNewFileList() + myTrove.getChangedFileList()) conflict1 = [ x for x in files if x[0] == pathId] | def merge(self, otherCs): self.files.update(otherCs.files) |
conflict2 = [ x for x in \ otherTrove.getNewFileList() if x[0] == pathId] | files = (otherTrove.getNewFileList() + otherTrove.getChangedFileList()) conflict2 = [ x for x in files if x[0] == pathId] | def merge(self, otherCs): self.files.update(otherCs.files) |
cu.execute("""UPDATE TroveInfo SET data='1.0' WHERE hex(data)='31' AND infotype=3""") cu.execute("""UPDATE Dependencies SET flag='1.0' WHERE name LIKE 'conary%' AND flag='1'"""); | def migrate(self): import tempfile import os from conary import dbstore | |
(path, newVersion) = pkg.getFile(fileId) invertedPkg.changedFile(fileId, path, version) (oldVersion, ver, csInfo) = pkgCs.getFile(fileId) assert(oldVersion.equal(ver)) | (curPath, curVersion) = pkg.getFile(fileId) invertedPkg.changedFile(fileId, curPath, curVersion) (oldVersion, newVersion, csInfo) = self.getFile(fileId) assert(curVersion.equal(oldVersion)) | def invert(self, repos): |
file.setVersion(newVersion) file.applyChange(csInfo) inversion.addFile(fileId, newVersion, oldVersion, old.diff(new)) | newFile.applyChange(csInfo) inversion.addFile(fileId, newVersion, oldVersion, origFile.diff(newFile)) | def invert(self, repos): |
raise AttributeError, "No Such Use Flag %s" % flag | if error: raise AttributeError( "No Such Use Flag %s" % flag) else: continue | def setBuildFlagsFromFlavor(recipeName, flavor, error=True): """ Sets the truth of the build Flags based on the build flavor. All the set build flags must already exist. Flags not mentioned in this flavor will be untouched. XXX should this create flags as well as set them? Problem with that is that we don't know whet... |
for line in hunk.lines: if line[0] == " ": if oldLines[fromLine] != line[1:]: raise Conflict() result.append(oldLines[fromLine]) fromLine = fromLine + 1 elif line[0] == "+": result.append(line[1:]) elif line[0] == "-": fromLine = fromLine + 1 | result += hunk.apply(oldLines[fromLine:]) fromLine += hunk.fromLen | def patch(oldLines, unifiedDiff): i = 0 last = len(unifiedDiff) hunks = [] while i < last: (magic1, fromRange, toRange, magic2) = unifiedDiff[i].split() if magic1 != "@@" or magic2 != "@@" or fromRange[0] != "-" or \ toRange[0] != "+": raise BadHunkHeader() (fromStart, fromLen) = fromRange.split(",") fromStart = int(f... |
def getFileContents(self, authToken, clientVersion, troveName, troveVersion, fileId, fileVersion): | def getFileContents(self, authToken, clientVersion, troveName, troveFlavor, troveVersion, fileId, fileVersion = None): | def getFileContents(self, authToken, clientVersion, troveName, troveVersion, fileId, fileVersion): if clientVersion <= 8: path = fileId fileId = None else: path = None fileId = self.toFileId(fileId) |
if (self.sourceCount.shadowCount() and [ x for x in self.sourceCount.iterCounts()][i] == 0): | shadowCounts = list(self.sourceCount.iterCounts()) if len(shadowCounts) >= shadowLength and shadowCounts[i] == 0: | def shadowChangedUpstreamVersion(self, shadowLength): """ returns True if this revision is a) on a shadow and b) the parent branch's source count is 0, implying that the upstream version # has been changed """ i = shadowLength - 1 if (self.sourceCount.shadowCount() and [ x for x in self.sourceCount.iterCounts()][i] == ... |
if os.path.isdir(path): | if os.path.isdir(path) and not os.path.islink(path): | def remove(paths): for path in braceGlob(paths): if os.path.isdir(path): log.warning('Not removing directory %s', path) elif os.path.exists(path) or os.path.islink(path): log.debug('deleting [file] %s', path) os.remove(path) else: log.warning('file %s does not exist when attempting to delete [file]', path) |
jobSets = [ sorted((self.nodes[x][0], x) for x in idxSet) for idxSet in compSets ] | jobSets = [ sorted((self.nodes[nodeIdx][0], nodeIdx) for nodeIdx in idxSet) for idxSet in compSets ] | def orderJobSets(jobSetA, jobSetB): AHasInfo = 0 BHasInfo = 0 for comp, idx in jobSetA: if comp[0].startswith('info-'): AHasInfo = 1 break for comp, idx in jobSetB: if comp[0].startswith('info-'): BHasInfo = 1 break |
for childNodeIdx in self.g.getChildren(nodeIdx): | for childNodeIdx in self.g.iterChildren(nodeIdx): | def orderJobSets(jobSetA, jobSetB): AHasInfo = 0 BHasInfo = 0 for comp, idx in jobSetA: if comp[0].startswith('info-'): AHasInfo = 1 break for comp, idx in jobSetB: if comp[0].startswith('info-'): BHasInfo = 1 break |
orderedComponents = sccGraph.getTotalOrdering(nodeSort=lambda a, b: a[1] < b[1]) | orderedComponents = sccGraph.getTotalOrdering( nodeSort=lambda a, b: cmp(a[1], b[1])) | def orderJobSets(jobSetA, jobSetB): AHasInfo = 0 BHasInfo = 0 for comp, idx in jobSetA: if comp[0].startswith('info-'): AHasInfo = 1 break for comp, idx in jobSetB: if comp[0].startswith('info-'): BHasInfo = 1 break |
monodisPath = None | def _getmonodis(macros, recipe, path): # For bootstrapping purposes, prefer the just-built version if # it exists if os.access('%(destdir)s/%(monodis)s' %macros, os.X_OK): return ('MONO_PATH=%(destdir)s%(prefix)s/lib' ' LD_LIBRARY_PATH=%(destdir)s%(libdir)s' ' %(destdir)s/%(monodis)s' %macros) elif os.access('%(monodis... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.