rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
self.step_vectors[ chrom ][ 0 : self.chrom_lengths[chrom] ] = set()
self.step_vectors[ chrom ][ 0 : chrom_lengths[chrom] ] = set()
def __init__( self, dict chrom_lengths, bool stranded=True ): GenomicArray.__init__( self, chrom_lengths, stranded, 'O' ) for chrom in self.step_vectors: if self.stranded: self.step_vectors[ chrom ][ strand ][ 0 : self.chrom_lengths[chrom] ] = set() else: self.step_vectors[ chrom ][ 0 : self.chrom_lengths[chrom] ] = se...
newset = set.copy()
newset = oldset.copy()
def _f( oldset ): newset = set.copy() newset.add( value ) return newset
sys.stderr.write( "Error: %s\n" % "; ".join( sys.exc_info()[1] ) )
sys.stderr.write( "Error: %s\n" % str( sys.exc_info()[1] ) )
def main(): optParser = optparse.OptionParser( usage = "%prog [options] sam_file gff_file", description= "This script takes an alignment file in SAM format and a " + "feature file in GFF format and calculates for each feature " + "the number of reads mapping to it. See " + "http://www-huber.embl.de/users/anders/HTSe...
fd = open(lockfile, 'r')
try: fd = open(lockfile, 'r') except (IOError, OSError), e: msg = _("Could not open lock %s: %s") % (lockfile, e) raise Errors.LockError(1, msg)
def doLock(self, lockfile = YUM_PID_FILE): """perform the yum locking, raise yum-based exceptions, not OSErrors""" # if we're not root then we don't lock - just return nicely if self.conf.uid != 0: return root = self.conf.installroot lockfile = root + '/' + lockfile # lock in the chroot lockfile = os.path.normpath(lo...
my_csum = misc.checksum(csum_type, fp) my_st_size = fp.read_size
if fp.read_size: my_csum = misc.checksum(csum_type, fp) my_st_size = fp.read_size
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
prob.disk_value = my_st.st_size
prob.disk_value = my_st_size
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
self.logger.warning(_("Removing %s from the transaction") % txmbr)
self.logger.info(_("Removing %s from the transaction") % txmbr)
def remove(self, po=None, **kwargs): """try to find and mark for remove the specified package(s) - if po is specified then that package object (if it is installed) will be marked for removal. if no po then look at kwargs, if neither then raise an exception"""
omtime = os.path.getmtime(rpmdbfname)
omtime = os.path.getctime(rpmdbfname)
def _get_cached_simpleVersion_main(self): """ Return the cached string of the main rpmdbv. """ if self._have_cached_rpmdbv_data is not None: return self._have_cached_rpmdbv_data
('-c', '-d', '-e', '--installroot',
('-c', '--config', '-d', '--debuglevel', '-e', '--errorlevel', '--installroot',
def firstParse(self,args): # Parse only command line options that affect basic yum setup try: args = _filtercmdline( ('--noplugins','--version','-q', '-v', "--quiet", "--verbose"), ('-c', '-d', '-e', '--installroot', '--disableplugin', '--enableplugin', '--releasever', '--setopt'), args) except ValueError, arg: self.ba...
return 1, ['Failed history info']
return 1, ['Failed history list']
def historyListCmd(self, extcmds): """ Shows the user a list of data about the history. """
try: int(tid) except ValueError: self.logger.critical(_('No transaction ID given')) return 1, ['Failed history addon-info'] except TypeError: pass
if tid == 'last': tid = None if tid is not None: try: int(tid) except ValueError: self.logger.critical(_('Bad transaction ID given')) return 1, ['Failed history addon-info']
def historyAddonInfoCmd(self, extcmds): tid = None if len(extcmds) > 1: tid = extcmds[1] try: int(tid) except ValueError: self.logger.critical(_('No transaction ID given')) return 1, ['Failed history addon-info'] except TypeError: pass # No tid arg. passed, use last...
def _try_read_cpuinfo(): """ Try to read /proc/cpuinfo ... if we can't ignore errors (ie. proc not mounted). """ try: lines = open("/proc/cpuinfo", "r").readlines() return lines except: return []
def getArchList(thisarch=None): # this returns a list of archs that are compatible with arch given if not thisarch: thisarch = canonArch archlist = [thisarch] while thisarch in arches: thisarch = arches[thisarch] archlist.append(thisarch) # hack hack hack # sparc64v is also sparc64 compat if archlist[0] == "sparc64v"...
f = open("/proc/cpuinfo", "r") lines = f.readlines() f.close() for line in lines:
for line in _try_read_cpuinfo():
def getCanonX86Arch(arch): # if arch == "i586": f = open("/proc/cpuinfo", "r") lines = f.readlines() f.close() for line in lines: if line.startswith("model name") and line.find("Geode(TM)") != -1: return "geode" return arch # only athlon vs i686 isn't handled with uname currently if arch != "i686": return arch # if we...
f = open("/proc/cpuinfo", "r") lines = f.readlines() f.close() for line in lines:
for line in _try_read_cpuinfo():
def getCanonPPCArch(arch): # FIXME: should I do better handling for mac, etc? if arch != "ppc64": return arch machine = None f = open("/proc/cpuinfo", "r") lines = f.readlines() f.close() for line in lines: if line.find("machine") != -1: machine = line.split(':')[1] break if machine is None: return arch if machine.fi...
f = open("/proc/cpuinfo", "r") lines = f.readlines() f.close() for line in lines:
for line in _try_read_cpuinfo():
def getCanonSPARCArch(arch): # Deal with sun4v, sun4u, sun4m cases SPARCtype = None f = open("/proc/cpuinfo", "r") lines = f.readlines() f.close() for line in lines: if line.startswith("type"): SPARCtype = line.split(':')[1] break if SPARCtype is None: return arch if SPARCtype.find("sun4v") != -1: if arch.startswith("...
f = open("/proc/cpuinfo", "r") lines = f.readlines() f.close() for line in lines:
for line in _try_read_cpuinfo():
def getCanonX86_64Arch(arch): if arch != "x86_64": return arch vendor = None f = open("/proc/cpuinfo", "r") lines = f.readlines() f.close() for line in lines: if line.startswith("vendor_id"): vendor = line.split(':')[1] break if vendor is None: return arch if vendor.find("Authentic AMD") != -1 or vendor.find("Authent...
fo.write(data)
fo.write(to_unicode(data))
def write_addon_data(self, dataname, data): """append data to an arbitrary-named file in the history addon_path/transaction id location, returns True if write succeeded, False if not""" if not hasattr(self, '_tid'): # maybe we should raise an exception or a warning here? return False if not dataname: return False if...
raise Errors.YumBaseError, errors
self.logger.critical(_("Transaction couldn't start:")) for e in errors: self.logger.critical(e[0]) raise Errors.YumBaseError, _("Could not run transaction.")
def runTransaction(self, cb): """takes an rpm callback object, performs the transaction"""
if os.path.link(dir_fsvars + fsvar):
if os.path.islink(dir_fsvars + fsvar):
def _apply_installroot(yumconf, option): path = getattr(yumconf, option) ir_path = yumconf.installroot + path ir_path = ir_path.replace('//', '/') # os.path.normpath won't fix this and # it annoys me ir_path = varReplace(ir_path, yumvars) setattr(yumconf, option, ir_path)
txmbr = self.tsInfo.addErase(toremove)
txmbr = self.tsInfo.addErase(po)
def _sort_and_filter_installonly(pkgs): """ Allow the admin to specify some overrides fo installonly pkgs. using the yumdb. """ ret_beg = [] ret_mid = [] ret_end = [] for pkg in sorted(pkgs): if 'installonly' not in pkg.yumdb_info: ret_mid.append(pkg) continue
if hasattr(self, 'repo_setopts') and thisrepo.id in self.repo_setopts:
if thisrepo.id in self.repo_setopts:
def getReposFromConfigFile(self, repofn, repo_age=None, validate=None): """read in repositories from a config .repo file"""
if len(obsoleting) > 1: first = obsoleting[0] obsoleting = [pkgtup for pkgtup in obsoleting if first[0] == pkgtup[0]] if len(obsoleting) > 1: def _sort_ver(x, y): n1,a1,e1,v1,r1 = x n2,a2,e2,v2,r2 = y return compareEVR((e1,v1,r1), (e2,v2,r2)) obsoleting.sort(_sort_ver) first = obsoleting[0] obsoleting = [pkgtup for p...
def _pkg2obspkg(self, po): """ Given a package return the package it's obsoleted by and so we should install instead. Or None if there isn't one. """ thispkgobsdict = self.up.checkForObsolete([po.pkgtup]) if po.pkgtup in thispkgobsdict: obsoleting = thispkgobsdict[po.pkgtup] oobsoleting = [] # We want to keep the arch...
foo-1.i386 & foo-1.xf86_64 is updated by foo-2.i386 & foo-2.xf86_64 foo-2.xf86_64 has a missing req, and get skipped, foo-2.i386 has to be skipped to or it will fail in the rpm test transaction
foo-1.i386 & foo-1.x86_64 is updated by foo-2.i386 & foo-2.x86_64 foo-2.x86_64 has a missing req, and gets skipped, foo-2.i386 has to be skipped too or it will fail in the rpm test transaction
def testMultiLibUpdate(self): ''' foo-1.i386 & foo-1.xf86_64 is updated by foo-2.i386 & foo-2.xf86_64 foo-2.xf86_64 has a missing req, and get skipped, foo-2.i386 has to be skipped to or it will fail in the rpm test transaction ''' ipo1 = self.instPackage('foo', '1',arch='i386') ipo2 = self.instPackage('foo', '1',arch=...
for txmbr in self.tsInfo:
for txmbr in sorted(self.tsInfo):
def _printTransaction(self): #transaction set states state = { TS_UPDATE : "update", TS_INSTALL : "install", TS_TRUEINSTALL: "trueinstall", TS_ERASE : "erase", TS_OBSOLETED : "obsoleted", TS_OBSOLETING : "obsoleting", TS_AVAILABLE : "available", TS_UPDATED : "updated"}
for po,rel in txmbr.relatedto:
for po,rel in sorted(txmbr.relatedto):
def _printTransaction(self): #transaction set states state = { TS_UPDATE : "update", TS_INSTALL : "install", TS_TRUEINSTALL: "trueinstall", TS_ERASE : "erase", TS_OBSOLETED : "obsoleted", TS_OBSOLETING : "obsoleting", TS_AVAILABLE : "available", TS_UPDATED : "updated"}
self.assertResult((all['arp3'], all['aoop1'], all['aoop2']))
self.assertResult((all['arp3'], all['arp4']))
def testRLDaplMessWeirdInst3(self): rps, aps, ret, all = self._helperRLDaplMess() res, msg = self.runOperation(['install', 'dapl-2.0.15'], rps, aps)
self.assertResult((all['arp3'], all['aoop1'], all['aoop2']))
self.assertResult((all['arp3'], all['arp4']))
def testRLDaplMessWeirdUp3(self): rps, aps, ret, all = self._helperRLDaplMess() res, msg = self.runOperation(['update', 'dapl-2.0.15'], rps, aps)
msg += """\n </format>"""
if msg[-1] != '\n': msg += """\n""" msg += """ </format>"""
def _dump_format_items(self): msg = " <format>\n" if self.license: msg += """ <rpm:license>%s</rpm:license>\n""" % misc.to_xml(self.license) else: msg += """ <rpm:license/>\n""" if self.vendor: msg += """ <rpm:vendor>%s</rpm:vendor>\n""" % misc.to_xml(self.vendor) else: msg += """ <rpm:vendor/>\n""" if s...
msg =""
msg ="\n"
def _dump_files(self, primary=False): msg ="" if not primary: files = self.returnFileEntries('file') dirs = self.returnFileEntries('dir') ghosts = self.returnFileEntries('ghost') else: files = self.returnFileEntries('file', primary_only=True) dirs = self.returnFileEntries('dir', primary_only=True) ghosts = self.returnF...
SELECT tid,rpid,name,epoch,version,release,arch,pkgtupid,
SELECT tid,rpid,name,epoch,version,release,arch,pkgtups.pkgtupid,
def search(self, patterns, ignore_case=True): """ Search for history transactions which contain specified packages al. la. "yum list". Returns transaction ids. """ # Search packages ... kind of sucks that it's search not list, pkglist?
def exUserCancel(self): self.logger.critical(_('\n\nExiting on user cancel')) if self.unlock(): return 200 return 1 def exIOError(self, e): if e.errno == 32: self.logger.critical(_('\n\nExiting on Broken Pipe')) else: self.logger.critical(_('\n\n%s') % str(e)) if self.unlock(): return 200 return 1 def exPluginExit(se...
def __init__(self,name,ver,usage): YumBaseCli.__init__(self) self._parser = YumOptionParser(base=self,utils=True,usage=usage) self._usage = usage self._utilName = name self._utilVer = ver self._option_group = OptionGroup(self._parser, "%s options" % self._utilName,"") self._parser.add_option_group(self._option_group) s...
def doUtilBuildTransaction(self): try: (result, resultmsgs) = self.buildTransaction() except plugins.PluginYumExit, e: return self.exPluginExit(e) except Errors.YumBaseError, e: result = 1 resultmsgs = [unicode(e)] except KeyboardInterrupt: return self.exUserCancel() except IOError, e: return self.exIOError(e) if res...
def doUtilYumSetup(self): """do a default setup for all the normal/necessary yum components, really just a shorthand for testing""" # FIXME - we need another way to do this, I think. try: self.waitForLock() self._getTs() self._getRpmDB() self._getRepos(doSetup = True) self._getSacks() except Errors.YumBaseError, msg: s...
def exUserCancel(): self.logger.critical(_('\n\nExiting on user cancel')) if unlock(): return 200 return 1 def exIOError(e): if e.errno == 32: self.logger.critical(_('\n\nExiting on Broken Pipe')) else: self.logger.critical(_('\n\n%s') % str(e)) if unlock(): return 200 return 1 def exPluginExit(e): '''Called when a p...
def exUserCancel(): self.logger.critical(_('\n\nExiting on user cancel')) if unlock(): return 200 return 1
return exPluginExit(e)
return self.exPluginExit(e)
def unlock(): try: self.closeRpmDB() self.doUnlock() except Errors.LockError, e: return 200 return 0
return exFatal(e)
return self.exFatal(e)
def unlock(): try: self.closeRpmDB() self.doUnlock() except Errors.LockError, e: return 200 return 0
return exUserCancel()
return self.exUserCancel()
def unlock(): try: self.closeRpmDB() self.doUnlock() except Errors.LockError, e: return 200 return 0
return exIOError(e)
return self.exIOError(e,)
def unlock(): try: self.closeRpmDB() self.doUnlock() except Errors.LockError, e: return 200 return 0
if unlock(): return 200
if self.unlock(): return 200
def unlock(): try: self.closeRpmDB() self.doUnlock() except Errors.LockError, e: return 200 return 0
self.verbose_logger.log(logginglevels.DEBUG_2, _('Not Updating Package that is already obsoleted: %s.%s %s:%s-%s'),
self.verbose_logger.log(logginglevels.DEBUG_2, _('Not Updating Package that is already obsoleted: %s.%s %s:%s-%s') %
def update(self, po=None, requiringPo=None, **kwargs): """try to mark for update the item(s) specified. po is a package object - if that is there, mark it for update, if possible else use **kwargs to match the package needing update if nothing is specified at all then attempt to update everything returns the list of t...
self.verbose_logger.log(logginglevels.DEBUG_2, _('Package is already obsoleted: %s.%s %s:%s-%s'), obsoleted)
self.verbose_logger.log(logginglevels.DEBUG_2, _('Package is already obsoleted: %s.%s %s:%s-%s') % obsoleted)
def update(self, po=None, requiringPo=None, **kwargs): """try to mark for update the item(s) specified. po is a package object - if that is there, mark it for update, if possible else use **kwargs to match the package needing update if nothing is specified at all then attempt to update everything returns the list of t...
self.verbose_logger.log(logginglevels.DEBUG_2, _('Not Updating Package that is already updated: %s.%s %s:%s-%s'),
self.verbose_logger.log(logginglevels.DEBUG_2, _('Not Updating Package that is already updated: %s.%s %s:%s-%s') %
def update(self, po=None, requiringPo=None, **kwargs): """try to mark for update the item(s) specified. po is a package object - if that is there, mark it for update, if possible else use **kwargs to match the package needing update if nothing is specified at all then attempt to update everything returns the list of t...
def _iter_two_pkgs(self, ignore):
def _iter_two_pkgs(self, ignore_provides):
def _iter_two_pkgs(self, ignore): last = None for pkg in sorted(self.returnPackages()): if pkg.name in ignore: continue if last is None: last = pkg continue yield last, pkg last = pkg
if pkg.name in ignore: continue
if pkg.name in ignore_provides: continue if ignore_provides.intersection(set(pkg.provides_names)): continue
def _iter_two_pkgs(self, ignore): last = None for pkg in sorted(self.returnPackages()): if pkg.name in ignore: continue if last is None: last = pkg continue yield last, pkg last = pkg
def check_duplicates(self, ignore=[]): """ Checks for any missing dependencies. """
def check_duplicates(self, ignore_provides=[]): """ Checks for any "duplicate packages" (those with multiple versions installed), we ignore any packages with a provide in the passed provide list (this is how installonlyworks, so we do the same). """ ignore_provides = set(ignore_provides)
def check_duplicates(self, ignore=[]): """ Checks for any missing dependencies. """
for last, pkg in self._iter_two_pkgs(ignore):
for last, pkg in self._iter_two_pkgs(ignore_provides):
def check_duplicates(self, ignore=[]): """ Checks for any missing dependencies. """
def decompress(filename, dest=None, fn_only=False):
def decompress(filename, dest=None, fn_only=False, check_timestamps=False):
def decompress(filename, dest=None, fn_only=False): """take a filename and decompress it into the same relative location. if the file is not compressed just return the file""" out = dest if not dest: out = filename if filename.endswith('.gz'): ztype='gz' if not dest: out = filename.replace('.gz', '') elif filename.e...
''' Helper function to call _pkgRKNEVRAExcluded.
''' Helper function to call _pkgExcludedRKNEVRA.
def _pkgExcludedRKT(self, repo,pkgKey, pkgtup): ''' Helper function to call _pkgRKNEVRAExcluded. Takes a repo, pkgKey and a package tuple''' (n,a,e,v,r) = pkgtup return self._pkgExcludedRKNEVRA(repo, pkgKey, n,e,v,r,a)
''' Helper function to call _pkgRKNEVRAExcluded.
''' Helper function to call _pkgExcludedRKNEVRA.
def _pkgExcludedRKD(self, repo,pkgKey, data): ''' Helper function to call _pkgRKNEVRAExcluded. Takes a repo, pkgKey and a dict of package data''' (n,a,e,v,r) = (data['name'], data['arch'], data['epoch'], data['version'], data['release']) return self._pkgExcludedRKNEVRA(repo, pkgKey, n,e,v,r,a)
''' Helper function to call _pkgRKNEVRAExcluded.
''' Helper function to call _pkgExcludedRKNEVRA.
def _pkgExcluded(self, po): ''' Helper function to call _pkgRKNEVRAExcluded. Takes a package object. ''' return self._pkgExcludedRKT(po.repo, po.pkgKey, po.pkgtup)
if flags and type(flags) == type(0):
if flags and (type(flags) == type(0) or type(flags) == type(0L)):
def formatRequire (name, version, flags): ''' Return a human readable requirement string (ex. foobar >= 2.0) @param name: requirement name (ex. foobar) @param version: requirent version (ex. 2.0) @param flags: binary flags ( 0010 = equal, 0100 = greater than, 1000 = less than ) ''' s = name if flags and type(flags) =...
if count not in sorted_lists: sorted_lists[count] = [] sorted_lists[count].append((pkg, matchkeys, tagresults))
if pkg not in results_by_pkg: results_by_pkg[pkg] = [] results_by_pkg[pkg].append((matchkeys, tagresults))
def results2sorted_lists(tmpres, sorted_lists): for (po, count) in tmpres: # check the pkg for sanity # pop it into the sorted lists tmpkeys = set() tmpvalues = [] if count not in sorted_lists: sorted_lists[count] = [] for s in real_crit_lower: for field in fields: value = to_unicode(getattr(po, field)) if value and ...
for item in sorted_lists.values(): for pkg, keys, values in item: if pkg not in results_by_pkg: results_by_pkg[pkg] = [] results_by_pkg[pkg].append((keys,values)) sorted_lists = {} for pkg in results_by_pkg: totkeys = [] totvals = [] for (keys, values) in results_by_pkg[pkg]: totkeys.extend(keys) totvals.extend(val...
def results2sorted_lists(tmpres, sorted_lists): for (po, count) in tmpres: # check the pkg for sanity # pop it into the sorted lists tmpkeys = set() tmpvalues = [] if count not in sorted_lists: sorted_lists[count] = [] for s in real_crit_lower: for field in fields: value = to_unicode(getattr(po, field)) if value and ...
print x
print to_unicode(x.__str__())
def _out(x): print x
for error in msg.split('\n'):
for error in msg.splitlines():
def log_scriptlet_output(self, data, msg): """ Note that data can be either a real pkg. ... or not. """ if msg is None or not hasattr(self, '_tid'): return # Not configured to run
if name is not None and name in self._pkgmatch_fails:
if name is not None and name in self._pkgname_fails:
def _search(self, name=None, epoch=None, ver=None, rel=None, arch=None): '''List of matching packages, to zero or more of NEVRA.''' if name is not None and name in self._pkgmatch_fails: return []
self._pkgmatch_fails.add(name)
self._pkgname_fails.add(name)
def _search(self, name=None, epoch=None, ver=None, rel=None, arch=None): '''List of matching packages, to zero or more of NEVRA.''' if name is not None and name in self._pkgmatch_fails: return []
return syslog_module.LOG_USER
return _syslog_facility_map["USER"]
def syslogFacilityMap(facility): if type(facility) == int: return facility elif facility.upper() in _syslog_facility_map: return _syslog_facility_map[facility.upper()] elif (facility.upper().startswith("LOG_") and facility[4:].upper() in _syslog_facility_map): return _syslog_facility_map[facility[4:].upper()] return sy...
syslogformatter = logging.Formatter("yum: %(message)s")
def doLoggingSetup(debuglevel, errorlevel, syslog_ident=None, syslog_facility=None, syslog_device='/dev/log'): """ Configure the python logger. errorlevel is optional. If provided, it will override the logging level provided in the logging config file for error messages. debuglevel is optional. If provided, it will ov...
log_dev = syslog_device
def doLoggingSetup(debuglevel, errorlevel, syslog_ident=None, syslog_facility=None, syslog_device='/dev/log'): """ Configure the python logger. errorlevel is optional. If provided, it will override the logging level provided in the logging config file for error messages. debuglevel is optional. If provided, it will ov...
if os.path.exists(log_dev):
if os.path.exists(syslog_device):
def doLoggingSetup(debuglevel, errorlevel, syslog_ident=None, syslog_facility=None, syslog_device='/dev/log'): """ Configure the python logger. errorlevel is optional. If provided, it will override the logging level provided in the logging config file for error messages. debuglevel is optional. If provided, it will ov...
syslog = logging.handlers.SysLogHandler(log_dev) syslog.setFormatter(syslogformatter) filelogger.addHandler(syslog) if syslog_ident is not None or syslog_facility is not None: ident = syslog_ident or '' facil = syslog_facility or 'LOG_USER' syslog_module.openlog(ident, 0, syslogFacilityMap(facil))
facil = syslogFacilityMap(syslog_facility or "USER") syslog = logging.handlers.SysLogHandler(syslog_device, facil)
def doLoggingSetup(debuglevel, errorlevel, syslog_ident=None, syslog_facility=None, syslog_device='/dev/log'): """ Configure the python logger. errorlevel is optional. If provided, it will override the logging level provided in the logging config file for error messages. debuglevel is optional. If provided, it will ov...
foo.i386 will be compared"""
foo.i386 will be compared Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64 The last _two_ pkgs will be returned, not just one of them. """
def returnNewestByNameArch(self, naTup=None, patterns=None, ignore_case=False): """return list of newest packages based on name, arch matching this means(in name.arch form): foo.i386 and foo.noarch are not compared to each other for highest version only foo.i386 and foo.i386 will be compared""" raise NotImplementedErro...
be compared to each other for highest version. Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64 The last _two_ pkgs will be returned, not just one of them. """
be compared to each other for highest version."""
def returnNewestByName(self, name=None, patterns=None, ignore_case=False): """return list of newest packages based on name matching this means(in name.arch form): foo.i386 and foo.noarch will be compared to each other for highest version. Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64 The last _two_ pkgs will...
foo.i386 will be compared"""
foo.i386 will be compared. Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64 The last _two_ pkgs will be returned, not just one of them. """
def returnNewestByNameArch(self, naTup=None, patterns=None, ignore_case=False): """return list of newest packages based on name, arch matching this means(in name.arch form): foo.i386 and foo.noarch are not compared to each other for highest version only foo.i386 and foo.i386 will be compared""" calr = self._computeAggr...
be compared to each other for highest version. Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64 The last _two_ pkgs will be returned, not just one of them. """
be compared to each other for highest version."""
def returnNewestByName(self, name=None, patterns=None, ignore_case=False): """return list of newest packages based on name matching this means(in name.arch form): foo.i386 and foo.noarch will be compared to each other for highest version. Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64 The last _two_ pkgs will...
foo.i386 will be compared"""
foo.i386 will be compared Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64 The last _two_ pkgs will be returned, not just one of them. """
def returnNewestByNameArch(self, naTup=None, patterns=None, ignore_case=False): """return list of newest packages based on name, arch matching this means(in name.arch form): foo.i386 and foo.noarch are not compared to each other for highest version only foo.i386 and foo.i386 will be compared""" highdict = {} # If naTup...
be compared to each other for highest version. Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64 The last _two_ pkgs will be returned, not just one of them. """
be compared to each other for highest version."""
def returnNewestByName(self, name=None, patterns=None, ignore_case=False): """return list of newest packages based on name matching this means(in name.arch form): foo.i386 and foo.noarch will be compared to each other for highest version. Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64 The last _two_ pkgs will...
Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64 The last _two_ pkgs will be returned, not just one of them. """
Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64"""
def packagesNewestByName(pkgs): """ Does the same as PackageSack.returnNewestByName(). Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64 The last _two_ pkgs will be returned, not just one of them. """ newest = {} for pkg in pkgs: key = pkg.name # Can't use pkg.__cmp__ because it takes .arch into account cval = ...
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
for filetuple in fi: (fn, size, mode, mtime, flags, dev, inode, link, state, vflags, user, group, csum) = filetuple if patterns: matched = False for p in patterns: if fnmatch.fnmatch(fn, p): matched = True break if not matched: continue ftypes = [] if flags & rpm.RPMFILE_CONFIG: ftypes.append('configuration') if fla...
pfs = _RPMVerifyPackage(fi, csum_type, patterns, all) for pf in pfs: fn = pf.filename ftypes = list(pf.rpmfile_types) if pf.rpmfile_state != "normal": ftypes.append("state=" + pf.rpmfile_state)
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if flags & rpm.RPMFILE_MISSINGOK and fake_problems:
if 'missing ok' in pf.rpmfile_types and fake_problems:
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if flags & rpm.RPMFILE_MISSINGOK and not all:
if 'missing ok' in pf.rpmfile_types and not all:
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if flags & rpm.RPMFILE_GHOST and fake_problems:
if 'ghost' in pf.rpmfile_types and fake_problems:
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if flags & rpm.RPMFILE_GHOST and not all:
if 'ghost' in pf.rpmfile_types and not all:
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if os.path.lexists(fn):
if os.path.lexists(pf.filename):
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
my_st = os.lstat(fn)
my_st = os.lstat(pf.filename)
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if mode < 0: mode = (mode & 0xFFFF) ftype = _ftype(mode) my_ftype = _ftype(my_st.st_mode) if vflags & _RPMVERIFY_RDEV and ftype != my_ftype: prob = _PkgVerifyProb('type', 'file type does not match', ftypes) prob.database_value = ftype prob.disk_value = my_ftype problems.append(prob) if (ftype == "symlink" and m...
my_ftype = YUMVerifyPackageFile._ftype(my_st.st_mode) verify_dev = False if (pf.verify_dev and (pf.ftype.endswith("device") or my_ftype.endswith("device"))): verify_dev = True if verify_dev: if pf.ftype != my_ftype: prob = _PkgVerifyProb('type','file type does not match', ftypes) prob.database_value = pf.ftype prob.di...
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
prob.database_value = fnl
prob.database_value = pf.readlink
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if my_ftype == "symlink" and ftype == "file":
if my_ftype == "symlink" and pf.ftype == "file":
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
my_st_size = os.stat(fn).st_size
my_st_size = os.stat(pf.filename).st_size
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if (check_content and vflags & _RPMVERIFY_MTIME and int(my_st.st_mtime) != int(mtime)):
if (check_content and pf.verify_mtime and int(my_st.st_mtime) != int(pf.mtime)):
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
prob.database_value = mtime
prob.database_value = pf.mtime
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if check_perms and vflags & _RPMVERIFY_USER and my_user != user:
if check_perms and pf.verify_user and my_user != pf.user:
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
prob.database_value = user
prob.database_value = pf.user
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if (check_perms and vflags & _RPMVERIFY_GROUP and my_group != group):
if check_perms and pf.verify_group and my_group != pf.group:
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
prob.database_value = group
prob.database_value = pf.group
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if check_perms and vflags & _RPMVERIFY_MODE and my_mode != mode:
if check_perms and pf.verify_mode and my_mode != pf.mode:
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
prob.database_value = mode
prob.database_value = pf.mode
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if fast and not problems and (my_st_size == size): vflags &= ~_RPMVERIFY_DIGEST
verify_digest = pf.verify_digest if fast and not problems and (my_st_size == pf.size): verify_digest = False if not pf.digest: verify_digest = False
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
((have_prelink and (vflags & _RPMVERIFY_FILESIZE) and (my_st_size != size)) or (csum and vflags & _RPMVERIFY_DIGEST))):
(verify_digest or (pf.verify_size and have_prelink and my_st_size != pf.size))): if pf.digest: digest_type = pf.digest[0] csum = pf.digest[0] + ':' + pf.digest[1] else: digest_type = csum_type csum = ''
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
my_csum = misc.checksum(csum_type, fn) gen_csum = True
my_csum = misc.checksum(digest_type, pf.filename) my_csum = digest_type + ':' + my_csum
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
gen_csum = False if csum and vflags & _RPMVERIFY_DIGEST and not gen_csum:
my_csum = None if pf.verify_digest and my_csum is None:
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if gen_csum and my_csum != csum and have_prelink:
if my_csum != csum and have_prelink:
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
p = Popen([prelink_cmd, "-y", fn],
p = Popen([prelink_cmd, "-y", pf.filename],
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
tcsum = misc.checksum(csum_type, fp)
tcsum = misc.checksum(digest_type, fp)
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if (csum and vflags & _RPMVERIFY_DIGEST and gen_csum and my_csum != csum):
if pf.verify_digest and my_csum != csum:
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
if (check_content and vflags & _RPMVERIFY_FILESIZE and my_st_size != size):
if check_content and pf.verify_size and my_st_size != pf.size:
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
prob.database_value = size
prob.database_value = pf.size
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
os.stat(fn)
os.stat(pf.filename)
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...
results[fn] = problems
results[pf.filename] = problems
def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "...