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

Collapse All | Expand All

(-)pym/portage.py (-7 / +7 lines)
Lines 5264-5279 Link Here
5264
			if os.path.exists(newpath):
5264
			if os.path.exists(newpath):
5265
				#dest already exists; keep this puppy where it is.
5265
				#dest already exists; keep this puppy where it is.
5266
				continue
5266
				continue
5267
			os.rename(origpath, newpath)
5267
			shutil.move(origpath, newpath)
5268
5268
5269
			# We need to rename the ebuild now.
5269
			# We need to rename the ebuild now.
5270
			old_pf = catsplit(mycpv)[1]
5270
			old_pf = catsplit(mycpv)[1]
5271
			new_pf = catsplit(mynewcpv)[1]
5271
			new_pf = catsplit(mynewcpv)[1]
5272
			if new_pf != old_pf:
5272
			if new_pf != old_pf:
5273
				try:
5273
				try:
5274
					os.rename(os.path.join(newpath, old_pf + ".ebuild"),
5274
					shutil.move(os.path.join(newpath, old_pf + ".ebuild"),
5275
						os.path.join(newpath, new_pf + ".ebuild"))
5275
						os.path.join(newpath, new_pf + ".ebuild"))
5276
				except OSError, e:
5276
				except EnvironmentError, e:
5277
					if e.errno != errno.ENOENT:
5277
					if e.errno != errno.ENOENT:
5278
						raise
5278
						raise
5279
					del e
5279
					del e
Lines 6489-6495 Link Here
6489
					if e.errno != errno.EEXIST:
6489
					if e.errno != errno.EEXIST:
6490
						raise
6490
						raise
6491
					del e
6491
					del e
6492
				os.rename(tbz2path, new_path)
6492
				shutil.move(tbz2path, new_path)
6493
				self._remove_symlink(mycpv)
6493
				self._remove_symlink(mycpv)
6494
				if new_path.split(os.path.sep)[-2] == "All":
6494
				if new_path.split(os.path.sep)[-2] == "All":
6495
					self._create_symlink(mynewcpv)
6495
					self._create_symlink(mynewcpv)
Lines 6587-6593 Link Here
6587
				if e.errno != errno.EEXIST:
6587
				if e.errno != errno.EEXIST:
6588
					raise
6588
					raise
6589
				del e
6589
				del e
6590
			os.rename(src_path, os.path.join(self.pkgdir, "All", myfile))
6590
			shutil.move(src_path, os.path.join(self.pkgdir, "All", myfile))
6591
			self._create_symlink(cpv)
6591
			self._create_symlink(cpv)
6592
		self._pkg_paths[cpv] = os.path.join("All", myfile)
6592
		self._pkg_paths[cpv] = os.path.join("All", myfile)
6593
6593
Lines 6605-6611 Link Here
6605
			if e.errno != errno.EEXIST:
6605
			if e.errno != errno.EEXIST:
6606
				raise
6606
				raise
6607
			del e
6607
			del e
6608
		os.rename(os.path.join(self.pkgdir, "All", myfile), dest_path)
6608
		shutil.move(os.path.join(self.pkgdir, "All", myfile), dest_path)
6609
		self._pkg_paths[cpv] = mypath
6609
		self._pkg_paths[cpv] = mypath
6610
6610
6611
	def populate(self, getbinpkgs=0,getbinpkgsonly=0):
6611
	def populate(self, getbinpkgs=0,getbinpkgsonly=0):
Lines 7051-7057 Link Here
7051
				if x[:-7] != self.pkg:
7051
				if x[:-7] != self.pkg:
7052
					# Clean up after vardbapi.move_ent() breakage in
7052
					# Clean up after vardbapi.move_ent() breakage in
7053
					# portage versions before 2.1.2
7053
					# portage versions before 2.1.2
7054
					os.rename(os.path.join(self.dbdir, x), myebuildpath)
7054
					shutil.move(os.path.join(self.dbdir, x), myebuildpath)
7055
					write_atomic(os.path.join(self.dbdir, "PF"), self.pkg+"\n")
7055
					write_atomic(os.path.join(self.dbdir, "PF"), self.pkg+"\n")
7056
				break
7056
				break
7057
7057
(-)pym/dispatch_conf.py (-7 / +7 lines)
Lines 7-13 Link Here
7
# Library by Wayne Davison <gentoo@blorf.net>, derived from code
7
# Library by Wayne Davison <gentoo@blorf.net>, derived from code
8
# written by Jeremy Wohl (http://igmus.org)
8
# written by Jeremy Wohl (http://igmus.org)
9
9
10
from stat import *
10
from stat import ST_GID, ST_MODE, ST_UID
11
import os, sys, commands, shutil
11
import os, sys, commands, shutil
12
12
13
import portage
13
import portage
Lines 72-78 Link Here
72
        os.system(RCS_GET + ' -r' + RCS_BRANCH + ' ' + archive)
72
        os.system(RCS_GET + ' -r' + RCS_BRANCH + ' ' + archive)
73
        has_branch = os.path.exists(archive)
73
        has_branch = os.path.exists(archive)
74
        if has_branch:
74
        if has_branch:
75
            os.rename(archive, archive + '.dist')
75
            shutil.move(archive, archive + '.dist')
76
76
77
        try:
77
        try:
78
            shutil.copy2(newconf, archive)
78
            shutil.copy2(newconf, archive)
Lines 87-93 Link Here
87
                mystat = os.lstat(newconf)
87
                mystat = os.lstat(newconf)
88
                os.chmod(mrgconf, mystat[ST_MODE])
88
                os.chmod(mrgconf, mystat[ST_MODE])
89
                os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID])
89
                os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID])
90
        os.rename(archive, archive + '.dist.new')
90
        shutil.move(archive, archive + '.dist.new')
91
    return ret
91
    return ret
92
92
93
93
Lines 112-121 Link Here
112
            suf += 1
112
            suf += 1
113
113
114
        while suf > 1:
114
        while suf > 1:
115
            os.rename(archive + '.' + str(suf-1), archive + '.' + str(suf))
115
            shutil.move(archive + '.' + str(suf-1), archive + '.' + str(suf))
116
            suf -= 1
116
            suf -= 1
117
117
118
        os.rename(archive, archive + '.1')
118
        shutil.move(archive, archive + '.1')
119
119
120
    try:
120
    try:
121
        shutil.copy2(curconf, archive)
121
        shutil.copy2(curconf, archive)
Lines 145-151 Link Here
145
def rcs_archive_post_process(archive):
145
def rcs_archive_post_process(archive):
146
    """Check in the archive file with the .dist.new suffix on the branch
146
    """Check in the archive file with the .dist.new suffix on the branch
147
    and remove the one with the .dist suffix."""
147
    and remove the one with the .dist suffix."""
148
    os.rename(archive + '.dist.new', archive)
148
    shutil.move(archive + '.dist.new', archive)
149
    if os.path.exists(archive + '.dist'):
149
    if os.path.exists(archive + '.dist'):
150
        # Commit the last-distributed version onto the branch.
150
        # Commit the last-distributed version onto the branch.
151
        os.system(RCS_LOCK + RCS_BRANCH + ' ' + archive)
151
        os.system(RCS_LOCK + RCS_BRANCH + ' ' + archive)
Lines 158-161 Link Here
158
158
159
def file_archive_post_process(archive):
159
def file_archive_post_process(archive):
160
    """Rename the archive file with the .dist.new suffix to a .dist suffix"""
160
    """Rename the archive file with the .dist.new suffix to a .dist suffix"""
161
    os.rename(archive + '.dist.new', archive + '.dist')
161
    shutil.move(archive + '.dist.new', archive + '.dist')
(-)bin/emerge (-2 / +5 lines)
Lines 3696-3709 Link Here
3696
3696
3697
			icount=0
3697
			icount=0
3698
			badcount=0
3698
			badcount=0
3699
			import shutil
3699
			for inforoot in regen_infodirs:
3700
			for inforoot in regen_infodirs:
3700
				if inforoot=='':
3701
				if inforoot=='':
3701
					continue
3702
					continue
3702
				for filename in ("dir", "dir.gz", "dir.bz2"):
3703
				for filename in ("dir", "dir.gz", "dir.bz2"):
3703
					file_path = os.path.join(inforoot, filename)
3704
					file_path = os.path.join(inforoot, filename)
3705
					if not os.path.exists(file_path):
3706
						continue
3704
					try:
3707
					try:
3705
						os.rename(file_path, file_path + ".old")
3708
						shutil.move(file_path, file_path + ".old")
3706
					except OSError, e:
3709
					except EnvironmentError, e:
3707
						if e.errno != errno.ENOENT:
3710
						if e.errno != errno.ENOENT:
3708
							raise
3711
							raise
3709
						del e
3712
						del e

Return to bug 182964