rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
if blockType & 3 == 3: raise MalformedKeyRing("Can't read packet of indeterminate length") if blockType & 3 == 2: keyRing.seek(4, SEEK_CUR) else: keyRing.seek((blockType & 3) + 1, SEEK_CUR) | readBlockSize(keyRing, blockType) | def getSignatureTuple(keyRing): startPoint = keyRing.tell() blockType = readBlockType(keyRing) if blockType & 3 == 3: raise MalformedKeyRing("Can't read packet of indeterminate length") if blockType & 3 == 2: keyRing.seek(4, SEEK_CUR) else: keyRing.seek((blockType & 3) + 1, SEEK_CUR) if ord(keyRing.read(1)) != 4: raise... |
if hashBlock & 3 == 3: raise MalformedKeyRing("Can't read packet of indeterminate length") elif hashBlock & 3 == 2: keyRing.seek(4) else: keyRing.seek((hashBlock & 3) + 1, SEEK_CUR) | readBlockSize(keyRing, hashBlock) | def finalizeSelfSig(data, keyRing, fingerprint, mainKey): # find the self signature intKeyId = fingerprintToInternalKeyId(fingerprint) while (intKeyId != getSigId(keyRing)): seekNextSignature(keyRing) # we now point to the self signature. # get the actual signature Tuple dig_sig = getSignatureTuple(keyRing) # append th... |
if packetType == -1: return dataSize = -1 if not packetType & 64: if (packetType & 3) == OLD_PKT_LEN_ONE_OCTET: sizeLen = 1 elif (packetType & 3) == OLD_PKT_LEN_TWO_OCTET: sizeLen = 2 elif (packetType & 3) == OLD_PKT_LEN_FOUR_OCTET: sizeLen = 4 else: raise MalformedKeyRing("Can't seek past packet of indeterminate leng... | dataSize = readBlockSize(keyRing, packetType) | def seekNextPacket(keyRing): packetType=readBlockType(keyRing) if packetType == -1: return dataSize = -1 if not packetType & 64: # RFC 2440 4.2.1 - Old-Format Packet Lengths if (packetType & 3) == OLD_PKT_LEN_ONE_OCTET: sizeLen = 1 elif (packetType & 3) == OLD_PKT_LEN_TWO_OCTET: sizeLen = 2 elif (packetType & 3) == OLD... |
lenBits = blockType & 3 if lenBits == 3: raise MalformedKeyRing("Can't seek past packet of indeterminate length.") elif lenBits == 2: keyRing.seek(4, SEEK_CUR) else: keyRing.seek(lenBits+1, SEEK_CUR) | readBlockSize(keyRing, blockType) | def getSigId(keyRing): startPoint = keyRing.tell() blockType = readBlockType(keyRing) if (blockType >> 2) & 15 != PKT_SIG: #block is not a signature. it has no sigId return '' lenBits = blockType & 3 if lenBits == 3: raise MalformedKeyRing("Can't seek past packet of indeterminate length.") elif lenBits == 2: keyRing.se... |
if blockType & 3 == 3: raise IncompatibleKey("Can't seek past packet of indeterminate length") elif blockType & 3 == 2: keyRing.seek(4, SEEK_CUR) else: keyRing.seek((blockType & 3) + 1, SEEK_CUR) | readBlockSize(keyRing, blockType) | def assertSigningKey(keyId,keyRing): startPoint = keyRing.tell() keyRing.seek(0, SEEK_END) limit = keyRing.tell() if limit == 0: # no keys in a zero length file keyRing.seek(startPoint) raise KeyNotFound(keyId, "Couldn't open keyring") keyRing.seek(0, SEEK_SET) while (keyRing.tell() < limit) and (keyId not in getKeyId(... |
lenBits = blockType & 3 if lenBits == 3: keyRing.seek(startPoint) raise MalformedKeyRing("Can't seek past packet of indeterminate length.") elif lenBits == 2: keyRing.seek(4, SEEK_CUR) else: keyRing.seek(lenBits+1, SEEK_CUR) assert (ord(keyRing.read(1)) == 4) | readBlockSize(keyRing, blockType) if (ord(keyRing.read(1)) != 4): raise IncompatibleKey("Can only use V4 keys") | def assertSigningKey(keyId,keyRing): startPoint = keyRing.tell() keyRing.seek(0, SEEK_END) limit = keyRing.tell() if limit == 0: # no keys in a zero length file keyRing.seek(startPoint) raise KeyNotFound(keyId, "Couldn't open keyring") keyRing.seek(0, SEEK_SET) while (keyRing.tell() < limit) and (keyId not in getKeyId(... |
def readBlockSize(keyRing, sizeType): if sizeType == 0: return ord(keyRing.read(1)) elif sizeType == 1: return ord(keyRing.read(1)) * 0x100 + ord(keyRing.read(1)) elif sizeType == 2: return (ord(keyRing.read(1)) * 0x1000000 + ord(keyRing.read(1)) * 0x10000 + ord(keyRing.read(1)) * 0x100 + ord(keyRing.read(1))) | def readBlockSize(keyRing, packetType): if packetType == -1: return 0 dataSize = -1 if not packetType & 64: if (packetType & 3) == OLD_PKT_LEN_ONE_OCTET: sizeLen = 1 elif (packetType & 3) == OLD_PKT_LEN_TWO_OCTET: sizeLen = 2 elif (packetType & 3) == OLD_PKT_LEN_FOUR_OCTET: sizeLen = 4 else: raise MalformedKeyRing("C... | def readBlockSize(keyRing, sizeType): if sizeType == 0: return ord(keyRing.read(1)) elif sizeType == 1: return ord(keyRing.read(1)) * 0x100 + ord(keyRing.read(1)) elif sizeType == 2: return (ord(keyRing.read(1)) * 0x1000000 + ord(keyRing.read(1)) * 0x10000 + ord(keyRing.read(1)) * 0x100 + ord(keyRing.read(1))) else: ra... |
raise MalformedKeyRing("Can't get size of packet of indeterminate length") | octet=ord(keyRing.read(1)) if octet < 192: sizeLen=1 keyRing.seek(-1, SEEK_CUR) elif octet < 224: dataSize = (ord(keyRing.read(1)) - 192 ) * 256 + \ ord(keyRing.read(1)) + 192 elif octet < 255: dataSize = 1 << (ord(keyRing.read(1)) & 0x1f) else: sizeLen=4 if dataSize == -1: dataSize = 0 for i in range(0, sizeLen): dat... | def readBlockSize(keyRing, sizeType): if sizeType == 0: return ord(keyRing.read(1)) elif sizeType == 1: return ord(keyRing.read(1)) * 0x100 + ord(keyRing.read(1)) elif sizeType == 2: return (ord(keyRing.read(1)) * 0x1000000 + ord(keyRing.read(1)) * 0x10000 + ord(keyRing.read(1)) * 0x100 + ord(keyRing.read(1))) else: ra... |
limit = (readBlockSize(keyRing, packetType & 3) + (packetType & 3) + 1 + startLoc) | readBlockSize(keyRing, packetType) | def getGPGKeyTuple(keyId, keyRing, secret=0, passPhrase=''): startPoint = keyRing.tell() keyRing.seek(0, SEEK_END) limit = keyRing.tell() if limit == 0: # empty file, there can be no keys in it raise KeyNotFound(keyId) if secret: assertSigningKey(keyId, keyRing) keyRing.seek(0) while (keyId not in getKeyId(keyRing)): s... |
data = keyRing.read(limit - keyRing.tell() + 1) | data = keyRing.read(limit - keyRing.tell()) | def decryptPrivateKey(keyRing, limit, numMPIs, passPhrase): hashes = ('Unknown', md5, sha, 'RIPE-MD/160', 'Double Width SHA', 'MD2', 'Tiger/192', 'HAVAL-5-160') ciphers = ('Unknown', 'IDEA', DES3, CAST, Blowfish, 'SAFER-SK128', 'DES/SK', AES, AES, AES) keySizes = (0, 0, 192, 128, 128, 0, 0, 128, 192, 256) legalCiphers ... |
def get(repos, httpHandler, req): | def get(isSecure, repos, httpHandler, req): | def get(repos, httpHandler, req): uri = req.uri if uri.endswith('/'): uri = uri[:-1] cmd = os.path.basename(uri) fields = util.FieldStorage(req) authToken = getAuth(req, repos) if authToken[0] != "anonymous" and not isSecure and repos.forceSecure: return apache.HTTP_FORBIDDEN if cmd != "changeset": # we need to redo ... |
if version != 6: | if version == 6: | 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_... |
if clonedVer: if clonedVer != trv.getVersion(): if clonedVer < trv.getVersion(): clonedVer = None infoList.extend(alreadyCloned) alreadyCloned = [] continue else: clonedVer = trv.getVersion() | def _createBinaryVersions(versionMap, leafMap, repos, srcVersion, infoList): # this works on a single flavor at a time singleFlavor = list(set(x[2] for x in infoList)) assert(len(singleFlavor) == 1) singleFlavor = singleFlavor[0] | |
versionMap[info] = trv.getVersion() | alreadyCloned.append(info) | def _createBinaryVersions(versionMap, leafMap, repos, srcVersion, infoList): # this works on a single flavor at a time singleFlavor = list(set(x[2] for x in infoList)) assert(len(singleFlavor) == 1) singleFlavor = singleFlavor[0] |
if key == 'self' or key == 'description': | if key == 'description': | def __init__(self, filename, macros = {}, warn=False): |
rpath using the C{r.Requires(rpath=I{rpath})} or C{r.Requires(rpath=(I{filterExp}: I{rpath}))} calls, which are tested in the order provided. The C{I{rpath}} is a standard | RPATH using the C{r.Requires(rpath=I{RPATH})} or C{r.Requires(rpath=(I{filterExp}, I{RPATH}))} calls, which are tested in the order provided. The C{I{RPATH}} is a standard | def _markProvides(self, path, fullpath, provision, pkg, m, f): if path not in pkg.providesMap: # BuildPackage only fills in providesMap for ELF files; we may # need to create a few more DependencySets. pkg.providesMap[path] = deps.DependencySet() |
raise KeyError, theId | raise KeyError, instanceId | def getVersion(self, instanceId): cu = self.db.cursor() cu.execute("""SELECT version, timeStamps FROM DBInstances JOIN Versions ON DBInstances.versionId = Versions.versionId WHERE instanceId=%d""", instanceId) |
def createBranch(self, newBranch, where, troveName = None): | def createBranch(self, newBranch, where, troveList = []): | def createBranch(self, newBranch, where, troveName = None): |
def setByDefault(self, name, version, flavor, byDefault): | def setTroveByDefault(self, name, version, flavor, byDefault): | def setByDefault(self, name, version, flavor, byDefault): (explicit, oldByDefault, comps, childByDefaults) \ = self.troves[name, version, flavor] self.troves[name, version, flavor] = (explicit, byDefault, comps, childByDefaults) |
group.setByDefault(byDefault=False, *pkgTup) | group.setTroveByDefault(byDefault=False, *pkgTup) | def _componentMatches(troveName, compList): return ':' in troveName and troveName.split(':', 1)[1] in compList |
Where specifies the node branches are created from for the trove troveName (or all of the troves if troveName is empty). Any troves or files branched due to inclusion in a branched trove will be branched at the version required by the object including it. If different versions of objects are included from multiple plac... | C{where} specifies the node branches are created from for the troves in C{troveList} (or all of the troves if C{troveList} is empty). Any troves or files branched due to inclusion in a branched trove will be branched at the version required by the object including it. If different versions of objects are included from ... | def createBranch(self, newBranch, where, troveList = []): |
@type troveName: str | @type troveList: list of str | def createBranch(self, newBranch, where, troveList = []): |
@type param: list | @type sha1List: list | def getFileContents(self, sha1List): |
import epdb epdb.st('f') | def _findErasures(primaryErases, newJob, referencedTroves, recurse): # each node is a ((name, version, flavor), state, edgeList # fromUpdate) # state is ERASE, KEEP, or UNKNOWN # # fromUpdate is True if erasing this node reflects a trove being # replaced by a different one in the Job (an update, not an erase) #... | |
for job in itertools.chain(primaryErases, newJob, jobQueue): if job[1][0] is None: | for job, ignorePins in itertools.chain( itertools.izip(primaryErases, itertools.repeat(True)), itertools.izip(newJob, itertools.repeat(False)), jobQueue): oldInfo = (job[0], job[1][0], job[1][1]) if oldInfo[1] is None: | def _findErasures(primaryErases, newJob, referencedTroves, recurse): # each node is a ((name, version, flavor), state, edgeList # fromUpdate) # state is ERASE, KEEP, or UNKNOWN # # fromUpdate is True if erasing this node reflects a trove being # replaced by a different one in the Job (an update, not an erase) #... |
oldInfo = (job[0], job[1][0], job[1][1]) | def _findErasures(primaryErases, newJob, referencedTroves, recurse): # each node is a ((name, version, flavor), state, edgeList # fromUpdate) # state is ERASE, KEEP, or UNKNOWN # # fromUpdate is True if erasing this node reflects a trove being # replaced by a different one in the Job (an update, not an erase) #... | |
if self.db.trovesArePinned([ oldInfo ])[0]: | if not ignorePins and pinned: | def _findErasures(primaryErases, newJob, referencedTroves, recurse): # each node is a ((name, version, flavor), state, edgeList # fromUpdate) # state is ERASE, KEEP, or UNKNOWN # # fromUpdate is True if erasing this node reflects a trove being # replaced by a different one in the Job (an update, not an erase) #... |
jobQueue.add((inclInfo[0], inclInfo[1:], (None, None), False)) | jobQueue.add(((inclInfo[0], inclInfo[1:], (None, None), False), pinned and ignorePins)) | def _findErasures(primaryErases, newJob, referencedTroves, recurse): # each node is a ((name, version, flavor), state, edgeList # fromUpdate) # state is ERASE, KEEP, or UNKNOWN # # fromUpdate is True if erasing this node reflects a trove being # replaced by a different one in the Job (an update, not an erase) #... |
def _getPathHashes(trvSrc, db, trv, isCollection, inDb = False): if not isCollection: return trv.getPathHashes() | def _getPathHashes(trvSrc, db, trv, inDb = False): if not trv.isCollection(): return trv.getPathHashes() | def _getPathHashes(trvSrc, db, trv, isCollection, inDb = False): if not isCollection: return trv.getPathHashes() |
import epdb epdb.st('f') | # def _mergeGroupChanges -- main body begins here | |
if pinned and not ignorePins: continue | trv = troveSource.getTrove(withFiles = False, *newInfo) if pinned: if replacedInfo[1]: assert(replacedInfo[1] is not None) oldTrv = self.db.getTrove(withFiles = False, pristine = False, *replacedInfo) oldHashes = _getPathHashes(troveSource, self.db, oldTrv, inDb = True) newHashes = _getPathHashes(uJob.getTroveSource(... | # def _mergeGroupChanges -- main body begins here |
trv = troveSource.getTrove(withFiles = False, *newInfo) | # def _mergeGroupChanges -- main body begins here | |
import epdb epdb.st('f') | # def _updateChangeSet -- body starts here | |
depNum = depList[-depId][0] depSet = depSetList[depNum] result[depSet] = \ [ [ (x[0][0], | depSetId = -depList[depId][0] - 1 depSet = depSetList[depSetId] result.setdefault(depSet, []).append( [ (x[0][0], | def resolve(self, label, depSetList): cu = self.db.cursor() |
x[0][1]) for x in troveSet.items() ] ] | x[0][1]) for x in troveSet.items() ]) | def resolve(self, label, depSetList): cu = self.db.cursor() |
True) | True, updateOnly) | # def _mergeGroupChanges -- main body begins here |
followLocalChanges) = newTroves.pop(0) | followLocalChanges, updateOnly) = newTroves.pop(0) | # def _mergeGroupChanges -- main body begins here |
childrenFollowLocalChanges)) | childrenFollowLocalChanges, updateOnly or not jobAdded)) | # def _mergeGroupChanges -- main body begins here |
ptrTargets[pathId] = target | 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() ==... | |
old, oldStreams = self.trvIterator.next() | old, oldStreams = old | def next(self): if not self.l and self.new: # self.l (and self.trvIterator) are empty; look to # self.new for new jobs we need |
old = self.trvIterator.next() | def next(self): if not self.l and self.new: # self.l (and self.trvIterator) are empty; look to # self.new for new jobs we need | |
if old is None: [ x for x in self.trvIterator ] raise errors.TroveMissing(job[0], job[1][0]) | def next(self): if not self.l and self.new: # self.l (and self.trvIterator) are empty; look to # self.new for new jobs we need | |
if self.withFiles: new, newStreams = self.trvIterator.next() | new = self.trvIterator.next() if new is None: for x in self.trvIterator: pass raise errors.TroveMissing(job[0], job[2][0]) if self.withFiles: new, newStreams = new | def next(self): if not self.l and self.new: # self.l (and self.trvIterator) are empty; look to # self.new for new jobs we need |
new = self.trvIterator.next() | def next(self): if not self.l and self.new: # self.l (and self.trvIterator) are empty; look to # self.new for new jobs we need | |
if new is None: [ x for x in self.trvIterator ] raise errors.TroveMissing(job[0], job[2][0]) | def next(self): if not self.l and self.new: # self.l (and self.trvIterator) are empty; look to # self.new for new jobs we need | |
q.put(newCs) | while True: try: q.put(newCs, True, 5) break except Queue.Full: if stopSelf.isSet(): return | def _createAllCs(q, allJobs, uJob, cfg, stopSelf): |
log.warning('timeout waiting for download thread to ' 'terminate -- closing database and exiting') log.warning('the following traceback _may_ be related') | log.warning('timeout waiting for download ' 'thread to terminate -- closing ' 'database and exiting') | # def applyUpdate -- body begins here |
nextVersion = helper.nextVersion(repos, fullName, recipeClass.version, None, buildBranch, binary = True) | def cookGroupObject(repos, cfg, recipeClass, buildBranch, macros={}): """ Turns a group recipe object into a change set. Returns the absolute changeset created, a list of the names of the packages built, and and None (for compatibility with cookPackageObject). @param repos: Repository to both look for source files and... | |
grp = package.Trove(fullName, nextVersion, grpFlavor, None) | grp = package.Trove(fullName, versions.NewVersion(), grpFlavor, None) | def cookGroupObject(repos, cfg, recipeClass, buildBranch, macros={}): """ Turns a group recipe object into a change set. Returns the absolute changeset created, a list of the names of the packages built, and and None (for compatibility with cookPackageObject). @param repos: Repository to both look for source files and... |
for name, version, flavor in trv.iterTroveList(strongRefs=True): | for name, version, flavor in trv.iterTroveList(strongRefs=True, weakRefs=True): | def _orderComponents(compGraph): |
row[2] = int(row[2]) | row.data[2] = int(row.data[2]) row.description[2][1] = 0 | def escape(cu, data): row = list(data) for i in range(len(data.data)): assert(data.description[i][1] in (0,1,6,8,9)) if data.description[i][1] == 8: row[i] = cu.binary(data.data[i]) elif data.description[i][1] == 9: row[i] = int(data.data[i]) return tuple(row) |
except: | except Exception, e: | def escape(cu, data): row = list(data) for i in range(len(data.data)): assert(data.description[i][1] in (0,1,6,8,9)) if data.description[i][1] == 8: row[i] = cu.binary(data.data[i]) elif data.description[i][1] == 9: row[i] = int(data.data[i]) return tuple(row) |
return self.iterAll() | return ( x[1] for x in self.iterAll() ) | def iter(self): return self.iterAll() |
VALUES (NULL,?,?, ?,?,?,?, ?,?,?,?, ?,?,?)""", | VALUES (NULL,?,?, ?,?,?,?, ?,?,?,?, ?,?)""", | def addEntry(self, item, recurse, withFiles, withFileContents, excludeAutoSource, returnVal, size): (name, (oldVersion, oldFlavor), (newVersion, newFlavor), absolute) = \ item |
fileId = self.toFileId(fileList[streams.index(None)][1]) | fileId = self.toFileId(fileList[rawStreams.index(None)][1]) | def getFileVersions(self, authToken, clientVersion, fileList): self.log(2, "fileList", fileList) |
if self.getGroupNameById(userGroupId) != userGroupName: self._uniqueUserGroup(cu, userGroupName) | currentGroupName = self.getGroupNameById(userGroupId) if currentGroupName != userGroupName: if currentGroupName.lower() != userGroupName.lower(): self._uniqueUserGroup(cu, userGroupName) | def renameGroup(self, userGroupId, userGroupName): cu = self.db.cursor() |
import lib lib.epdb.st('f') | def _updateChangeSet(self, itemList, uJob, keepExisting = None, recurse = True, updateMode = True, sync = False): """ Updates a trove on the local system to the latest version in the respository that the trove was initially installed from. | |
' understands schema version %s. Dropping extra' ' information. Please upgrade conary.', | ' version of Conary understands schema version %s.' ' Dropping extra information. Please upgrade conary.', | def __init__(self, repos, cs, fileHostFilter = [], callback = None, resetTimestamps = False, keyCache = None, threshold = 0, allowIncomplete = False): |
Branches.branchId = Nodes.branchId | Branches.branchId = Nodes.branchId AND LabelMap.itemId = Nodes.itemId | def troveNames(self, label): cu = self.db.cursor() cu.execute("""SELECT DISTINCT item FROM Labels JOIN LabelMap ON Labels.labelId = LabelMap.labelId JOIN Branches ON LabelMap.branchId = Branches.branchId JOIN Nodes ON Branches.branchId = Nodes.branchId JOIN Instances ON Nodes.versionId = Instances.versionId JOIN Items ... |
Nodes.versionId = Instances.versionId | Nodes.versionId = Instances.versionId AND Nodes.itemId = Instances.itemId | def troveNames(self, label): cu = self.db.cursor() cu.execute("""SELECT DISTINCT item FROM Labels JOIN LabelMap ON Labels.labelId = LabelMap.labelId JOIN Branches ON LabelMap.branchId = Branches.branchId JOIN Nodes ON Branches.branchId = Nodes.branchId JOIN Instances ON Nodes.versionId = Instances.versionId JOIN Items ... |
if repos.hasGroupVersion(GrpName, newVersion): | if repos.hasGroupVersion(grpName, newVersion): | def __init__(self, repos, cs): |
return sqlite3.decode(fileId) | if fileId is not None: return sqlite3.decode(fileId) | def decodeFileId(fileId): return sqlite3.decode(fileId) |
def encodeStream(fileId): return sqlite3.encode(fileId) | def encodeStream(stream): return sqlite3.encode(stream) | def encodeStream(fileId): return sqlite3.encode(fileId) |
def _addSignature(self, file, keyid): | def _addSignature(self, filename, keyid): | def _addSignature(self, file, keyid): |
if not keyid or not file: | if not keyid or not filename: | def _addSignature(self, file, keyid): |
gpg = '%s.sig' %(file) | gpg = '%s.sig' %(filename) | def _addSignature(self, file, keyid): |
gpg = '%s.sign' %(file) | gpg = '%s.sign' %(filename) | def _addSignature(self, file, keyid): |
if not self.signatures.has_key(file): self.signatures[file] = [] self.signatures[file].append((gpg, c, keyid)) def _appendSource(self, file, keyid, type, extractDir, use, args): file = file % self.macros | if not self.signatures.has_key(filename): self.signatures[filename] = [] self.signatures[filename].append((gpg, c, keyid)) def _appendSource(self, filename, keyid, type, extractDir, use, args): filename = filename % self.macros | def _addSignature(self, file, keyid): |
self.sources.append((file, type, extractDir, use, args)) self._addSignature(file, keyid) def addArchive(self, file, extractDir='', keyid=None, use=None): self._appendSource(file, keyid, 'tarball', extractDir, use, ()) def addArchiveFromRPM(self, rpm, file, extractDir='', use=None): | self.sources.append((filename, type, extractDir, use, args)) self._addSignature(filename, keyid) def addArchive(self, filename, extractDir='', keyid=None, use=None): self._appendSource(filename, keyid, 'tarball', extractDir, use, ()) def addArchiveFromRPM(self, rpm, filename, extractDir='', use=None): | def _appendSource(self, file, keyid, type, extractDir, use, args): |
file = file % self.macros | filename = filename % self.macros | def addArchiveFromRPM(self, rpm, file, extractDir='', use=None): |
os.path.basename(file), self.name, self.srcdirs) | os.path.basename(filename), self.name, self.srcdirs) | def addArchiveFromRPM(self, rpm, file, extractDir='', use=None): |
c = lookaside.createCacheName(self.cfg, file, self.name) | c = lookaside.createCacheName(self.cfg, filename, self.name) | def addArchiveFromRPM(self, rpm, file, extractDir='', use=None): |
f = lookaside.findAll(self.cfg, self.laReposCache, file, | f = lookaside.findAll(self.cfg, self.laReposCache, filename, | def addArchiveFromRPM(self, rpm, file, extractDir='', use=None): |
self.sources.append((file, 'tarball', extractDir, use, ())) def addPatch(self, file, level='1', backup='', extractDir='', keyid=None, use=None, macros=False, extraArgs=''): self._appendSource(file, keyid, 'patch', extractDir, use, (level, backup, macros, extraArgs)) def addSource(self, file, keyid=None, extractDir=''... | self.sources.append((filename, 'tarball', extractDir, use, ())) def addPatch(self, filename, level='1', backup='', extractDir='', keyid=None, use=None, macros=False, extraArgs=''): self._appendSource(filename, keyid, 'patch', extractDir, use, (level, backup, macros, extraArgs)) def addSource(self, filename, keyid=Non... | def addArchiveFromRPM(self, rpm, file, extractDir='', use=None): |
for (file, filetype, extractDir, use, args) in self.sources: if file: sources.append(file) | for (filename, filetype, extractDir, use, args) in self.sources: if filename: sources.append(filename) | def allSources(self): sources = [] for (file, filetype, extractDir, use, args) in self.sources: if file: # no file for an action |
def checkSignatures(self, filepath, file): if not self.signatures.has_key(file): | def checkSignatures(self, filepath, filename): if not self.signatures.has_key(filename): | def checkSignatures(self, filepath, file): if not self.signatures.has_key(file): return if not util.checkPath("gpg"): return |
for (gpg, signature, keyid) in self.signatures[file]: | for (gpg, signature, keyid) in self.signatures[filename]: | def checkSignatures(self, filepath, file): if not self.signatures.has_key(file): return if not util.checkPath("gpg"): return |
for (file, filetype, targetdir, use, args) in self.sources: | for (filename, filetype, targetdir, use, args) in self.sources: | def unpackSources(self, builddir): |
f = lookaside.findAll(self.cfg, self.laReposCache, file, | f = lookaside.findAll(self.cfg, self.laReposCache, filename, | def unpackSources(self, builddir): |
self.checkSignatures(f, file) | self.checkSignatures(f, filename) | def unpackSources(self, builddir): |
if file.endswith(".gz"): | if filename.endswith(".gz"): | def unpackSources(self, builddir): |
elif file.endswith(".bz2"): | elif filename.endswith(".bz2"): | def unpackSources(self, builddir): |
log.debug('applying macros to %s' %f) | log.debug('applying macros to patch %s' %f) | def unpackSources(self, builddir): |
(apply) = args f = lookaside.findAll(self.cfg, self.laReposCache, file, | (apply, macros) = args f = lookaside.findAll(self.cfg, self.laReposCache, filename, | def unpackSources(self, builddir): |
util.copyfile(f, destDir + "/" + os.path.basename(file)) | if macros: log.debug('applying macros to source %s' %f) pin = file(f) pout = file(destDir + os.sep + os.path.basename(filename), "w") pout.write(pin.read()%self.macros) pin.close() pout.close() else: util.copyfile(f, destDir + os.sep + os.path.basename(filename)) | def unpackSources(self, builddir): |
pass | fileId = self.toFileId(fileId) | def getFileContents(self, authToken, clientVersion, troveName, |
troveNames = [ (x, None) for x in db.iterAllTroveNames() \ if x.find(':') == -1 ] | troveNames = [ (x, None, None) for x in db.iterAllTroveNames() \ if x.find(':') == -1 ] | def verify(troveNameList, db, cfg, all=False): (troveNames, hasVersions, hasFlavors) = \ display.parseTroveStrings(troveNameList, cfg.flavor) if not troveNames and not all: usage() log.error("must specify either a trove or --all") return 1 elif not troveNames: troveNames = [ (x, None) for x in db.iterAllTroveNames() \ ... |
Use.sasl = False | Use.sasl = False Use.sasl.setShortDoc('Build with support for SASL Simple Authenication ' 'and Security Layer') | def _addDocs(obj): global __doc__ if __doc__ is None: return keys = obj.keys() keys.sort() _addShortDoc(obj, obj, keys) __doc__ += '\n\nMore details:\n\n' _addLongDoc(obj, obj, keys) |
Use.desktop.setShortDoc('Building with support for freedesktop.org specs') | Use.desktop.setShortDoc('Build with support for freedesktop.org specs') | def _addDocs(obj): global __doc__ if __doc__ is None: return keys = obj.keys() keys.sort() _addShortDoc(obj, obj, keys) __doc__ += '\n\nMore details:\n\n' _addLongDoc(obj, obj, keys) |
log.info('attempting to apply %s with patchlevel %s' % (f,patchlevel)) | def patchme(self, patch, f, destDir, patchlevels): for patchlevel in patchlevels: patchArgs = [ 'patch', '-d', destDir, '-p%s'%patchlevel, ] if self.backup: patchArgs.extend(['-b', '-z', self.backup]) if self.extraArgs: patchArgs.extend(self.extraArgs) | |
try: logFile.flush() logFile.seek(0,0) print logFile.read().strip() except IOError: pass | logFile.flush() logFile.seek(0,0) if failed: logFiles.append((patchlevel, logFile)) continue log.info(logFile.read().strip()) | def patchme(self, patch, f, destDir, patchlevels): for patchlevel in patchlevels: patchArgs = [ 'patch', '-d', destDir, '-p%s'%patchlevel, ] if self.backup: patchArgs.extend(['-b', '-z', self.backup]) if self.extraArgs: patchArgs.extend(self.extraArgs) |
if failed: log.info('patch %s did not apply with level %s' % (f,patchlevel)) else: log.info('patch applied successfully') return | log.info('applied successfully with patch level %s' %patchlevel) for f in logFiles: f.close() return rightLevels = [] for idx, (patchlevel, logFile) in enumerate(logFiles): s = logFile.read().strip() if "can't find file to patch" not in s: rightLevels.append(idx) logFiles[idx] = (patchlevel, s) for idx, (patchleve... | def patchme(self, patch, f, destDir, patchlevels): for patchlevel in patchlevels: patchArgs = [ 'patch', '-d', destDir, '-p%s'%patchlevel, ] if self.backup: patchArgs.extend(['-b', '-z', self.backup]) if self.extraArgs: patchArgs.extend(self.extraArgs) |
print >> sys.stderr, "warning: cacheDB config option is ignored " "by the standalone server" | print >> sys.stderr, ("warning: cacheDB config option is ignored " "by the standalone server") | def check(self): if self.cacheDB: print >> sys.stderr, "warning: cacheDB config option is ignored " "by the standalone server" |
print >> sys.stderr, "warning: closed config option is ignored " "by the standalone server" | print >> sys.stderr, ("warning: closed config option is ignored " "by the standalone server") | def check(self): if self.cacheDB: print >> sys.stderr, "warning: cacheDB config option is ignored " "by the standalone server" |
print >> sys.stderr, "warning: commitAction config option is " "ignored by the standalone server" | print >> sys.stderr, ("warning: commitAction config option is " "ignored by the standalone server") | def check(self): if self.cacheDB: print >> sys.stderr, "warning: cacheDB config option is ignored " "by the standalone server" |
if name not in self.__dict__: self.__dict__[name] = magic(name, self.basedir) return self.__dict__[name] | if name not in self: self[name] = magic(name, self.basedir) return dict.__getitem__(self, name) | def __getitem__(self, name): |
job[1][0] is not None and not job[3]) | job[2][0] is not None and not job[3]) | # def _mergeGroupChanges -- main body begins here |
if not path: | if path: oldPath = oldPackage.getFile(fileId)[0] dispStr = "%s (aka %s)" % (path, oldPath) else: | def diff(repos, versionStr = None): try: state = SourceStateFromFile("SRS") except OSError: return if state.getVersion() == versions.NewVersion(): log.error("no versions have been committed") return if versionStr: versionStr = state.expandVersionStr(versionStr) pkgList = repos.findTrove(None, state.getName(), versio... |
sys.stdout.write("%s" % path) else: oldPath = oldPackage.getFile(fileId)[0] sys.stdout.write("%s (aka %s)" % (path, oldPath)) if not newVersion: print | dispStr = path if not newVersion: sys.stdout.write(dispStr + '\n') | def diff(repos, versionStr = None): try: state = SourceStateFromFile("SRS") except OSError: return if state.getVersion() == versions.NewVersion(): log.error("no versions have been committed") return if versionStr: versionStr = state.expandVersionStr(versionStr) pkgList = repos.findTrove(None, state.getName(), versio... |
sys.stdout.write(": changed\n") | sys.stdout.write(dispStr + ": changed\n") sys.stdout.write("Index: %s\n%s\n" %(path, '=' * 68)) | def diff(repos, versionStr = None): try: state = SourceStateFromFile("SRS") except OSError: return if state.getVersion() == versions.NewVersion(): log.error("no versions have been committed") return if versionStr: versionStr = state.expandVersionStr(versionStr) pkgList = repos.findTrove(None, state.getName(), versio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.