Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 129852
Collapse All | Expand All

(-)portage-2.1_pre7/pym/portage.py (-5 / +6 lines)
Lines 2944-2955 def movefile(src,dest,newmtime=None,ssta Link Here
2944
	if bsd_chflags:
2944
	if bsd_chflags:
2945
		# Check that we can actually unset schg etc flags...
2945
		# Check that we can actually unset schg etc flags...
2946
		# Clear the flags on source and destination; we'll reinstate them after merging
2946
		# Clear the flags on source and destination; we'll reinstate them after merging
2947
		if(destexists):
2947
		if(destexists and sflags != 0):
2948
			if bsd_chflags.lchflags(dest, 0) < 0:
2948
			if bsd_chflags.lchflags(dest, 0) < 0:
2949
				writemsg("!!! Couldn't clear flags on file being merged: \n ")
2949
				writemsg("!!! Couldn't clear flags on file being merged: \n ")
2950
		# We might have an immutable flag on the parent dir; save and clear.
2950
		# We might have an immutable flag on the parent dir; save and clear.
2951
		pflags=bsd_chflags.lgetflags(os.path.dirname(dest))
2951
		pflags=bsd_chflags.lgetflags(os.path.dirname(dest))
2952
		bsd_chflags.lchflags(os.path.dirname(dest), 0)
2952
		if pflags != 0:
2953
			bsd_chflags.lchflags(os.path.dirname(dest), 0)
2953
2954
2954
		# Don't bother checking the return value here; if it fails then the next line will catch it.
2955
		# Don't bother checking the return value here; if it fails then the next line will catch it.
2955
		bsd_chflags.lchflags(src, 0)
2956
		bsd_chflags.lchflags(src, 0)
Lines 2985-2991 def movefile(src,dest,newmtime=None,ssta Link Here
2985
			lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
2986
			lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID])
2986
			if bsd_chflags:
2987
			if bsd_chflags:
2987
				# Restore the flags we saved before moving
2988
				# Restore the flags we saved before moving
2988
				if bsd_chflags.lchflags(dest, sflags) < 0 or bsd_chflags.lchflags(os.path.dirname(dest), pflags) < 0:
2989
				if ( sflags != 0 and bsd_chflags.lchflags(dest, sflags) < 0 ) or (pflags and bsd_chflags.lchflags(os.path.dirname(dest), pflags) < 0 ):
2989
					writemsg("!!! Couldn't restore flags ("+str(flags)+") on " + dest+":\n")
2990
					writemsg("!!! Couldn't restore flags ("+str(flags)+") on " + dest+":\n")
2990
					writemsg("!!! %s\n" % str(e))
2991
					writemsg("!!! %s\n" % str(e))
2991
					return None
2992
					return None
Lines 3067-3073 def movefile(src,dest,newmtime=None,ssta Link Here
3067
3068
3068
	if bsd_chflags:
3069
	if bsd_chflags:
3069
		# Restore the flags we saved before moving
3070
		# Restore the flags we saved before moving
3070
		if bsd_chflags.lchflags(dest, sflags) < 0 or bsd_chflags.lchflags(os.path.dirname(dest), pflags) < 0:
3071
		if ( sflags != 0 and bsd_chflags.lchflags(dest, sflags) < 0 ) or (pflags and bsd_chflags.lchflags(os.path.dirname(dest), pflags) < 0 ):
3071
			writemsg("!!! Couldn't restore flags ("+str(sflags)+") on " + dest+":\n")
3072
			writemsg("!!! Couldn't restore flags ("+str(sflags)+") on " + dest+":\n")
3072
			return None
3073
			return None
3073
3074
Lines 6204-6210 class dblink: Link Here
6204
					if bsd_chflags:
6205
					if bsd_chflags:
6205
						# Save then clear flags on dest.
6206
						# Save then clear flags on dest.
6206
						dflags=bsd_chflags.lgetflags(mydest)
6207
						dflags=bsd_chflags.lgetflags(mydest)
6207
						if(bsd_chflags.lchflags(mydest, 0)<0):
6208
						if(dflags != 0 and bsd_chflags.lchflags(mydest, 0)<0):
6208
							writemsg("!!! Couldn't clear flags on '"+mydest+"'.\n")
6209
							writemsg("!!! Couldn't clear flags on '"+mydest+"'.\n")
6209
6210
6210
					if not os.access(mydest, os.W_OK):
6211
					if not os.access(mydest, os.W_OK):

Return to bug 129852