Skip to content

Commit

Permalink
Preserve timestamps in copy_dir_contents_to_dir (#520)
Browse files Browse the repository at this point in the history
This removes the dependency on autotools for projects such as
"make", where autotools are only invoked if the timestamp of certain files
has changed.
  • Loading branch information
jheaff1 committed Feb 24, 2021
1 parent 87df6b2 commit 85ee132
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fi
)

def copy_dir_contents_to_dir(source, target):
return """cp -L -r --no-target-directory "{}" "{}" """.format(source, target)
return """cp -L -p -r --no-target-directory "{}" "{}" """.format(source, target)

def symlink_contents_to_dir(source, target):
text = """\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fi
)

def copy_dir_contents_to_dir(source, target):
return """cp -L -r --no-target-directory "{}" "{}" """.format(source, target)
return """cp -L -p -r --no-target-directory "{}" "{}" """.format(source, target)

def symlink_contents_to_dir(source, target):
text = """\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ local target="$2"
mkdir -p "${target}"
for child in "${children[@]:-}"; do
if [[ -f "$child" ]]; then
cp "$child" "$target"
cp -p "$child" "$target"
elif [[ -L "$child" ]]; then
local actual=$(readlink "$child")
if [[ -f "$actual" ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fi
)

def copy_dir_contents_to_dir(source, target):
return """cp -L -r --no-target-directory "{}" "{}" """.format(source, target)
return """cp -L -p -r --no-target-directory "{}" "{}" """.format(source, target)

def symlink_contents_to_dir(source, target):
text = """\
Expand Down

0 comments on commit 85ee132

Please sign in to comment.