Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 58848 | Differences between
and this patch

Collapse All | Expand All

(-)portage-2.0.51_pre20-orig/pym/portage.py (+38 lines)
Lines 6644-6649 Link Here
6644
					# old package won't yank the file with it. (non-cfgprot related)
6644
					# old package won't yank the file with it. (non-cfgprot related)
6645
					os.utime(myrealdest,(thismtime,thismtime))
6645
					os.utime(myrealdest,(thismtime,thismtime))
6646
					zing="---"
6646
					zing="---"
6647
				#alright, we've fooled w/ mytime.  need to update ar toc mtime's.
6648
				if self.settings["ARCH"] == "macos" and myrealdest[-2:] == ".a":
6649
					# insert the new mtime into the ar toc.
6650
					myf=open(myrealdest,"r+")
6651
					lms=str(thismtime+5).ljust(12)
6652
					myf.seek(0)
6653
					magic=myf.read(8)
6654
					if magic != "!<arch>\n":
6655
						print "%s: lacks magic header, skipping" % myrealdest
6656
						myf.close()
6657
					else:
6658
						print "updating toc of %s" % myrealdest
6659
						st=os.stat(myrealdest)
6660
						print "initial size is",st.st_size
6661
						while myf.tell() < st.st_size - 12:
6662
							print "processing",myf.tell()
6663
							# skip object name
6664
							myf.seek(16,1)
6665
							
6666
							# update mtime
6667
							myf.write(lms)
6668
						
6669
							# skip uid/gid/mperm
6670
							myf.seek(20,1)
6671
								
6672
							# read the archive member's size
6673
							x=long(myf.read(10))
6674
							
6675
							# skip the trailing newlines, and the potential extra byte if it's
6676
							# not an even size
6677
							myf.seek(x + 2 + (x % 2),1)
6678
							
6679
						print "final position=",myf.tell()
6680
						# and now we're at the end. yay.
6681
						myf.close()
6682
						mymd5=portage_md5.perform_md5(myrealdest)
6683
					os.utime(myrealdest,(thismtime,thismtime))
6684
6647
				if mymtime!=None:
6685
				if mymtime!=None:
6648
					zing=">>>"
6686
					zing=">>>"
6649
					outfile.write("obj "+myrealdest+" "+mymd5+" "+str(mymtime)+"\n")
6687
					outfile.write("obj "+myrealdest+" "+mymd5+" "+str(mymtime)+"\n")

Return to bug 58848