Lines 3906-3911
Link Here
|
3906 |
|
3906 |
|
3907 |
expandcache={} |
3907 |
expandcache={} |
3908 |
|
3908 |
|
|
|
3909 |
def _movefile(src, dest, **kwargs): |
3910 |
"""Calls movefile and raises a PortageException if an error occurs.""" |
3911 |
if movefile(src, dest, **kwargs) is None: |
3912 |
raise portage_exception.PortageException( |
3913 |
"mv '%s' '%s'" % (src, dest)) |
3914 |
|
3909 |
def movefile(src,dest,newmtime=None,sstat=None,mysettings=None): |
3915 |
def movefile(src,dest,newmtime=None,sstat=None,mysettings=None): |
3910 |
"""moves a file from src to dest, preserving all permissions and attributes; mtime will |
3916 |
"""moves a file from src to dest, preserving all permissions and attributes; mtime will |
3911 |
be preserved even when moving across filesystems. Returns true on success and false on |
3917 |
be preserved even when moving across filesystems. Returns true on success and false on |
Lines 5264-5270
Link Here
|
5264 |
if os.path.exists(newpath): |
5270 |
if os.path.exists(newpath): |
5265 |
#dest already exists; keep this puppy where it is. |
5271 |
#dest already exists; keep this puppy where it is. |
5266 |
continue |
5272 |
continue |
5267 |
os.rename(origpath, newpath) |
5273 |
_movefile(origpath, newpath, mysettings=self.settings) |
5268 |
|
5274 |
|
5269 |
# We need to rename the ebuild now. |
5275 |
# We need to rename the ebuild now. |
5270 |
old_pf = catsplit(mycpv)[1] |
5276 |
old_pf = catsplit(mycpv)[1] |
Lines 6489-6495
Link Here
|
6489 |
if e.errno != errno.EEXIST: |
6495 |
if e.errno != errno.EEXIST: |
6490 |
raise |
6496 |
raise |
6491 |
del e |
6497 |
del e |
6492 |
os.rename(tbz2path, new_path) |
6498 |
_movefile(tbz2path, new_path, mysettings=self.settings) |
6493 |
self._remove_symlink(mycpv) |
6499 |
self._remove_symlink(mycpv) |
6494 |
if new_path.split(os.path.sep)[-2] == "All": |
6500 |
if new_path.split(os.path.sep)[-2] == "All": |
6495 |
self._create_symlink(mynewcpv) |
6501 |
self._create_symlink(mynewcpv) |
Lines 6587-6593
Link Here
|
6587 |
if e.errno != errno.EEXIST: |
6593 |
if e.errno != errno.EEXIST: |
6588 |
raise |
6594 |
raise |
6589 |
del e |
6595 |
del e |
6590 |
os.rename(src_path, os.path.join(self.pkgdir, "All", myfile)) |
6596 |
dest_path = os.path.join(self.pkgdir, "All", myfile) |
|
|
6597 |
_movefile(src_path, dest_path, mysettings=self.settings) |
6591 |
self._create_symlink(cpv) |
6598 |
self._create_symlink(cpv) |
6592 |
self._pkg_paths[cpv] = os.path.join("All", myfile) |
6599 |
self._pkg_paths[cpv] = os.path.join("All", myfile) |
6593 |
|
6600 |
|
Lines 6605-6611
Link Here
|
6605 |
if e.errno != errno.EEXIST: |
6612 |
if e.errno != errno.EEXIST: |
6606 |
raise |
6613 |
raise |
6607 |
del e |
6614 |
del e |
6608 |
os.rename(os.path.join(self.pkgdir, "All", myfile), dest_path) |
6615 |
src_path = os.path.join(self.pkgdir, "All", myfile) |
|
|
6616 |
_movefile(src_path, dest_path, mysettings=self.settings) |
6609 |
self._pkg_paths[cpv] = mypath |
6617 |
self._pkg_paths[cpv] = mypath |
6610 |
|
6618 |
|
6611 |
def populate(self, getbinpkgs=0,getbinpkgsonly=0): |
6619 |
def populate(self, getbinpkgs=0,getbinpkgsonly=0): |
Lines 7684-7690
Link Here
|
7684 |
# We hold both directory locks. |
7692 |
# We hold both directory locks. |
7685 |
self.dbdir = self.dbpkgdir |
7693 |
self.dbdir = self.dbpkgdir |
7686 |
self.delete() |
7694 |
self.delete() |
7687 |
movefile(self.dbtmpdir, self.dbpkgdir, mysettings=self.settings) |
7695 |
_movefile(self.dbtmpdir, self.dbpkgdir, mysettings=self.settings) |
7688 |
contents = self.getcontents() |
7696 |
contents = self.getcontents() |
7689 |
|
7697 |
|
7690 |
#write out our collection of md5sums |
7698 |
#write out our collection of md5sums |