Revert "zuul-cloner: enter directory before copying"
This reverts commit 26b66a6a9e
.
It doesn't seem we can stop "--preserve=all" from modifying the
directory permissions. Remove the -a and just do a regular copy.
Change-Id: I4937924e0dd1a0537343472f80b991a4e4410d3f
This commit is contained in:
parent
26b66a6a9e
commit
38a46bcf21
@ -16,7 +16,6 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
@ -145,13 +144,15 @@ def main():
|
|||||||
print("Creating %s" % d)
|
print("Creating %s" % d)
|
||||||
os.makedirs(d)
|
os.makedirs(d)
|
||||||
|
|
||||||
# Create hard link copy of the source directory. Note we cd
|
# Create hard link copy of the source directory
|
||||||
# into the target directory to avoid "cp -a" modifying the
|
|
||||||
# permissions of dst itself, which in particular can be fatal
|
# note: don't use "-a" here as that implies "--preserve=all"
|
||||||
# to ssh access when dst is a homedir
|
# which overwrites the permissions of dst from src ... this is
|
||||||
cmd = "cd %s; cp -al %s/. ." % (dst, src)
|
# fatal to ssh if dst is a home directory and we make it
|
||||||
|
# world-accessable. This should leave dst alone
|
||||||
|
cmd = "cp -dRl %s/. %s" % (src, dst)
|
||||||
print("%s" % cmd)
|
print("%s" % cmd)
|
||||||
if subprocess.call(cmd, shell=True) != 0:
|
if os.system(cmd):
|
||||||
print("Error executing: %s" % cmd)
|
print("Error executing: %s" % cmd)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user