Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Nov 2012 20:55:56 -0500 (EST)
From:      Lowell Gilbert <lgfbsd@be-well.ilk.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        kientzle@FreeBSD.org
Subject:   bin/174025: tar doesn't properly handle keyword "ago" in dates
Message-ID:  <20121201015556.BBDAE33C32@be-well.ilk.org>
Resent-Message-ID: <201212010200.qB12002p031395@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         174025
>Category:       bin
>Synopsis:       tar doesn't properly handle keyword "ago" in dates
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 01 02:00:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Lowell Gilbert
>Release:        FreeBSD 9.1-PRERELEASE i386
>Organization:
The Ilk
>Environment:
System: FreeBSD be-well.ilk.org 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #2: Fri Nov 23 13:41:39 EST 2012 root@lowell-desk.lan:/usr/obj/usr/src/sys/BE-WELL i386


	
>Description:

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.

	
>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) ~> 

	
>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.

	


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121201015556.BBDAE33C32>