Skip to content

Conversation

@jfinkels
Copy link
Collaborator

@jfinkels jfinkels commented Feb 6, 2025

Support obsolete form of timestamp argument for old POSIX versions. In summary, when older versions of POSIX are used and the first positional argument looks like a date and time, then treat it as a timestamp instead of as a filename. For example, before this commit

_POSIX2_VERSION=199209
POSIXLY_CORRECT=1
touch 01010000 11111111

would create two files, 01010000 and 11111111. After this commit, the first argument is interpreted as a date and time (in this case, midnight on January 1 of the current year) and that date and time are set on the file named 11111111.

Fixes #7180.

Support obsolete form of timestamp argument for old POSIX versions. In
summary, when older versions of POSIX are used and the first positional
argument looks like a date and time, then treat it as a timestamp
instead of as a filename. For example, before this commit

    _POSIX2_VERSION=199209
    POSIXLY_CORRECT=1
    touch 01010000 11111111

would create two files, `01010000` and `11111111`. After this commit,
the first argument is interpreted as a date and time (in this case,
midnight on January 1 of the current year) and that date and time are
set on the file named `11111111`.

Fixes uutils#7180.
@jfinkels jfinkels marked this pull request as ready for review February 6, 2025 03:29
@github-actions
Copy link

github-actions bot commented Feb 6, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/touch/obsolescent is no longer failing!

@jfinkels
Copy link
Collaborator Author

jfinkels commented Feb 7, 2025

Good eye, I've updated the test case and the code to match.

@github-actions
Copy link

github-actions bot commented Feb 7, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/touch/obsolescent is no longer failing!

@github-actions
Copy link

github-actions bot commented Feb 8, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/misc/tee is no longer failing!
Congrats! The gnu test tests/touch/obsolescent is no longer failing!

@cakebaker cakebaker merged commit d86a7fb into uutils:main Feb 8, 2025
65 checks passed
@cakebaker
Copy link
Contributor

Congrats! The gnu test tests/touch/obsolescent is no longer failing!

Well done, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

touch: does not support obsolete POSIX arguments for setting time

2 participants