Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 472168 Details for
Bug 605082
Add metadata to CONTENTS_ files in vdb
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
removed use of realpath()
integrity-0.3.patch (text/plain), 3.73 KB, created by
Sam
on 2017-05-09 20:40:05 UTC
(
hide
)
Description:
removed use of realpath()
Filename:
MIME Type:
Creator:
Sam
Created:
2017-05-09 20:40:05 UTC
Size:
3.73 KB
patch
obsolete
>--- /usr/lib64/python3.4/site-packages/portage/dbapi/vartree.py.orig 2017-05-09 22:34:55.765403649 +0200 >+++ /usr/lib64/python3.4/site-packages/portage/dbapi/vartree.py 2017-05-09 22:35:15.313402519 +0200 >@@ -4539,6 +4539,17 @@ > mode='w', encoding=_encodings['repo.content'], > errors='backslashreplace') > >+ >+ # open INTEGRITY file (possibly overwriting old one) for recording >+ # Use atomic_ofstream for automatic coercion of raw bytes to >+ # unicode, in order to prevent TypeError when writing raw bytes >+ # to TextIOWrapper with python2. >+ intfile = atomic_ofstream(_unicode_encode( >+ os.path.join(self.dbtmpdir, 'INTEGRITY'), >+ encoding=_encodings['fs'], errors='strict'), >+ mode='w', encoding=_encodings['repo.content'], >+ errors='backslashreplace') >+ > # Don't bump mtimes on merge since some application require > # preservation of timestamps. This means that the unmerge phase must > # check to see if file belongs to an installed instance in the same >@@ -4551,7 +4562,7 @@ > > # we do a first merge; this will recurse through all files in our srcroot but also build up a > # "second hand" of symlinks to merge later >- if self.mergeme(srcroot, destroot, outfile, secondhand, >+ if self.mergeme(srcroot, destroot, outfile, intfile, secondhand, > self.settings["EPREFIX"].lstrip(os.sep), cfgfiledict, mymtime): > return 1 > >@@ -4563,7 +4574,7 @@ > # couldn't get merged will be added to thirdhand. > > thirdhand = [] >- if self.mergeme(srcroot, destroot, outfile, thirdhand, >+ if self.mergeme(srcroot, destroot, outfile, intfile, thirdhand, > secondhand, cfgfiledict, mymtime): > return 1 > >@@ -4577,7 +4588,7 @@ > > if len(secondhand): > # force merge of remaining symlinks (broken or circular; oh well) >- if self.mergeme(srcroot, destroot, outfile, None, >+ if self.mergeme(srcroot, destroot, outfile, intfile, None, > secondhand, cfgfiledict, mymtime): > return 1 > >@@ -4588,6 +4599,10 @@ > outfile.flush() > outfile.close() > >+ #if we opened it, close it >+ intfile.flush() >+ intfile.close() >+ > # write out our collection of md5sums > if cfgfiledict != cfgfiledict_orig: > cfgfiledict.pop("IGNORE", None) >@@ -4599,7 +4614,7 @@ > > return os.EX_OK > >- def mergeme(self, srcroot, destroot, outfile, secondhand, stufftomerge, cfgfiledict, thismtime): >+ def mergeme(self, srcroot, destroot, outfile, intfile, secondhand, stufftomerge, cfgfiledict, thismtime): > """ > > This function handles actual merging of the package contents to the livefs. >@@ -4611,6 +4626,8 @@ > @type destroot: String (Path) > @param outfile: File to log operations to > @type outfile: File Object >+ @param intfile: File to log integrity info to >+ @type intfile: File Object > @param secondhand: A set of items to merge in pass two (usually > or symlinks that point to non-existing files that may get merged later) > @type secondhand: List >@@ -4749,6 +4766,26 @@ > # confmem rejected this update > zing = "---" > >+ srcobj = srcroot+relative_path >+ destobj = destroot+relative_path >+ hashtype = self.settings["INTEGRITY_HASH"] >+ >+ line = "" >+ if stat.S_ISREG(mymode): >+ line = "mode:"+oct(mymode)[-4:]+" " >+ if hashtype.lower() == "sha1" or hashtype.lower() == "sha256" or hashtype.lower() == "sha512": >+ line += hashtype.lower()+":"+portage.checksum.perform_checksum(srcobj, hashtype.upper(), 0)[0]+" " >+ line += "file:"+destobj+"\n" >+ elif stat.S_ISDIR(mymode): >+ if not os.path.exists(destobj): >+ line = "mode:"+oct(mymode)[-4:]+" " >+ line += "file:"+destobj+"\n" >+ else: #LINK, FIFO, DEV >+ line = "mode:"+oct(mymode)[-4:]+" " >+ line += "file:"+destobj+"\n" >+ >+ intfile.write(line) >+ > if stat.S_ISLNK(mymode): > # we are merging a symbolic link > # Pass in the symlink target in order to bypass the
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 605082
:
460212
|
472158
|
472168
|
534598
|
534870
|
535372
|
542774
|
543736
|
544732
|
545162
|
545784
|
550998
|
551410