mv -u silently skips an entire directory when the destination directory has an equal or newer timestamp
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
src/uu/mv/src/mv.rs の827~838行あたりから始めます。ここではタイムスタンプのチェックが名前変更の前に処理を返すため、その動作を GNU mv のマニュアルにあるディレクトリをソースとする場合の規則と比較します。タイムスタンプが同じか新しい空の宛先ディレクトリを使って再現する回帰テストを追加し、mv -u がソースファイルを移動して正常終了することを確認します。
索引モデルが issue の本文から書いたものです。
説明
When the destination is an existing empty directory with an equal or newer modification time, mv -u exits 0 but leaves the entire source directory in place. A script that pre-creates a staging directory can continue to packaging with all the files from the move missing.
Reproduction
Run once per implementation with the mv under test on PATH.
cd "$(mktemp -d)" || exit 1
export LC_ALL=C
mkdir -p release stage/release
printf 'package\n' > release/manifest
touch -d @1000000000 release
touch -d @1000000001 stage/release
mv -u release stage/
printf 'mv exit: %s\n' "$?"
find . -name manifest -print
Expected (GNU Coreutils 9.7 and 9.12)
mv exit: 0
./stage/release/manifest
Actual (uutils 0.13.0 and main)
mv exit: 0
./release/manifest
Neither implementation prints a diagnostic. With uutils, stage/release remains empty. The GNU mv manual limits the timestamp skip to non-directory sources.
Source
In mv.rs, lines 827–838, (!from_is_dir || to_metadata.is_dir()) is true when both entries are directories. If the source mtime is less than or equal to the destination mtime, the function returns Ok(()) before attempting the rename.
Tested on Debian 13, x86-64 Linux 6.18.57, with uutils 0.13.0 (07b76df), upstream main (2a072db), and GNU Coreutils 9.7 and 9.12. I found no matching issue or PR. The related PR #15912 addressed dangling destination symlinks.
- 主要言語
- Rust
- スター
- 24.5k
- フォーク
- 2.2k
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 325
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
uutils/coreutils のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
dd: seek=010 silently writes at offset 8 instead of 10対応中かも @adityawrk が 1 日前に担当しました。 オープンU - dd
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
uutils/coreutils#16919 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
od: abbreviated --format is accepted but ignored対応中かも @yewjung が 1 日前に担当しました。 オープンU - od
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
I - Documentation U - All (Tooling)
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
uutils/coreutils#16847 · コメント 12 件 ·
メンテナーはふだん 1 日以内に返信
-
Recursive cp overwrites files one directory too high on Linux when the source name ends in a literal backslash and dot対応中かも @Xnadir が 6 日前に担当しました。 オープンU - cp
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
uutils/coreutils の issue をすべて見る
似ている issue
-
Link Checker Reportオープンautomated issue report
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
ratatui/awesome-ratatui#598 ·
メンテナーはふだん 1 日以内に返信
-
area:core priority:high status:ready type:security
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
release
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
github/gh-aw-mcpg#17603 ·
メンテナーはふだん 1 日以内に返信
-
C-Bug S-Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
bevyengine/bevy#26718 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100