Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 23834 Details for
Bug 38168
portage-2.0.50_pre16: regenworld is broken
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
new regenworld script
regenworld (text/plain), 2.22 KB, created by
Marius Mauch (RETIRED)
on 2004-01-14 17:40:48 UTC
(
hide
)
Description:
new regenworld script
Filename:
MIME Type:
Creator:
Marius Mauch (RETIRED)
Created:
2004-01-14 17:40:48 UTC
Size:
2.22 KB
patch
obsolete
>#!/usr/bin/python > >import sys >sys.path.insert(0, "/usr/lib/portage/pym") > >import portage, string, re > >__candidatematcher__ = re.compile("^[0-9]+: \\*\\*\\* emerge ") >__noncandidatematcher__ = re.compile(" sync( |$)| clean( |$)| search( |$)|--oneshot| unmerge( |$)") > >def issyspkg(pkgline): > return (pkgline[0] == "*") > >def iscandidate(logline): > return (__candidatematcher__.match(logline) \ > and not __noncandidatematcher__.search(logline)) > >def getpkginfo(logline): > logline = re.sub("^[0-9]+: \\*\\*\\* emerge ", "", logline) > logline = logline.strip() > logline = re.sub("(\\S+\\.(ebuild|tbz2))|(--\\S+)|inject ", "", logline) > return logline.strip() > >__uniqlist__ = [] >def isunwanted(pkgline): > if pkgline in ["world", "system", "depclean", "info", "regen", ""]: > return False > elif pkgline in __uniqlist__: > return False > elif not re.search("^[a-zA-Z<>=~]", pkgline): > return False > else: > __uniqlist__.append(pkgline) > return True > >worldlist = portage.grabfile("/var/cache/edb/world") >syslist = portage.grabfile(portage.profiledir+"/packages") >syslist = filter(issyspkg, syslist) > >logfile = portage.grabfile("/var/log/emerge.log") >biglist = filter(iscandidate, logfile) >biglist = map(getpkginfo, biglist) >tmplist = [] >for l in biglist: > tmplist += l.split() >biglist = filter(isunwanted, tmplist) >#for p in biglist: ># print p >#sys.exit(0) > ># resolving virtuals >realsyslist = [] >for mykey in syslist: > # drop the asterix > mykey = mykey[1:] > #print "candidate:",mykey > mylist=portage.db["/"]["vartree"].dbapi.match(mykey) > if mylist: > mykey=portage.cpv_getkey(mylist[0]) > if mykey not in realsyslist: > realsyslist.append(mykey) > >for mykey in biglist: > #print "checking:",mykey > try: > mylist=portage.db["/"]["vartree"].dbapi.match(mykey) > except KeyError: > print "* ignoring broken log entry for %s (likely injected)" % mykey > except ValueError, e: > print "* %s is an ambigous package name, candidates are:\n%s" % (mykey, e) > continue > if mylist: > #print "mylist:",mylist > myfavkey=portage.cpv_getkey(mylist[0]) > if (myfavkey not in realsyslist) and (myfavkey not in worldlist): > print "add to world:",myfavkey > worldlist.append(myfavkey) > >myfile=open("/var/cache/edb/world", "w") >myfile.write(string.join(worldlist, '\n')+'\n') >myfile.close()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 38168
: 23834