Skip to content

Commit

Permalink
chore: bazel run //:buildifier (#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Aug 14, 2024
1 parent 385717a commit a36dd12
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions e2e/smoke/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
30 changes: 15 additions & 15 deletions e2e/smoke/test_preserve_mtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
8 changes: 4 additions & 4 deletions tools/common/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit a36dd12

Please sign in to comment.