mirror of
https://github.com/bazel-contrib/bazel-lib
synced 2024-11-26 13:30:30 +00:00
chore: bazel run //:buildifier (#903)
This commit is contained in:
parent
385717a2a5
commit
a36dd1201a
|
@ -116,11 +116,11 @@ copy_directory(
|
|||
|
||||
sh_test(
|
||||
name = "test_preserve_mtime",
|
||||
size = "small",
|
||||
srcs = ["test_preserve_mtime.sh"],
|
||||
data = [
|
||||
"d",
|
||||
":copy_to_directory_mtime_case",
|
||||
":copy_directory_mtime_case",
|
||||
":copy_to_directory_mtime_case",
|
||||
],
|
||||
size = "small",
|
||||
)
|
||||
|
|
|
@ -3,28 +3,28 @@
|
|||
set -euo pipefail
|
||||
|
||||
function main {
|
||||
compareMTimes d/1 copy_to_directory_mtime_out/d/1
|
||||
compareMTimes d/1 copy_directory_mtime_out/1
|
||||
compareMTimes d/1 copy_to_directory_mtime_out/d/1
|
||||
compareMTimes d/1 copy_directory_mtime_out/1
|
||||
}
|
||||
|
||||
function compareMTimes {
|
||||
local originalFile="$1"
|
||||
local copiedFile="$2"
|
||||
local originalFile="$1"
|
||||
local copiedFile="$2"
|
||||
|
||||
local mtimeOriginal
|
||||
mtimeOriginal="$(stat --dereference --format=%y "$originalFile")"
|
||||
local mtimeOriginal
|
||||
mtimeOriginal="$(stat --dereference --format=%y "$originalFile")"
|
||||
|
||||
local mtimeCopy
|
||||
mtimeCopy="$(stat --dereference --format=%y "$copiedFile")"
|
||||
local mtimeCopy
|
||||
mtimeCopy="$(stat --dereference --format=%y "$copiedFile")"
|
||||
|
||||
if [[ "$mtimeOriginal" != "$mtimeCopy" ]]; then
|
||||
echo "Preserve mtime test failed. Modify times do not match for $originalFile and $copiedFile"
|
||||
echo " Original modify time: $mtimeOriginal"
|
||||
echo " Copied modify time: $mtimeCopy"
|
||||
return 1
|
||||
fi
|
||||
if [[ "$mtimeOriginal" != "$mtimeCopy" ]]; then
|
||||
echo "Preserve mtime test failed. Modify times do not match for $originalFile and $copiedFile"
|
||||
echo " Original modify time: $mtimeOriginal"
|
||||
echo " Copied modify time: $mtimeCopy"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "Preserve mtime test passed for $originalFile and $copiedFile"
|
||||
echo "Preserve mtime test passed for $originalFile and $copiedFile"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
@ -106,10 +106,10 @@ func (w *CopyWorker) Run(wg *sync.WaitGroup) {
|
|||
}
|
||||
|
||||
type CopyOpts struct {
|
||||
src, dst string
|
||||
srcInfo fs.FileInfo
|
||||
hardlink bool
|
||||
verbose bool
|
||||
src, dst string
|
||||
srcInfo fs.FileInfo
|
||||
hardlink bool
|
||||
verbose bool
|
||||
preserveMTime bool
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue