diff -urN portage-2.0.51_pre20-orig/pym/portage.py portage-2.0.51_pre20/pym/portage.py --- portage-2.0.51_pre20-orig/pym/portage.py 2004-08-16 20:15:02.000000000 -0500 +++ portage-2.0.51_pre20/pym/portage.py 2004-08-22 07:35:19.198786096 -0500 @@ -6644,6 +6644,44 @@ # old package won't yank the file with it. (non-cfgprot related) os.utime(myrealdest,(thismtime,thismtime)) zing="---" + #alright, we've fooled w/ mytime. need to update ar toc mtime's. + if self.settings["ARCH"] == "macos" and myrealdest[-2:] == ".a": + # insert the new mtime into the ar toc. + myf=open(myrealdest,"r+") + lms=str(thismtime+5).ljust(12) + myf.seek(0) + magic=myf.read(8) + if magic != "!\n": + print "%s: lacks magic header, skipping" % myrealdest + myf.close() + else: + print "updating toc of %s" % myrealdest + st=os.stat(myrealdest) + print "initial size is",st.st_size + while myf.tell() < st.st_size - 12: + print "processing",myf.tell() + # skip object name + myf.seek(16,1) + + # update mtime + myf.write(lms) + + # skip uid/gid/mperm + myf.seek(20,1) + + # read the archive member's size + x=long(myf.read(10)) + + # skip the trailing newlines, and the potential extra byte if it's + # not an even size + myf.seek(x + 2 + (x % 2),1) + + print "final position=",myf.tell() + # and now we're at the end. yay. + myf.close() + mymd5=portage_md5.perform_md5(myrealdest) + os.utime(myrealdest,(thismtime,thismtime)) + if mymtime!=None: zing=">>>" outfile.write("obj "+myrealdest+" "+mymd5+" "+str(mymtime)+"\n")