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 (+40 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
							print "file size=",os.stat(myrealdest).st_size
6664
							# skip object name
6665
							myf.seek(16,1)
6666
							
6667
							# update mtime
6668
							myf.write(lms)
6669
						
6670
							# skip uid/gid/mperm
6671
							myf.seek(20,1)
6672
								
6673
							# read the archive member's size
6674
							x=long(myf.read(10))
6675
							
6676
							# skip the trailing newlines, and the potential extra byte if it's
6677
							# not an even size
6678
							print "pos",myf.tell(),"size=",st.st_size
6679
							myf.seek(x + 2 + (x % 1),1)
6680
							
6681
						print "final position=",myf.tell()
6682
						# and now we're at the end. yay.
6683
						myf.close()
6684
						mymd5=portage_md5.perform_md5(myrealdest)
6685
					os.utime(myrealdest,(thismtime,thismtime))
6686
6647
				if mymtime!=None:
6687
				if mymtime!=None:
6648
					zing=">>>"
6688
					zing=">>>"
6649
					outfile.write("obj "+myrealdest+" "+mymd5+" "+str(mymtime)+"\n")
6689
					outfile.write("obj "+myrealdest+" "+mymd5+" "+str(mymtime)+"\n")

Return to bug 58848