Bug 174025 - tar(1) doesn't properly handle keyword "ago" in dates
Summary: tar(1) doesn't properly handle keyword "ago" in dates
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 9.1-PRERELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-01 02:00 UTC by lgfbsd
Modified: 2017-12-31 22:29 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lgfbsd 2012-12-01 02:00:00 UTC
The keyword "ago" doesn't work properly in date specifications for "--newer" et al.

A quick look at the code makes me think it might be coded for seconds and months, but nothing else.

Fix: 

Offhand, it looks to me like the parsing routine phrase() needs to
adjust fields besides RelSeconds and RelMonths for the 'tAgo'
case. 

But since there is alternative syntax for the same functionality, I'd
be okay with just getting rid of "ago" completely.
How-To-Repeat: 
Try '--newer "2 hours ago"' and '--newer "-2 hours"'.
They should do the same thing, but they don't.

e.g., 
	[5020] (lowell-desk) ~> tar  -cf out.tar --newer "now - 24 hours" bin
	[5021] (lowell-desk) ~> tar  -cvf out.tar --newer "now - 2 hours" bin
	a bin
	a bin/periodicbkp
	[5022] (lowell-desk) ~>
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:35 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped