Lines 2781-2792
def movefile(src,dest,newmtime=None,ssta
Link Here
|
2781 |
try: |
2781 |
try: |
2782 |
if not sstat: |
2782 |
if not sstat: |
2783 |
sstat=os.lstat(src) |
2783 |
sstat=os.lstat(src) |
2784 |
if bsd_chflags: |
|
|
2785 |
sflags=bsd_chflags.lgetflags(src) |
2786 |
if sflags < 0: |
2787 |
# Problem getting flags... |
2788 |
writemsg("!!! Couldn't get flags for "+dest+"\n") |
2789 |
return None |
2790 |
|
2784 |
|
2791 |
except SystemExit, e: |
2785 |
except SystemExit, e: |
2792 |
raise |
2786 |
raise |
Lines 2811-2817
def movefile(src,dest,newmtime=None,ssta
Link Here
|
2811 |
if bsd_chflags.lchflags(dest, 0) < 0: |
2805 |
if bsd_chflags.lchflags(dest, 0) < 0: |
2812 |
writemsg("!!! Couldn't clear flags on file being merged: \n ") |
2806 |
writemsg("!!! Couldn't clear flags on file being merged: \n ") |
2813 |
# We might have an immutable flag on the parent dir; save and clear. |
2807 |
# We might have an immutable flag on the parent dir; save and clear. |
2814 |
pflags=bsd_chflags.lgetflags(os.path.dirname(dest)) |
2808 |
pflags=lstat(os.path.dirname(dest)).st_flags |
2815 |
bsd_chflags.lchflags(os.path.dirname(dest), 0) |
2809 |
bsd_chflags.lchflags(os.path.dirname(dest), 0) |
2816 |
|
2810 |
|
2817 |
# Don't bother checking the return value here; if it fails then the next line will catch it. |
2811 |
# Don't bother checking the return value here; if it fails then the next line will catch it. |
Lines 2848-2854
def movefile(src,dest,newmtime=None,ssta
Link Here
|
2848 |
lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) |
2842 |
lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) |
2849 |
if bsd_chflags: |
2843 |
if bsd_chflags: |
2850 |
# Restore the flags we saved before moving |
2844 |
# Restore the flags we saved before moving |
2851 |
if bsd_chflags.lchflags(dest, sflags) < 0 or bsd_chflags.lchflags(os.path.dirname(dest), pflags) < 0: |
2845 |
if bsd_chflags.lchflags(dest, sstat.st_flags) < 0 or bsd_chflags.lchflags(os.path.dirname(dest), pflags) < 0: |
2852 |
writemsg("!!! Couldn't restore flags ("+str(flags)+") on " + dest+":\n") |
2846 |
writemsg("!!! Couldn't restore flags ("+str(flags)+") on " + dest+":\n") |
2853 |
writemsg("!!! %s\n" % str(e)) |
2847 |
writemsg("!!! %s\n" % str(e)) |
2854 |
return None |
2848 |
return None |
Lines 2931-2938
def movefile(src,dest,newmtime=None,ssta
Link Here
|
2931 |
|
2925 |
|
2932 |
if bsd_chflags: |
2926 |
if bsd_chflags: |
2933 |
# Restore the flags we saved before moving |
2927 |
# Restore the flags we saved before moving |
2934 |
if bsd_chflags.lchflags(dest, sflags) < 0 or bsd_chflags.lchflags(os.path.dirname(dest), pflags) < 0: |
2928 |
if bsd_chflags.lchflags(dest, sstat.st_flags) < 0 or bsd_chflags.lchflags(os.path.dirname(dest), pflags) < 0: |
2935 |
writemsg("!!! Couldn't restore flags ("+str(sflags)+") on " + dest+":\n") |
2929 |
writemsg("!!! Couldn't restore flags ("+str(sstat.st_flags)+") on " + dest+":\n") |
2936 |
return None |
2930 |
return None |
2937 |
|
2931 |
|
2938 |
return newmtime |
2932 |
return newmtime |
Lines 6812-6818
class dblink:
Link Here
|
6812 |
|
6806 |
|
6813 |
if bsd_chflags: |
6807 |
if bsd_chflags: |
6814 |
# Save then clear flags on dest. |
6808 |
# Save then clear flags on dest. |
6815 |
dflags=bsd_chflags.lgetflags(mydest) |
6809 |
dflags=lstat(mydest).st_flags |
6816 |
if(bsd_chflags.lchflags(mydest, 0)<0): |
6810 |
if(bsd_chflags.lchflags(mydest, 0)<0): |
6817 |
writemsg("!!! Couldn't clear flags on '"+mydest+"'.\n") |
6811 |
writemsg("!!! Couldn't clear flags on '"+mydest+"'.\n") |
6818 |
|
6812 |
|
Lines 6855-6861
class dblink:
Link Here
|
6855 |
os.mkdir(mydest) |
6849 |
os.mkdir(mydest) |
6856 |
os.chmod(mydest,mystat[0]) |
6850 |
os.chmod(mydest,mystat[0]) |
6857 |
if bsd_chflags: |
6851 |
if bsd_chflags: |
6858 |
bsd_chflags.lchflags(mydest, bsd_chflags.lgetflags(mysrc)) |
6852 |
bsd_chflags.lchflags(mydest, mystat.st_flags) |
6859 |
os.chown(mydest,mystat[4],mystat[5]) |
6853 |
os.chown(mydest,mystat[4],mystat[5]) |
6860 |
print ">>>",mydest+"/" |
6854 |
print ">>>",mydest+"/" |
6861 |
outfile.write("dir "+myrealdest+"\n") |
6855 |
outfile.write("dir "+myrealdest+"\n") |