rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
for flag in self['Arch'].iterkeys(): stringDeps.extend(self['Arch'][flag].toDepStrings()) dep = deps.Dependency('is', stringDeps) set.addDep(deps.InstructionSetDependency, dep)
for arch, topflag in self['Arch'].iteritems(): stringDeps = [] for subarch, flag in topflag.iteritems(): stringDeps.extend(flag.toDepStrings(topflag=topflag)) dep = deps.Dependency(arch, stringDeps) set.addDep(deps.InstructionSetDependency, dep)
def toDependency(self): """ Convert this flag set to a list of dependencies """ # XXX this code should probably disappear with the reworking of # flavors and their relationship with deps, but for now, # it is very handy set = deps.DependencySet() useflagsets = [] if self._name != '__GLOBAL__': self = self.asSet() if 'U...
def toDepStrings(self, prefix=None):
def toDepStrings(self, prefix=None, topflag=None):
def toDepStrings(self, prefix=None): strings = [] if prefix: prefix = '.'.join([prefix, self._name]) else: prefix = self._name if self._value is not None: if self._value: if self._required: strings.append(prefix) else: strings.append('~' + prefix) else: strings.append('~!' + prefix) for subflag in self.iterkeys(): stri...
prefix = '.'.join([prefix, self._name]) else: prefix = self._name
name = '.'.join((prefix, name))
def toDepStrings(self, prefix=None): strings = [] if prefix: prefix = '.'.join([prefix, self._name]) else: prefix = self._name if self._value is not None: if self._value: if self._required: strings.append(prefix) else: strings.append('~' + prefix) else: strings.append('~!' + prefix) for subflag in self.iterkeys(): stri...
strings.append(prefix)
strings.append(name)
def toDepStrings(self, prefix=None): strings = [] if prefix: prefix = '.'.join([prefix, self._name]) else: prefix = self._name if self._value is not None: if self._value: if self._required: strings.append(prefix) else: strings.append('~' + prefix) else: strings.append('~!' + prefix) for subflag in self.iterkeys(): stri...
strings.append('~' + prefix)
strings.append('~' + name)
def toDepStrings(self, prefix=None): strings = [] if prefix: prefix = '.'.join([prefix, self._name]) else: prefix = self._name if self._value is not None: if self._value: if self._required: strings.append(prefix) else: strings.append('~' + prefix) else: strings.append('~!' + prefix) for subflag in self.iterkeys(): stri...
strings.append('~!' + prefix)
strings.append('~!' + name)
def toDepStrings(self, prefix=None): strings = [] if prefix: prefix = '.'.join([prefix, self._name]) else: prefix = self._name if self._value is not None: if self._value: if self._required: strings.append(prefix) else: strings.append('~' + prefix) else: strings.append('~!' + prefix) for subflag in self.iterkeys(): stri...
strings.extend(self[subflag].toDepStrings(prefix=prefix))
strings.extend( self[subflag].toDepStrings(prefix=prefix, topflag=topflag))
def toDepStrings(self, prefix=None): strings = [] if prefix: prefix = '.'.join([prefix, self._name]) else: prefix = self._name if self._value is not None: if self._value: if self._required: strings.append(prefix) else: strings.append('~' + prefix) else: strings.append('~!' + prefix) for subflag in self.iterkeys(): stri...
self[name] = Flag(value=None, name=name, ref=self, createOnAccess=True)
self[name] = Flag(value=None, name=name, parent=self, createOnAccess=True, track=self._track) if self._track: self._usedFlags[name] = flag
def __getattr__(self, name): if name in self.__dict__: return self.__dict__[name] if name in self: flag = self[name] if self._track: self._usedFlags[name] = flag return flag elif self._createOnAccess: # flag doesn't exist, add it self[name] = Flag(value=None, name=name, ref=self, createOnAccess=True) return self[name] ...
self[name] = Flag(value=value, name=name, ref=self, createOnAccess=self._createOnAccess)
self[name] = Flag(value=value, name=name, parent=self, createOnAccess=self._createOnAccess, track=self._track)
def __setattr__(self, name, value): initialized = self.__dict__.get('_initialized', False) # this allows us to add instance variables during __init__ if not initialized: self.__dict__[name] = value return # after init, only set instance variables that already exist if name in self.__dict__: self.__dict__[name] = value ...
print prompt + ' ', sys.stdout.flush() resp = raw_input() if resp.lower() in ('y', 'yes'):
try: resp = raw_input(prompt + ' ') except EOFError: return False resp = resp.lower() if resp in ('y', 'yes'):
def askYn(prompt, default=None): while True: print prompt + ' ', sys.stdout.flush() resp = raw_input() if resp.lower() in ('y', 'yes'): return True elif resp in ('n', 'no'): return False elif not resp: return default else: print "Unknown response '%s'." % resp
bld(builddir + "/" + self.mainDir())
bld.doBuild(builddir + "/" + self.mainDir())
def doBuild(self, builddir): if self.build is None: pass elif type(self.build) == types.TupleType: for bld in self.build:
for file in sorted(self.debugfiles): builddirpath = '%(topbuilddir)s/' % self.dm +file dir = os.path.dirname(file)
for filename in sorted(self.debugfiles): builddirpath = '%(topbuilddir)s/' % self.dm +filename dir = os.path.dirname(filename)
def postProcess(self): if self.debuginfo: for file in sorted(self.debugfiles): builddirpath = '%(topbuilddir)s/' % self.dm +file dir = os.path.dirname(file) util.mkdirChain('%(destdir)s%(debugsrcdir)s/'%self.dm +dir) try: shutil.copy2(builddirpath, '%(destdir)s%(debugsrcdir)s/'%self.dm +file) except IOError, msg: if ms...
shutil.copy2(builddirpath, '%(destdir)s%(debugsrcdir)s/'%self.dm +file)
targetfile = '%(destdir)s%(debugsrcdir)s/'%self.dm +filename shutil.copy2(builddirpath, targetfile) os.chmod(targetfile, 0644)
def postProcess(self): if self.debuginfo: for file in sorted(self.debugfiles): builddirpath = '%(topbuilddir)s/' % self.dm +file dir = os.path.dirname(file) util.mkdirChain('%(destdir)s%(debugsrcdir)s/'%self.dm +dir) try: shutil.copy2(builddirpath, '%(destdir)s%(debugsrcdir)s/'%self.dm +file) except IOError, msg: if ms...
@keyword dir: If specified, the subdirectory in which to unpack the sources, relative to C{%(builddir)s}; defaults to C{%(maindir)s}
@keyword dir: The directory to change to unpack the sources. Relative dirs are relative to C{%(builddir)s}. Absolute dirs are relative to C{%(destdir)s}.
def __init__(self, recipe, *args, **keywords):
self.dest = os.path.basename(dest) else: self.dest = os.path.basename(self.sourcename)
self.dest = os.path.basename(dest %self.recipe.macros) else: self.dest = os.path.basename(self.sourcename)
def __init__(self, recipe, sourcename, rpm='', dir='', keyid=None, use=None, apply='', macros=False, dest=None):
pout = file(os.sep.join((destDir, self.dest %self.recipe.macros)), "w")
pout = file(os.sep.join((destDir, self.dest)), "w")
def doUnpack(self):
util.copyfile(f, os.sep.join((destDir, self.dest %self.recipe.macros)))
util.copyfile(f, os.sep.join((destDir, self.dest)))
def doUnpack(self):
def _restore(self, fileObj, target, msg, contentsOverride = ""): self.restores.append((fileObj.pathId(), fileObj, target, contentsOverride, msg))
def _restore(self, fileObj, target, troveInfo, msg, contentsOverride = "", replaceFiles = False): if target in self.restores: pathId = self.restores[target][0] troveInfo = self.restores[target][4] if not replaceFiles: self.errors.append(DatabasePathConflictError( util.normpath(target), troveInfo[0], troveInfo[1], trov...
def _restore(self, fileObj, target, msg, contentsOverride = ""):
restores = self.restores[:]
restores = [ (x[1][0], x[1][1], x[0], x[1][2], x[1][3]) for x in self.restores.iteritems() ]
def restoreFile(fileObj, contents, root, target, journal): if fileObj.hasContents and contents and not \ fileObj.flags.isConfig(): # config file sha1's are verified when they get inserted # into the config file cache d = sha.new() fileObj.restore(contents, root, target, journal=journal, digest = d) assert(d.digest() ==...
if fileConflict and (flags & REPLACEFILES):
if fileConflict and replaceFiles:
def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags):
self._restore(headFile, headRealPath, "creating %s")
self._restore(headFile, headRealPath, newTroveInfo, "creating %s", replaceFiles = replaceFiles)
def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags):
elif flags & REPLACEFILES or baseFile.lsTag == fsFile.lsTag:
elif replaceFiles or baseFile.lsTag == fsFile.lsTag:
def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags):
if flags & REPLACEFILES:
if replaceFiles:
def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags):
elif forceUpdate or (flags & REPLACEFILES) or \
elif forceUpdate or replaceFiles or \
def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags):
self._restore(fsFile, realPath,
self._restore(fsFile, realPath, newTroveInfo,
def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags):
contentsOverride = headFileContents)
contentsOverride = headFileContents, replaceFiles = replaceFiles)
def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags):
"from repository")
"from repository", replaceFiles = replaceFiles)
def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags):
contentsOverride = cont)
contentsOverride = cont, replaceFiles = replaceFiles)
def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags):
contentsOverride = None)
contentsOverride = None, replaceFiles = replaceFiles)
def _singleTrove(self, repos, troveCs, changeSet, baseTrove, fsTrove, root, removalHints, flags):
self.restores = []
self.restores = {}
def __init__(self, db, changeSet, fsTroveDict, root, callback = None,
def ThawDependency(frozen): l = frozen.split(":") flags = [] if len(l) > 1: flags = l[1].split(',') d = Dependency(l[0], flags) if not dependencyCache.has_key(d): dependencyCache[d] = d return dependencyCache[d]
def ThawDependency(frozen): l = frozen.split(":") flags = [] if len(l) > 1: flags = l[1].split(',') d = Dependency(l[0], flags) if not dependencyCache.has_key(d): dependencyCache[d] = d return dependencyCache[d]
coreQdict["domain"] = """JOIN Latest AS Domain USING (itemId) JOIN Nodes USING (itemId, branchId, versionId)"""
coreQdict["domain"] = """\ JOIN Latest AS Domain USING (itemId) JOIN Nodes USING (itemId, branchId, versionId) """
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...
JOIN Nodes USING (itemId, versionid)"""
JOIN Nodes ON Domain.itemId = Nodes.itemId AND Domain.versionId = Nodes.versionId """
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...
pkg.changeOldVersion(self.repos.getFullVersion(pkg.getName(), pkg.getOldVersion()))
if pkg.getOldVersion(): pkg.changeOldVersion(self.repos.getFullVersion(pkg.getName(), pkg.getOldVersion()))
def newPackage(self, pkg):
cu.execute("DROP INDEX PermissionsIdx") cu.execute("CREATE UNIQUE INDEX PermissionsIdx ON "
self.cu.execute("DROP INDEX PermissionsIdx") self.cu.execute("CREATE UNIQUE INDEX PermissionsIdx ON "
def migrate(self): ## First insert the new Item and Label keys self.cu.execute("INSERT INTO Items (itemId, item) VALUES(0, 'ALL')") self.cu.execute("INSERT INTO Labels (labelId, label) VALUES(0, 'ALL')")
from conary.lib.tracelog import printErr printErr(""" Conversion to version 4 requires script available from http://wiki.rpath.com/ConaryConversion """) return 0
import itertools from conary.local import deptable from conary.deps import deps class FakeTrove: def setRequires(self, req): self.r = req def setProvides(self, prov): self.p = prov def getRequires(self): return self.r def getProvides(self): return self.p def __init__(self): self.r = deps.DependencySet() self.p = deps....
def migrate(self): from conary.lib.tracelog import printErr printErr(""" Conversion to version 4 requires script available from http://wiki.rpath.com/ConaryConversion """) return 0
logMe(3, "add changed column and triggers to", table) self.cu.execute("ALTER TABLE %s ADD COLUMN " "changed NUMERIC(14,0) NOT NULL DEFAULT 0" % table)
try: self.cu.execute("ALTER TABLE %s ADD COLUMN " "changed NUMERIC(14,0) NOT NULL DEFAULT 0" % table) logMe(3, "add changed column and triggers to", table) except sqlerrors.DuplicateColumnName: pass
def migrate(self): # these views will have to be recreated because of the changed column names if "UserPermissions" in self.db.views: self.cu.execute("DROP VIEW UserPermissions") if "UsersView" in self.db.views: self.cu.execute("DROP VIEW UsersView") # drop oldLatest - obsolete table from many migrations ago if "oldLat...
inPristine, changed
changed
def migrate(self): cu = self.cu cu.execute(""" CREATE TABLE TroveTroves2( instanceId INTEGER NOT NULL, includedId INTEGER NOT NULL, flags INTEGER NOT NULL DEFAULT 0, changed NUMERIC(14,0) NOT NULL DEFAULT 0, CONSTRAINT TroveTroves_instanceId_fk FOREIGN KEY (instanceId) REFERENCES Instances(i...
content_type = url.info()['content-type']
content_tpye = None if not name.startswith('ftp://'): content_type = url.info()['content-type']
def fetchURL(cfg, name, location, httpHeaders={}, guessName=None, mirror=None): retries = 0 url = None mirror = mirror or name # check for negative cache entries to avoid spamming servers negativeName = _createNegativeCacheName(cfg, name, location) if os.path.exists(negativeName): if time.time() > 60*60 + os.path.get...
if not autoSource and not suffixes and not guessName and '/' not in name:
if not autoSource and not suffixes and not guessName and not name.startswith('/'):
def findAll(cfg, repCache, name, location, srcdirs, autoSource=False, httpHeaders={}, localOnly=False, guessName=None, suffixes=None, allowNone=False): """ searches all locations, including populating the cache if the file can't be found in srcdirs, and returns the name of the file. autoSource should be True when the ...
troveTups = [x[1] for x in scores if x[0] == maxScore ]
troveTups = [x for x in scores if x[0] == maxScore ]
def getBestLoadRecipeChoices(labelPath, troveTups): """ These labels all match the given labelPath. We score them based on the number of matching labels in the label path, and return the one that's "best". The following rules should apply: - If the labelPath is [bar, foo] and you are choosing between /foo/bar/ and /fo...
return troveTups
return [x[1] for x in troveTups]
def getBestLoadRecipeChoices(labelPath, troveTups): """ These labels all match the given labelPath. We score them based on the number of matching labels in the label path, and return the one that's "best". The following rules should apply: - If the labelPath is [bar, foo] and you are choosing between /foo/bar/ and /fo...
for troveTup in troveTups:
for score, troveTup in troveTups:
def getBestLoadRecipeChoices(labelPath, troveTups): """ These labels all match the given labelPath. We score them based on the number of matching labels in the label path, and return the one that's "best". The following rules should apply: - If the labelPath is [bar, foo] and you are choosing between /foo/bar/ and /fo...
byBranch[branch] = max(byBranch[branch], troveTup) return byBranch.values()
byBranch[branch] = max(byBranch[branch], (score, troveTup)) else: byBranch[branch] = (score, troveTup) return [x[1] for x in byBranch.itervalues()]
def getBestLoadRecipeChoices(labelPath, troveTups): """ These labels all match the given labelPath. We score them based on the number of matching labels in the label path, and return the one that's "best". The following rules should apply: - If the labelPath is [bar, foo] and you are choosing between /foo/bar/ and /fo...
pkgs = sorted(pkgs) raise builderrors.LoadRecipeError( "source component %s has multiple versions " "on labelPath %s: %s" %(component, ', '.join(x.asString() for x in labelPath), ', '.join('%s=%s' % x[:2] for x in pkgs)))
pkgs = sorted(pkgs, reverse=True) log.warning("source component %s has multiple versions " "on labelPath %s\n\nPicking latest: \n %s\n\nNot using:\n %s" %(component, ', '.join(x.asString() for x in labelPath), '%s=%s' % pkgs[0][:2], '\n '.join('%s=%s' % x[:2] for x in pkgs[1:])))
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...
negativeEntry = createCacheName(name, location, 'NEGATIVE/')
negativeEntry = createCacheName(cfg, name, location, 'NEGATIVE/')
def createNegativeCacheEntry(cfg, name, location): negativeEntry = createCacheName(name, location, 'NEGATIVE/') open(negativeEntry, "w+").close()
return searchCache(name, location)
return searchCache(cfg, name, location)
def searchCache(cfg, name, location): basename = os.path.basename(name) if name.startswith("http://") or name.startswith("ftp://"): # check for negative cache entries to avoid spamming servers negativeName = '%s/NEGATIVE/%s/%s' %(cfg.lookaside, location, name[5:]) if os.path.exists(negativeName): if time.time() > 60*...
class LookAside(file): def __init__(cfg, name, location, srcdirs, buffered=-1): f = findAll(cfg, name, location, srcdirs) file.__init__(self, f, "r", buffered)
def findAll(cfg, repcache, name, location, srcdirs): f = searchAll(cfg, repcache, name, location, srcdirs) if not f: raise OSError, (errno.ENOENT, os.strerror(errno.ENOENT)) return f
if not kwards['auth'].isInternal:
if not kwargs['auth'].isInternal:
def wrapper(self, **kwargs): if not kwards['auth'].isInternal: raise PermissionDenied else: return func(self, **kwargs)
return self.__class__(fc, hunks)
return self.__class__(self.fc, self.hunks)
def copy(self): return self.__class__(fc, hunks)
self.files[path] = version
self.files["/files" + path] = version
def addFile(self, path, version):
for item in self.files.items(): l.append(item)
for (path, file) in self.files.items(): l.append((path[6:], file))
def fileList(self):
self.addFile(path, version)
self.addFile(path[6:], version)
def read(self, dataFile):
repos = helper.openRepository(cfg.repPath)
repos = helper.openRepository(cfg.repositoryMap, cfg.repPath)
def cookCommand(cfg, args, prep, macros, buildBranch = None): # this ensures the repository exists repos = helper.openRepository(cfg.repPath) for item in args: # we want to fork here to isolate changes the recipe might make # in the environment (such as environment variables) signal.signal(signal.SIGTTOU, signal.SIG_I...
recipeObj.unpackSources(builddir) if prep: return cwd = os.getcwd() util.mkdirChain(builddir + '/' + recipeObj.mainDir()) try: os.chdir(builddir + '/' + recipeObj.mainDir()) util.mkdirChain(cfg.tmpDir) destdir = tempfile.mkdtemp("", "conary-%s-" % recipeObj.name, cfg.tmpDir) recipeObj.doBuild(builddir, destdir) log...
def cookPackageObject(repos, cfg, recipeClass, buildBranch, prep=True, macros={}): """ Turns a package recipe object into a change set. Returns the absolute changeset created, a list of the names of the packages built, and and a tuple with a function to call and its arguments, which should be called when the build root...
if path.startswith(self.tmpDir): os.unlink(path)
def _writeNestedFile(outF, name, tag, size, f, sizeCb): if changeset.ChangedFileTypes.refr[4:] == tag[2:]: path = f.read() size = os.stat(path).st_size f = open(path) tag = tag[0:2] + changeset.ChangedFileTypes.file[4:]
shutil.rmtree(self.contentsDir)
shutil.rmtree(self.contentsDir[0])
def reset(self, authToken, clientVersion): import shutil try: shutil.rmtree(self.contentsDir) except OSError, e: if e.errno != errno.ENOENT: raise os.mkdir(self.contentsDir)
os.mkdir(self.contentsDir) logMe(1, "resetting NetworkRepositoryServer", self.repDB)
os.mkdir(self.contentsDir[0])
def reset(self, authToken, clientVersion): import shutil try: shutil.rmtree(self.contentsDir) except OSError, e: if e.errno != errno.ENOENT: raise os.mkdir(self.contentsDir)
self.createUsers()
def reset(self, authToken, clientVersion): import shutil try: shutil.rmtree(self.contentsDir) except OSError, e: if e.errno != errno.ENOENT: raise os.mkdir(self.contentsDir)
netRepos = NetworkRepositoryServer(cfg, baseUrl)
netRepos = ResetableNetworkRepositoryServer(cfg, baseUrl)
def addUser(netRepos, userName, admin = False, mirror = False): if os.isatty(0): from getpass import getpass pw1 = getpass('Password:') pw2 = getpass('Reenter password:') if pw1 != pw2: print "Passwords do not match." return 1 else: # chop off the trailing newline pw1 = sys.stdin.readline()[:-1] # never give anonymo...
for (what, isVer) in [ ('name', 0), ('version', 1), ('branch', 1) ]: line = lines[0][:-1]
while lines: fields = lines[0][:-1].split() if len(fields) == 1: break assert(len(fields) == 2)
def parseFile(self, filename):
fields = line.split() assert(len(fields) == 2) assert(fields[0] == what)
what = fields[0] assert(not kwargs.has_key(what)) isVer = self.fields[what][0]
def parseFile(self, filename):
required = set(('name', 'version', 'branch'))
required = set([ x[0] for x in self.fields.items() if x[1][1] ])
def parseFile(self, filename):
branch = version.branch() if branch.hasParentBranch(): parent = branch.parentBranch() else: parent = None
def diff(self, them, absolute = 0):
sameBranch = None
parentBranch = None if version.hasParentVersion(): parentVersion = version.parentVersion() else:
def diff(self, them, absolute = 0):
childNode = None childBranch = None for other in oldVersionList: if other.branch() == branch: sameBranch = other if parent and other == parent: parentVersion = other if other.hasParentVersion(): if other.parentVersion() == version: childNode = other if other.branch().hasParentBranch(): if other.branch().parentBranch()...
sameBranches = [] parentBranches = [] childBranches = [] parentNodes = [] childNodes = [] for other in oldVersionList: if other.branch() == branch: sameBranches.append(other) if parentVersion and other == parentVersion: parentNodes.append(other) if parentBranch and other.branch() == parentBranch: parentBranches.append...
def diff(self, them, absolute = 0):
newCs = self.repos.createChangeSet(changedTroves.keys(), recurse = False, callback = callback) cs.merge(newCs) return newCs
if changedTroves: newCs = self.repos.createChangeSet(changedTroves.keys(), recurse = False, callback = callback) cs.merge(newCs) return cs
def _createCs(theCs, uJob, standalone = False): assert(not standalone or isinstance(theCs, changeset.ReadOnlyChangeSet)) cs = changeset.ReadOnlyChangeSet()
assert(self.__class__ is not BuildCommand)
assert(self.__class__ is not BuildAction)
def __init__(self, *args, **keywords):
verList = [ v for v in branchVerList[branch] if not v.isAfter(curVersion)]
verList = [ v for v in branchVerList[branch] \ if not v.isAfter(curVersion)]
def annotate(repos, filename): try: state = SourceStateFromFile("CONARY") except OSError: return curVersion = state.getVersion() branch = state.getBranch() troveName = state.getName() labelVerList = repos.getTroveVersionsByBranch( {troveName: { branch : None}})[troveName] labelVerList = labelVerList.keys() # sort verL...
yield "Version :", v
yield "Version : %s" %v
def formatInfo(self, trove): """ returns iteratore of format lines about this local trove """ # TODO: it'd be nice if this were set up to do arbitrary # formats...
@param targetBranchLabel: versions.BranchName
@type targetBranchLabel: versions.BranchName
def setTargetBranch(self, repos, targetBranchLabel):
C{r.addArchive('mirror://sourceforge/%(name)s/%(name)s-%(version)s.tar.gz', keyid='9BB19A22')
C{r.addArchive('mirror://sourceforge/%(name)s/%(name)s-%(version)s.tar.gz', keyid='9BB19A22')}
def do(self):
localRepository = self.db,
localRepository = db,
def createRepos(self, db, cfg, passwordPrompter=None, userMap=None): if self.repos: if passwordPrompter is None: passwordPrompter = self.repos.getPwPrompt() if userMap is None: userMap = self.repos.getUserMap() else: if passwordPrompter is None: passwordPrompter = password.getPassword if userMap is None: userMap = cfg....
except:
except Exception, e:
def resetTable(cu, name): try: cu.execute("DELETE FROM %s" % name, start_transaction = False) return True except: return False
template = ('cd %%s; aclocal %%s ; %(preAutoconf) autoconf %(autoConfArgs); automake %(autoMakeArgs)' ' %(args)s')
template = ('cd %%s; aclocal %%s ; %(preAutoconf)s autoconf %(autoConfArgs)s; automake %(autoMakeArgs)s %(args)s')
def execute(self, command): print '+', command rc = os.system(command) if rc: raise RuntimeError, ('Shell command "%s" returned ' 'non-zero status %d' % (command, rc))
('test', ('%(testdir)s/')), ('debuginfo', ('%(debugsrcdir)s/', '%(debuglibdir)s/')),
def updateArgs(self, *args, **keywords):
for (filteritem) in self.extraFilters + list(self.baseFilters):
for filteritem in list(self.invariantFilters) + self.extraFilters + list(self.baseFilters):
def doProcess(self, recipe):
yield ' ', l
yield ' ' + l
def formatDeps(self, trove): for name, dep in (('Provides', trove.getProvides()), ('Requires', trove.getRequires())): yield ' %s:' %name if not dep: yield ' None' else: lines = str(dep).split('\n') for l in lines: yield ' ', l yield ''
util.execute('gunzip %s; gzip -n -9 %s' %(syspath, syspath[:-3])
util.execute('gunzip %s; gzip -n -9 %s' %(syspath, syspath[:-3]))
def do(self):
util.execute('bunzip2 %s; gzip -n -9 %s' %(syspath, syspath[:-4])
util.execute('bunzip2 %s; gzip -n -9 %s' %(syspath, syspath[:-4]))
def do(self):
return self.items.iterkeys()
for (item,) in cu: return item
def iterTroveNames(self): cu = self.db.cursor() cu.execute("SELECT DISTINCT item FROM Instances NATURAL JOIN " "Items WHERE isPresent=1");
raise RuntimeError, 'key %s already has an alias' % key
raise RuntimeError, 'key %s already has an alias' % realKey
def _addAlias(self, realKey, alias): """ Add a second way to access the given item. Necessary if the actual name for a flag is not a valid python identifier. """ if alias in self or alias in self._attrs: raise RuntimeError, 'alias is already set' elif self[realKey]._alias: raise RuntimeError, 'key %s already has an ali...
if name in local_scope: if name.__class__.__name__ == 'ModuleProxy': local_scope[name] = mod elif name in global_scope: if name.__class__.__name__ == 'ModuleProxy': global_scope[name] = mod
moduleParts = name.split('.') names = [ '.'.join(moduleParts[-x:]) for x in range(len(moduleParts)) ] for modulePart in names: if modulePart in local_scope: if local_scope[modulePart].__class__.__name__ == 'ModuleProxy': if pathname in repr(local_scope[modulePart]): local_scope[modulePart] = mod if modulePart in glo...
def _loadModule(): """ Load the given module, and insert it into the parent scope, and also the original importing scope. """
return "<moduleProxy '%s' from '%s'>" % (name, data[1])
return "<moduleProxy '%s' from '%s'>" % (name, pathname)
def __repr__(self): return "<moduleProxy '%s' from '%s'>" % (name, data[1])
lcache.addFileHash(path, f.sha1())
lcache.addFileHash(path, f.contents.sha1())
def populate(self, repos, lcache, pkg):
*** Receiving this message is always a due to a bug in conary, not
*** Receiving this message is always due to a bug in conary, not
def findFile(file, searchdirs): return searchFile(file, searchdirs, error=1)
return (True, ("RepositoryClosed", self.cfg.closed))
return (False, True, ("RepositoryClosed", self.cfg.closed))
def callWrapper(self, *args): return (True, ("RepositoryClosed", self.cfg.closed))
"conver this database, please visit " \
"convert this database, please visit " \
def __init__(self, path):
self.localgpgfile = lookaside.searchAll(self.cfg, self.laReposCache, gpg, self.name, self.srcdirs)
self.localgpgfile = lookaside.searchAll(self.recipe.cfg, self.recipe.laReposCache, self.gpg, self.recipe.name, self.recipe.srcdirs) if self.localgpgfile: return
def _addSignature(self): for suffix in ('sig', 'sign', 'asc'): self.gpg = '%s.%s' %(self.sourcename, suffix) self.localgpgfile = lookaside.searchAll(self.cfg, self.laReposCache, gpg, self.name, self.srcdirs)
affTroveList = [] * len(choiceList)
affTroveList = [[]] * len(choiceList)
def _resolveDependencies(self, cs, keepExisting = None, depsRecurse = True): pathIdx = 0 foundSuggestions = False (depList, cannotResolve) = self.db.depCheck(cs)[0:2] suggMap = {}
test = argSet.pop("test")
test = argSet.pop("test", False)
def runCommand(self, repos, cfg, argSet, args, profile = False, callback = None): level = log.getVerbosity() if level > log.INFO: log.setVerbosity(log.INFO) message = argSet.pop("message", None) test = argSet.pop("test") sourceCheck = True
cu.execute("SELECT * FROM Entitlements WHERE entGroupId = ? AND entitlement = ?"
cu.execute("SELECT * FROM Entitlements WHERE entGroupId = ? AND entitlement = ?",
def addEntitlement(self, authToken, entGroup, entitlement): cu = self.db.cursor() # validate the password
self._markItem(path, thing)
self._markItem(path, item)
def doFile(self, path):
ON DELETE CASCADE ON UPDATE CASCADE,
ON DELETE CASCADE ON UPDATE CASCADE
def __init__(self, db): cu = db.cursor() cu.execute("SELECT tbl_name FROM sqlite_master WHERE type='table'") tables = [ x[0] for x in cu ] if "FlavorScores" not in tables: cu.execute(""" CREATE TABLE FlavorScores( request INTEGER, present INTEGER, value INTEGER NOT NULL DEFAULT -1000000, CONST...
del(self.packages[i])
del(self.packages[name][i]) if not self.packages[name]: del self.packages[name]
def applyChangeSet(self, pkgCS):
verList.append((op, v)) self.addPackage(name, verList)
assert(op == "+" or op == "-") if op == "+": self.newPackageVersion(name, v) else: self.oldPackageVersion(name, v)
def parse(self, line):
list = [ "p " + x[0] + x[1].freeze() for x in self.packages[name] ] lines.append(name + " " + " ".join(list)) rc += "\n".join(lines) + "\n"
list = [ x[0] + x[1].freeze() for x in self.packages[name] ] lines.append("p " + name + " " + " ".join(list)) if lines: rc += "\n".join(lines) + "\n"
def freeze(self):
items = ", ".join([("%r: %r" % (k,v)) for k,v in self.iteritems()])
items = ", ".join([("%r: %r" % (k,v)) for k,v in self.dict.itervalues()])
def __repr__(self): items = ", ".join([("%r: %r" % (k,v)) for k,v in self.iteritems()]) return "{%s}" % items
self.publicPaths = [ '/etc/conary/pubring.gpg' ] self.privatePath = None else: self.publicPaths = [ os.environ['HOME'] + '/.gnupg/pubring.gpg', '/etc/conary/pubring.gpg' ]
self.publicPaths = [ '/etc/conary/pubring.gpg' ] self.trustDbPaths = [ '/etc/conary/trustdb.gpg' ] self.privatePath = None else: self.publicPaths = [ os.environ['HOME'] + '/.gnupg/pubring.gpg', '/etc/conary/pubring.gpg' ]
def __init__(self, callback = callbacks.KeyCacheCallback()): OpenPGPKeyCache.__init__(self) self.callback = callback if 'HOME' not in os.environ: self.publicPaths = [ '/etc/conary/pubring.gpg' ] self.privatePath = None else: self.publicPaths = [ os.environ['HOME'] + '/.gnupg/pubring.gpg', '/etc/conary/pubring.gpg' ] se...
trustDbPath = '/'.join(pubRing.split('/')[:-1]) + 'trustdb.gpg' self.trustDbPaths.append(trustDbPath)
trustDbPath = '/'.join(pubRing.split('/')[:-1]) + '/trustdb.gpg' self.trustDbPaths.append(trustDbPath)
def setCallback(self, callback): self.callback = callback pubRing = callback.pubRing if pubRing not in self.publicPaths: self.addPublicPath(pubRing) trustDbPath = '/'.join(pubRing.split('/')[:-1]) + 'trustdb.gpg' self.trustDbPaths.append(trustDbPath)