rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
log.error("unable to load recipe file %s: %s", state.getRecipeFileName(), str(e))
log.error("unable to load recipe file %s: %s", recipeFile, str(e))
def _getRecipeVersion(recipeFile): # load the recipe; we need this to figure out what version we're building try: loader = recipe.RecipeLoader(recipeFile) except recipe.RecipeFileError, e: log.error("unable to load recipe file %s: %s", state.getRecipeFileName(), str(e)) return None if not loader: log.error("unable to ...
log.error("unable to load a valid recipe class from %s", state.getRecipeFileName())
log.error("unable to load a valid recipe class from %s", recipeFile)
def _getRecipeVersion(recipeFile): # load the recipe; we need this to figure out what version we're building try: loader = recipe.RecipeLoader(recipeFile) except recipe.RecipeFileError, e: log.error("unable to load recipe file %s: %s", state.getRecipeFileName(), str(e)) return None if not loader: log.error("unable to ...
flavor = ?""", name, str(version), flavor.freeze())
%s""" % flavorStr, [trove._TROVEINFO_TAG_TAINTED, name, str(version)] + flavorArgs)
def troveIsTainted(self, name, version, flavor): cu = self.db.cursor()
sys.exit(1)
os._exit(1)
def _saveState(signal, f): save() sys.exit(1)
signatureKey = selectSignatureKey(cfg, sourceVersion.branch().label())
if targetLabel: signatureLabel = targetLabel else: signatureLabel = sourceVersion.branch().label() signatureKey = selectSignatureKey(cfg, signatureLabel)
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, crossCompile = None, callback = None): """ Turns a recipe object int...
binPath = os.path.dirname(sys.argv[0]) if binPath and os.path.exists(binPath + "/../conary-wrapper"): sys.path.append(os.path.realpath(binPath + "/..")) else: sys.path.append("/usr/share/conary")
import conary
def main(argv): test = False if '--test' in argv: test = True updatelist = [ ('<label>', '<name>'), ] mine = conarybugz.bugzMine('<password>', getPerson=getPerson) for label, product in updatelist: mine.mineLabel(label, product) if not test: mine.processAssignments(product)
VISITED = 0 START = 1 FINISH = 2
START = 0 FINISH = 1
def _orderGroups(self): """ Order the groups so that each group is after any group it contains. Raises an error if a cycle is found. """ # boy using a DFS for such a small graph seems like overkill. # but its handy since we're also trying to find a cycle at the same # time. children = {} groupNames = self.getGroupName...
PATH = 3
PATH = 2
def _orderGroups(self): """ Order the groups so that each group is after any group it contains. Raises an error if a cycle is found. """ # boy using a DFS for such a small graph seems like overkill. # but its handy since we're also trying to find a cycle at the same # time. children = {} groupNames = self.getGroupName...
seen = dict((x, [False, None, None, []]) for x in groupNames)
seen = dict((x, [None, None, []]) for x in groupNames)
def _orderGroups(self): """ Order the groups so that each group is after any group it contains. Raises an error if a cycle is found. """ # boy using a DFS for such a small graph seems like overkill. # but its handy since we're also trying to find a cycle at the same # time. children = {} groupNames = self.getGroupName...
if seen[groupName][VISITED]: continue
if seen[groupName][START]: continue
def _orderGroups(self): """ Order the groups so that each group is after any group it contains. Raises an error if a cycle is found. """ # boy using a DFS for such a small graph seems like overkill. # but its handy since we're also trying to find a cycle at the same # time. children = {} groupNames = self.getGroupName...
seen[groupName][VISITED] = True
def _orderGroups(self): """ Order the groups so that each group is after any group it contains. Raises an error if a cycle is found. """ # boy using a DFS for such a small graph seems like overkill. # but its handy since we're also trying to find a cycle at the same # time. children = {} groupNames = self.getGroupName...
childList = [] if children[node]: path = seen[node][PATH] + [node] for child in children[node]: if child in path: cycle = path[path.index(child):] + [child] raise RecipeFileError('cycle in groups: %s' % cycle) if not seen[child][VISITED]: childList.append(child)
if children[node]: path = seen[node][PATH] + [node] for child in children[node]: if child in path: cycle = path[path.index(child):] + [child] raise RecipeFileError('cycle in groups: %s' % cycle) if not seen[child][START]: childList.append(child)
def _orderGroups(self): """ Order the groups so that each group is after any group it contains. Raises an error if a cycle is found. """ # boy using a DFS for such a small graph seems like overkill. # but its handy since we're also trying to find a cycle at the same # time. children = {} groupNames = self.getGroupName...
seen[child] = [True, None, None, path]
seen[child] = [None, None, path]
def _orderGroups(self): """ Order the groups so that each group is after any group it contains. Raises an error if a cycle is found. """ # boy using a DFS for such a small graph seems like overkill. # but its handy since we're also trying to find a cycle at the same # time. children = {} groupNames = self.getGroupName...
to contains dicts of { version : flavorList } sets instead of
to contain dicts of { version : flavorList } sets instead of
def getTroveVersionFlavors(self, troveDict):
if first and first[-1][-1] == '\n' and \ second and second[-1][-1] == '\n':
if ((first or second) and (not first or first[-1][-1] == '\n') and (not second or second[-1][-1] == '\n')):
def fileContentsDiff(oldFile, oldCont, newFile, newCont): if fileContentsUseDiff(oldFile, newFile): first = oldCont.get().readlines() second = newCont.get().readlines() # XXX difflib (and probably our patch as well) don't work properly # for files w/o trailing newlines if first and first[-1][-1] == '\n' and \ second a...
def buildChangeSet(repos, srcVersion = None, needsHead = False):
def buildChangeSet(repos, state, srcVersion = None, needsHead = False):
def buildChangeSet(repos, srcVersion = None, needsHead = False): """ Builds a change set against the sources in the current directory and builds an in-core state object as if these changes were committed. If no version is passed, the changeset is against the head of the working branch. The return is a tuple with a bool...
if not os.path.isfile("SRS"): log.error("SRS file must exist in the current directory for source commands") return state = SourceState("SRS")
def buildChangeSet(repos, srcVersion = None, needsHead = False): """ Builds a change set against the sources in the current directory and builds an in-core state object as if these changes were committed. If no version is passed, the changeset is against the head of the working branch. The return is a tuple with a bool...
srcVersion = repos.pkgLatestVersion(state.getTroveName(), state.getTroveBranch())
srcVersion = state.getTroveVersion()
def buildChangeSet(repos, srcVersion = None, needsHead = False): """ Builds a change set against the sources in the current directory and builds an in-core state object as if these changes were committed. If no version is passed, the changeset is against the head of the working branch. The return is a tuple with a bool...
if not srcVersion.equal(state.getTroveVersion()):
headVersion = repos.pkgLatestVersion(state.getTroveName(), state.getTroveBranch()) if not headVersion.equal(state.getTroveVersion()):
def buildChangeSet(repos, srcVersion = None, needsHead = False): """ Builds a change set against the sources in the current directory and builds an in-core state object as if these changes were committed. If no version is passed, the changeset is against the head of the working branch. The return is a tuple with a bool...
if not version:
if not srcPkg.hasFile(fileId): assert(not needsHead or not version)
def buildChangeSet(repos, srcVersion = None, needsHead = False): """ Builds a change set against the sources in the current directory and builds an in-core state object as if these changes were committed. If no version is passed, the changeset is against the head of the working branch. The return is a tuple with a bool...
duplicateVersion = cook.checkBranchForDuplicate(repos, state.getTroveBranch(), f) if not duplicateVersion:
oldVersion = srcPkg.getFile(fileId)[1] (oldFile, oldCont) = repos.getFileVersion(fileId, oldVersion, withContents = 1) if not f.same(oldFile):
def buildChangeSet(repos, srcVersion = None, needsHead = False): """ Builds a change set against the sources in the current directory and builds an in-core state object as if these changes were committed. If no version is passed, the changeset is against the head of the working branch. The return is a tuple with a bool...
oldVersion = srcPkg.getFile(fileId)[1] (oldFile, oldCont) = repos.getFileVersion(fileId, oldVersion, withContents = 1)
def buildChangeSet(repos, srcVersion = None, needsHead = False): """ Builds a change set against the sources in the current directory and builds an in-core state object as if these changes were committed. If no version is passed, the changeset is against the head of the working branch. The return is a tuple with a bool...
pkg.addFile(f.id(), path, duplicateVersion)
pkg.addFile(f.id(), path, oldVersion)
def buildChangeSet(repos, srcVersion = None, needsHead = False): """ Builds a change set against the sources in the current directory and builds an in-core state object as if these changes were committed. If no version is passed, the changeset is against the head of the working branch. The return is a tuple with a bool...
result = buildChangeSet(repos, needsHead = True)
result = buildChangeSet(repos, state, needsHead = True)
def commit(repos): # we need to commit based on changes to the head of a branch result = buildChangeSet(repos, needsHead = True) if not result: return (isDifferent, state, changeSet, oldPackage) = result if not isDifferent: log.info("no changes have been made to commit") else: repos.commitChangeSet(changeSet) state.w...
def diff(repos): result = buildChangeSet(repos)
def diff(repos, versionStr = None): if not os.path.isfile("SRS"): log.error("SRS file must exist in the current directory for source commands") return state = SourceState("SRS") if versionStr: versionStr = state.expandVersionStr(versionStr) pkgList = helper.findPackage(repos, None, None, state.getTroveName(), versio...
def diff(repos): result = buildChangeSet(repos) if not result: return (changed, state, changeSet, oldPackage) = result if not changed: return packageChanges = changeSet.getNewPackageList() assert(len(packageChanges) == 1) pkgCs = packageChanges[0] for (fileId, path, newVersion) in pkgCs.getNewFileList(): print "%s:...
if versionStr[0] == "@": repName = state.getTroveBranch().branchNick().getHost() versionStr = repName + versionStr elif versionStr[0] != "/" and versionStr.find("@") == -1: versionStr = state.getTroveBranch().asString() + "/" + versionStr
versionStr = state.expandVersionStr(versionStr)
def update(repos, versionStr = None): if not os.path.isfile("SRS"): log.error("SRS file must exist in the current directory for source commands") return state = SourceState("SRS") pkgName = state.getTroveName() baseVersion = state.getTroveVersion() if not versionStr: head = repos.getLatestPackage(pkgName, state.getTr...
'soname' in m.contents and not mode & 0111:
'soname' in m.contents and not mode & 0111 and \ not path.endswith('.so'):
def doFile(self, path):
if newCs is None: break
# def applyUpdate -- body begins here
if "EntitlementsGroups" not in tables:
if "EntitlementGroups" not in tables:
def createUsers(db): cu = db.cursor() commit = False cu.execute("SELECT tbl_name FROM sqlite_master WHERE type " "in ('table', 'view')") tables = [ x[0] for x in cu ] if "Users" not in tables: cu.execute(""" CREATE TABLE Users ( userId INTEGER PRIMARY KEY, user STRING, salt BINARY, passw...
if 'ftp error] 421' in msg:
if msg.args[1].args[0].startswith('421'):
def fetchURL(cfg, name, location): log.info('Downloading %s...', name) retries = 0 url = None while retries < 5: try: url = urllib2.urlopen(name) break except urllib2.HTTPError, msg: if msg.code == 404: _createNegativeCacheEntry(cfg, name, location) return None else: log.error('error downloading %s: %s', name, str(msg)...
' Retrying in 10 seconds.', name, msg)
' Retrying in 10 seconds.', name)
def fetchURL(cfg, name, location): log.info('Downloading %s...', name) retries = 0 url = None while retries < 5: try: url = urllib2.urlopen(name) break except urllib2.HTTPError, msg: if msg.code == 404: _createNegativeCacheEntry(cfg, name, location) return None else: log.error('error downloading %s: %s', name, str(msg)...
self.message('WARNING: do NOT try to interrupt this migration, you will leave your DB in a messy state')
self.message('WARNING: do NOT interrupt this migration, you will leave your DB in a messy state')
def migrate(self): self.message('WARNING: do NOT try to interrupt this migration, you will leave your DB in a messy state')
self.cu.execute("""UPDATE tmpSha1s SET sha1=? WHERE streamId=?""", sha1, streamId, start_transaction=False)
self.cu.execute("INSERT INTO tmpSha1s (streamId, sha1) VALUES (?,?)", (sha1, streamId), start_transaction=False)
def migrate(self): self.message('WARNING: do NOT try to interrupt this migration, you will leave your DB in a messy state')
if newPct - 5 >= pct: pct = newPct self.message('Calculating sha1 for fileStream %s/%s (%s%%)...' % (streamId, total, pct))
if newPct >= pct: self.message('Calculating sha1 for fileStream %s/%s (%02d%%)...' % (streamId, total, pct)) pct = newPct + 5
def migrate(self): self.message('WARNING: do NOT try to interrupt this migration, you will leave your DB in a messy state')
self.cu.execute("INSERT INTO EntitlementOwners SELECT * FROM " "EntitlementOwners2")
self.cu.execute("INSERT INTO EntitlementOwners SELECT * FROM EntitlementOwners2")
def migrate(self): self.message('WARNING: do NOT try to interrupt this migration, you will leave your DB in a messy state')
self.cu.execute('ALTER TABLE Instances RENAME TO InstancesOld') for idx in self.db.tables['Instances']: self.cu.execute('DROP INDEX %s' % idx)
self.db.renameColumn("Instances", "isRedirect", "troveType")
def migrate(self): self.message('WARNING: do NOT try to interrupt this migration, you will leave your DB in a messy state')
self.message('Updating instances table column name') createInstances(self.db) self.cu.execute('INSERT INTO Instances SELECT * FROM InstancesOld') self.cu.execute('DROP TABLE InstancesOld') self.db.commit()
return self.Version
def migrate(self): self.message('WARNING: do NOT try to interrupt this migration, you will leave your DB in a messy state')
elif troveName.endswith(':source'):
elif n.endswith(':source'):
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...
if len(args) < 2 or len(args) > 3: return usage()
if len(args) != 4: return usage()
def sourceCommand(cfg, args, argSet): if not args: return usage() elif (args[0] == "add"): if len(args) < 2: return usage() checkin.addFiles(args[1:]) elif (args[0] == "checkout"): if argSet.has_key("dir"): dir = argSet['dir'] del argSet['dir'] else: dir = None if argSet or (len(args) < 2 or len(args) > 3): return usa...
targetdir = self.dirmap[self.currentsubtree %self.macros]
currentsubtree = self.currentsubtree % self.macros targetdir = self.dirmap[currentsubtree] targetdir += os.path.dirname(path[len(currentsubtree):])
def doFile(self, path):
path = self.cache.getEntry(l, withFiles)
path = self.cache.getEntry(l, withFiles, withFileContents)
def _cvtFileList(l): new = [] for (fileId, troveName, (oldTroveV, oldTroveF, oldFileV), (newTroveV, newTroveF, newFileV)) in l: if oldTroveV: oldTroveV = self.fromVersion(oldTroveV) oldFileV = self.fromVersion(oldFileV) oldTroveF = self.fromFlavor(oldTroveF) else: oldTroveV = 0 oldFileV = 0 oldTroveF = 0
path = self.cache.addEntry(l, withFiles)
path = self.cache.addEntry(l, withFiles, withFileContents)
def _cvtFileList(l): new = [] for (fileId, troveName, (oldTroveV, oldTroveF, oldFileV), (newTroveV, newTroveF, newFileV)) in l: if oldTroveV: oldTroveV = self.fromVersion(oldTroveV) oldFileV = self.fromVersion(oldFileV) oldTroveF = self.fromFlavor(oldTroveF) else: oldTroveV = 0 oldFileV = 0 oldTroveF = 0
self.cache = CacheSet(path + "/cache.sql", tmpPath, SERVER_VERSION)
self.cache = CacheSet(path + "/cache.sql", tmpPath, CACHE_SCHEMA_VERSION)
def __init__(self, path, tmpPath, urlBase, authDbPath, name,
def getEntry(self, item, withFiles):
def getEntry(self, item, withFiles, withFileContents):
def getEntry(self, item, withFiles): return None
def addEntry(self, item, withFiles):
def addEntry(self, item, withFiles, withFileContents):
def addEntry(self, item, withFiles): (fd, path) = tempfile.mkstemp(dir = self.tmpPath, suffix = '.ccs-out') os.close(fd) return path
def getEntry(self, item, withFiles):
def getEntry(self, item, withFiles, withFileContents):
def getEntry(self, item, withFiles): (name, (oldVersion, oldFlavor), (newVersion, newFlavor), absolute) = \ item
absolute=? AND withFiles=?
absolute=? AND withFiles=? AND withFileContents=?
def getEntry(self, item, withFiles): (name, (oldVersion, oldFlavor), (newVersion, newFlavor), absolute) = \ item
newVersionId, absolute, withFiles)
newVersionId, absolute, withFiles, withFileContents)
def getEntry(self, item, withFiles): (name, (oldVersion, oldFlavor), (newVersion, newFlavor), absolute) = \ item
db.commit()
self.db.commit()
def getEntry(self, item, withFiles): (name, (oldVersion, oldFlavor), (newVersion, newFlavor), absolute) = \ item
def addEntry(self, item, withFiles):
def addEntry(self, item, withFiles, withFileContents):
def addEntry(self, item, withFiles): (name, (oldVersion, oldFlavor), (newVersion, newFlavor), absolute) = \ item
INSERT INTO CacheContents VALUES(NULL, ?, ?, ?, ?, ?, ?, ?)
INSERT INTO CacheContents VALUES(NULL, ?, ?, ?, ?, ?, ?, ?, ?)
def addEntry(self, item, withFiles): (name, (oldVersion, oldFlavor), (newVersion, newFlavor), absolute) = \ item
absolute, withFiles)
absolute, withFiles, withFileContents)
def addEntry(self, item, withFiles): (name, (oldVersion, oldFlavor), (newVersion, newFlavor), absolute) = \ item
def createSchema(self, dbpath, protocolVersion):
def createSchema(self, dbpath, schemaVersion):
def createSchema(self, dbpath, protocolVersion):
if version != protocolVersion:
if version != schemaVersion:
def createSchema(self, dbpath, protocolVersion):
withFiles BOOLEAN)
withFiles BOOLEAN, withFileContents BOOLEAN)
def createSchema(self, dbpath, protocolVersion):
cu.execute("INSERT INTO CacheVersion VALUES(?)", protocolVersion)
cu.execute("INSERT INTO CacheVersion VALUES(?)", schemaVersion)
def createSchema(self, dbpath, protocolVersion):
def __init__(self, dbpath, tmpDir, protocolVersion):
def __init__(self, dbpath, tmpDir, schemaVersion):
def __init__(self, dbpath, tmpDir, protocolVersion):
self.createSchema(dbpath, protocolVersion)
self.createSchema(dbpath, schemaVersion)
def __init__(self, dbpath, tmpDir, protocolVersion):
if not isAbsolute and not sync:
if not (isAbsolute or sync or restrictToTroveSource):
# def _updateChangeSet -- body starts here
cfg.configLine('macros'.macro)
cfg.configLine('macros.' + macro)
def realMain(): argDef = {} cfgMap = {} cfgMap["build-label"] = "buildLabel" cfgMap["install-label"] = "installLabel" 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"] = M...
troveList = [x for x in self.repServer.repos.iterAllTroveNames('') if x.endswith(':source')]
troveList = [x for x in self.repServer.repos.troveStore.iterTroveNames() if x.endswith(':source')]
def metadataCmd(self, authToken, fields, troveName=None): troveList = [x for x in self.repServer.repos.iterAllTroveNames('') if x.endswith(':source')] troveList.sort()
def write(filename, oldName, newName):
def write(self, filename, oldName, newName):
def write(filename, oldName, newName):
print " --full-versions Print full version strings instead of attempting to shorten them"
print " --full-versions Print full version strings instead of " print " attempting to shorten them"
def usage(): print "conary showcs <changeset> [trove]" print "showcs flags: " print " --full-versions Print full version strings instead of attempting to shorten them" print " --info Print dependency information about the troves" print " --ls (R...
print " --show-changes For modifications, show the old file version next to new one" print " --tags Show tagged files (use with ls to show tagged and untagged)"
print " --show-changes For modifications, show the old " print " file version next to new one" print " --tags Show tagged files (use with ls to " print " show tagged and untagged)"
def usage(): print "conary showcs <changeset> [trove]" print "showcs flags: " print " --full-versions Print full version strings instead of attempting to shorten them" print " --info Print dependency information about the troves" print " --ls (R...
elif text cfgRe.match(filename) or (
elif text or cfgRe.match(filename) or (
def addFiles(fileList, ignoreExisting=False, text=False, binary=False, repos=None, defaultToText=True): assert(not text or not binary) try: conaryState = ConaryStateFromFile("CONARY", repos=repos) state = conaryState.getSourceState() except OSError: return for filename in fileList: if filename == "." or filename == "....
new.append(("%s (%s)" % (x.getName(), newInfo, 'N')))
new.append(("%s (%s -> N)" % (x.getName(), newInfo)))
def displayUpdateJobInfo(cs, verbose=False): indent = ' ' new = [] for x in cs.iterNewTroveList(): oldVersion = x.getOldVersion() newVersion = x.getNewVersion() oldFlavor = x.getOldFlavor() newFlavor = x.getNewFlavor() if newVersion: newTVersion = newVersion.trailingRevision() if oldVersion: oldTVersion = oldVersion...
raise RuntimeError
def main(argv=sys.argv): try: if '--skip-default-config' in argv: argv = argv[:] argv.remove('--skip-default-config') cfg = conarycfg.ConaryConfiguration(False) else: cfg = conarycfg.ConaryConfiguration() # reset the excepthook (using cfg values for exception settings) sys.excepthook = util.genExcepthook(dumpStack=cfg....
schemaBits = ('tables', 'triggers', 'functions', 'sequences', 'triggers') if arg in schemaBits: d = self.db.__dict__[arg]
if arg in self.schemaBits: d = getattr(self.db, arg)
def do_show(self, arg): schemaBits = ('tables', 'triggers', 'functions', 'sequences', 'triggers') if arg in schemaBits: d = self.db.__dict__[arg] print '\n'.join(sorted(d.keys())) else: print 'unknown argument', arg return False
if arg in ('on', 'yes'):
if arg in self.yesArgs:
def do_headers(self, arg): if arg in ('on', 'yes'): self.showHeaders = True elif arg in ('off', 'no'): self.showHeaders = False else: print 'unknown argument', arg return False
elif arg in ('off', 'no'):
elif arg in self.noArgs:
def do_headers(self, arg): if arg in ('on', 'yes'): self.showHeaders = True elif arg in ('off', 'no'): self.showHeaders = False else: print 'unknown argument', arg return False
help_head = do_head
help_head = help_headers complete_head = complete_headers
def help_headers(self): print """headers [on/off]
if os.path.exists(url) and os.access(os.W_OK):
if os.path.exists(url) and os.access(url, os.W_OK):
def _getLocalTroves(troveList): if not self.localRep or not troveList: return [ None ] * len(troveList)
if src[srcLine] != line[1:]:
if srcLine >= srcLen: conflicts += 1 elif src[srcLine] != line[1:]:
def countConflicts(self, src, srcLine):
list = [] for l in unifiedDiff: list.append(l) unifiedDiff = list
unifiedDiff = [ l for l in unifiedDiff ]
def patch(oldLines, unifiedDiff): i = 0 if type(unifiedDiff) == types.GeneratorType: list = [] for l in unifiedDiff: list.append(l) unifiedDiff = list last = len(unifiedDiff) hunks = [] while i < last: (magic1, fromRange, toRange, magic2) = unifiedDiff[i].split() if magic1 != "@@" or magic2 != "@@" or fromRange[0] !=...
last = len(unifiedDiff)
def patch(oldLines, unifiedDiff): i = 0 if type(unifiedDiff) == types.GeneratorType: list = [] for l in unifiedDiff: list.append(l) unifiedDiff = list last = len(unifiedDiff) hunks = [] while i < last: (magic1, fromRange, toRange, magic2) = unifiedDiff[i].split() if magic1 != "@@" or magic2 != "@@" or fromRange[0] !=...
rv = sourceCommand(cfg, otherArgs[1:], argSet, profile, thisCommand)
rv = sourceCommand(cfg, otherArgs[1:], argSet, profile, thisCommand=thisCommand)
def realMain(cfg, argv=sys.argv): argDef = {} if '--version' in argv or '-v' in argv: print constants.version return if len(argv) < 2: # no command specified return usage() commandName = argv[1] if commandName not in supportedCommands: return usage() params = {} cfgMap = {} thisCommand = supportedCommands[commandNam...
self.cu.execute("DELETE FROM TroveInfo WHERE infoType IN (?, ?)", (trove._TROVEINFO_TAG_SOURCENAME, trove._TROVEINFO_TAG_CLONEDFROM))
def migrate(self): from conary import trove # redo the troveInfoTypeIndex to be UNIQUE if "TroveInfoTypeIdx" in db.tables["TroveInfo"]: self.cu.execute("DROP INDEX TroveInfoTypeIdx") self.cu.execute("CREATE UNIQUE INDEX TroveInfoTypeIdx ON " "TroveInfo(infoType, instanceId)") # add instanceId to the InstancesChanged i...
packageList.append((name, version, None, absolute))
if self.hasPackageVersion(name, version): packageList.append((name, version, None, absolute))
def createChangeSet(self, packageList):
user_agent = "xmlrpclib.py/%s (www.pythonware.com modified by Specifix, Inc.)" % xmlrpclib.__version__
user_agent = "xmlrpclib.py/%s (www.pythonware.com modified by rpath, Inc.)" % xmlrpclib.__version__
def getrealhost(host): """ Slice off username/passwd and portnum """ atpoint = host.find('@') + 1 colpoint = host.rfind(':') if colpoint == -1: return host[atpoint:] else: return host[atpoint:colpoint]
if src[fromLine] != line[1:]: raise Conflict()
def apply(self, src, srcLine):
def __init__(self, fromStart, fromLen, toStart, toLen, lines):
def __init__(self, fromStart, fromLen, toStart, toLen, lines, contextCount):
def __init__(self, fromStart, fromLen, toStart, toLen, lines):
self.contextCount = contextCount
def __init__(self, fromStart, fromLen, toStart, toLen, lines):
print toCount, toLen
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...
hunks.append(Hunk(fromStart, fromLen, toStart, toLen, lines))
hunks.append(Hunk(fromStart, fromLen, toStart, toLen, lines, contextCount))
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...
while conflicts:
while best[0]:
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...
if (start + i < (len(oldLines) - hunk.fromLen)):
if ((start + i) <= (len(oldLines) - 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...
if conflicts: raise Conflict()
conflictCount = best[0] if (hunk.contextCount - conflictCount) < 1: raise Conflict()
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...
offset = i start += i
offset = best[1] start += offset
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...
raise repository.OpenError(str(e))
raise repository.repository.OpenError(str(e))
def __init__(self, name, path, repositoryMap):
theFile = repos.pullFileContentsObject(fileObj.sha1())
theFile = repos.pullFileContentsObject(fileObj.contents.sha1())
def recipeLoaderFromSourceComponent(component, filename, cfg, repos): if not component.endswith(':sources'): component += ":sources" name = filename[:-len('.recipe')] try: sourceComponent = repos.getLatestPackage(component, cfg.defaultbranch) except repository.PackageMissing: raise RecipeFileError, 'cannot find source...
assert(changeType != '~')
if changeType == '~': job.append((name, (version, flavor), (version, flavor), byDef))
def diffJob(derivativeTrove): trvCs, files, troves = derivativeTrove.diff(self) assert(not files)
assert((name, oldInfo[0], oldInfo[1]) not in secondaryIndex) assert((name, newInfo[0], newInfo[1]) not in secondaryIndex)
assert((name, (oldInfo[0], oldInfo[1])) not in secondaryIndex) assert((name, (newInfo[0], newInfo[1])) not in secondaryIndex)
def applyJob(jobSet, skipNotByDefault = False): for (name, (oldVersion, oldFlavor), (newVersion, newFlavor), byDef) in jobSet: if oldVersion is not None: self.delTrove(name, oldVersion, oldFlavor, byDef) if newVersion is not None and \ (oldVersion or not skipNotByDefault or byDef): self.addTrove(name, newVersion, newFl...
assert(oldOverlap != newOverlap) if oldOverlap is None:
if oldOverlap == newOverlap: origByDefault = self.includeTroveByDefault(name, oldInfo[0], oldInfo[1]) if byDefault == origByDefault: keepPrimary = False else: keepSecondary = False elif oldOverlap is None:
def applyJob(jobSet, skipNotByDefault = False): for (name, (oldVersion, oldFlavor), (newVersion, newFlavor), byDef) in jobSet: if oldVersion is not None: self.delTrove(name, oldVersion, oldFlavor, byDef) if newVersion is not None and \ (oldVersion or not skipNotByDefault or byDef): self.addTrove(name, newVersion, newFl...
assert(newOverlap is None)
def applyJob(jobSet, skipNotByDefault = False): for (name, (oldVersion, oldFlavor), (newVersion, newFlavor), byDef) in jobSet: if oldVersion is not None: self.delTrove(name, oldVersion, oldFlavor, byDef) if newVersion is not None and \ (oldVersion or not skipNotByDefault or byDef): self.addTrove(name, newVersion, newFl...
d = troveVersions.get(troveName, None) if d is None: d = {} troveVersions[troveName] = d
d = troveVersions.setdefault(troveName, {})
def _getTroveList(self, authToken, clientVersion, troveSpecs, versionType = _GTL_VERSION_TYPE_NONE, latestFilter = _GET_TROVE_ALL_VERSIONS, flavorFilter = _GET_TROVE_ALL_FLAVORS, withVersions = True, withFlavors = False): logMe(2, versionType, latestFilter, flavorFilter) cu = self.db.cursor() singleVersionSpec = None d...
if regExp.match(name):
if regExp.match(item[0]):
def _mergeGroupChanges(self, cs, keepExisting): # Updates a change set by removing troves which don't need # to be updated do to local state. It also removes troves which # don't need to be installed because they're new, but aren't to # be installed by default. assert(not cs.isAbsolute())
dict.__setitem__(self, self._getNonExistantKey(key))
self._addFlag(key)
def _override(self, key, value): if key not in self: dict.__setitem__(self, self._getNonExistantKey(key)) self[key]._set(value, override=True)
self.stmt.bind(pkey, pval)
try: self.stmt.bind(pkey, pval) except _sqlite.ProgrammingError, e: if e.args[0] == "Bind parameter name unknown to the query": continue raise
def execute(self, SQL, *parms, **kwargs): # kwargs we won't attempt to bind to the query _nobind = ['start_transaction'] start_transaction = kwargs.get('start_transaction', True) SQL = SQL.strip() self._checkNotClosed("execute") startingTransaction = False
self.stmt.bind(":" + pkey, pval)
try: self.stmt.bind(":" + pkey, pval) except _sqlite.ProgrammingError, e: if e.args[0] == "Bind parameter name unknown to the query": continue raise
def execute(self, SQL, *parms, **kwargs): # kwargs we won't attempt to bind to the query _nobind = ['start_transaction'] start_transaction = kwargs.get('start_transaction', True) SQL = SQL.strip() self._checkNotClosed("execute") startingTransaction = False
log.error("file %s is already part of this source package" % path)
log.error("file %s is already part of this source component" % path)
def addFile(file): try: state = SourceStateFromFile("SRS") except OSError: return try: os.lstat(file) except OSError: log.error("files must be created before they can be added") return for (fileId, path, version) in state.iterFileList(): if path == file: log.error("file %s is already part of this source package" % pa...