Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 29020 Details for
Bug 46096
fixdbentries breaks vardb and binaries
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to portage to fix corruption automatically
portage-2.0.50-r4-dbcorruption.patch (text/plain), 2.62 KB, created by
Jason Stubbs (RETIRED)
on 2004-04-10 05:51:11 UTC
(
hide
)
Description:
Patch to portage to fix corruption automatically
Filename:
MIME Type:
Creator:
Jason Stubbs (RETIRED)
Created:
2004-04-10 05:51:11 UTC
Size:
2.62 KB
patch
obsolete
>--- portage-orig/pym/portage.py 2004-04-08 12:21:06.000000000 +0900 >+++ portage/pym/portage.py 2004-04-10 21:42:04.571708744 +0900 >@@ -6415,7 +6415,7 @@ > mtimedbkeys=[ > "updates", "info", > "version", "starttime", >-"resume", "ldpath" >+"resume", "ldpath", "corrupted" > ] > mtimedbfile=root+"var/cache/edb/mtimedb" > try: >@@ -6532,6 +6532,65 @@ > > atexit.register(portageexit) > >+ >+def fixcorruptentries(path): >+ if path[-1] != "/": >+ path += "/" >+ ebuild = os.path.basename(os.path.dirname(path))+".ebuild" >+ ebuildfile = open(path+ebuild) >+ orig = ebuildfile.readlines() >+ ebuildfile.close() >+ if "\1" not in "".join(orig): >+ return >+ os.system("bunzip2 "+path+"environment.bz2") >+ envfile = open(path+"environment") >+ lines = envfile.readlines() >+ envfile.close() >+ os.system("bzip2 "+path+"environment") >+ env = {} >+ for line in lines: >+ line = " ".join(line.split()) >+ values = line.split("=") >+ if len(values) == 1: >+ break >+ key = values[0] >+ value = "=".join(values[1:]) >+ if value and value[0] == "$": >+ value = value[1:] >+ if value and value[0] == "'": >+ value = value[1:-1] >+ value = value.replace("\\n","\n") >+ value = value.replace("\\t","\t") >+ env[key] = value >+ for key in ["DEPEND","RDEPEND","PDEPEND"]: >+ if not env.has_key(key): >+ env[key] = "" >+ f = open(path+key, "w") >+ f.write(env[key]) >+ f.close() >+ fixed = [] >+ x=0 >+ while x != len(orig): >+ for key in ["DEPEND","RDEPEND","PDEPEND"]: >+ if orig[x].startswith(key): >+ quotes = orig[x].count('"') >+ while quotes != 2: >+ if quotes > 2: >+ print "broken ebuild "+ebuild >+ sys.exit(1) >+ x += 1 >+ quotes += orig[x].count('"') >+ fixed += [key+'="'+env[key]+'"\n'] >+ x += 1 >+ break >+ if x != len(orig): >+ fixed += orig[x] >+ x += 1 >+ ebuildfile = open(path+ebuild,"w") >+ ebuildfile.writelines(fixed) >+ ebuildfile.close() >+ >+ > if (secpass==2) and (not os.environ.has_key("SANDBOX_ACTIVE")): > if settings["PORTAGE_CALLER"] in ["emerge","fixpackages"]: > #only do this if we're root and not running repoman/ebuild digest >@@ -6540,6 +6599,17 @@ > if not mtimedb.has_key("updates"): > mtimedb["updates"]={} > try: >+ if not mtimedb["updates"].has_key("corrupted"): >+ for cat in os.listdir("/"+VDB_PATH): >+ cat = "/"+VDB_PATH+"/"+cat >+ if os.path.isdir(cat): >+ for pkg in os.listdir(cat): >+ path = cat+"/"+pkg >+ if pkg[0] != "-" and \ >+ os.path.isdir(path) and \ >+ os.access(path+"/environment.bz2",os.F_OK): >+ fixcorruptentries(path) >+ mtimedb["updates"]["corrupted"] = 0 > mylist=listdir(updpath,EmptyOnError=1) > # resort the list > mylist=[myfile[3:]+"-"+myfile[:2] for myfile in mylist]
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 46096
:
28274
|
28275
|
28929
|
29014
|
29020
|
36556
|
37209
|
37526
|
37536
|
37537
|
37541
|
37591