GNU bug report logs - #50694
ls and cpio's idea of "six months ago" are slightly different

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Reported by: 積丹尼 Dan Jacobson <jidanni@HIDDEN>; dated Mon, 20 Sep 2021 05:32:02 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 Sep 2021 05:31:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 20 01:31:59 2021
Received: from localhost ([127.0.0.1]:40600 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mSBuI-0007tE-VO
	for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 01:31:59 -0400
Received: from lists.gnu.org ([209.51.188.17]:52350)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jidanni@HIDDEN>) id 1mSBuG-0007t5-JF
 for submit <at> debbugs.gnu.org; Mon, 20 Sep 2021 01:31:58 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50336)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jidanni@HIDDEN>)
 id 1mSBuG-0006EV-7L; Mon, 20 Sep 2021 01:31:56 -0400
Received: from bumble.maple.relay.mailchannels.net ([23.83.214.25]:7487)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jidanni@HIDDEN>)
 id 1mSBuD-0003b7-AB; Mon, 20 Sep 2021 01:31:55 -0400
X-Sender-Id: dreamhost|x-authsender|jidanni@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id 6DE0C341A14;
 Mon, 20 Sep 2021 05:31:50 +0000 (UTC)
Received: from pdx1-sub0-mail-a8.g.dreamhost.com
 (100-96-133-192.trex.outbound.svc.cluster.local [100.96.133.192])
 (Authenticated sender: dreamhost)
 by relay.mailchannels.net (Postfix) with ESMTPA id E583D34133C;
 Mon, 20 Sep 2021 05:31:49 +0000 (UTC)
X-Sender-Id: dreamhost|x-authsender|jidanni@HIDDEN
Received: from pdx1-sub0-mail-a8.g.dreamhost.com (pop.dreamhost.com
 [64.90.62.162])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384)
 by 100.96.133.192 (trex/6.4.3); Mon, 20 Sep 2021 05:31:50 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|jidanni@HIDDEN
X-MailChannels-Auth-Id: dreamhost
X-Decisive-Callous: 381d5dcf15f934d7_1632115910163_632532957
X-MC-Loop-Signature: 1632115910163:3166269346
X-MC-Ingress-Time: 1632115910162
Received: from pdx1-sub0-mail-a8.g.dreamhost.com (localhost [127.0.0.1])
 by pdx1-sub0-mail-a8.g.dreamhost.com (Postfix) with ESMTP id E7C948A5C1;
 Sun, 19 Sep 2021 22:31:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to
 :subject:date:message-id:mime-version:content-type; s=
 jidanni.org; bh=Ghlw+bTX4ucvs4XCMbmOSy/8Yu4=; b=AU/oQi28Taatw45n
 uLtlHH1prOulASSFS29etXWg9tXAZsgNpJBr89/OCqDm3MFlqdnMPxZ8vK02JH7l
 zLtqMeGB9ePEelfU/+MHGlkhycKEjRMs/wxu1LnDw8thtBiCF5YlfdT8ub+zreeR
 gc+iHIa3peGYe039Kfz72YoOqDU=
Received: from jidanni.org (114-46-58-228.dynamic-ip.hinet.net [114.46.58.228])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 (Authenticated sender: jidanni@HIDDEN)
 by pdx1-sub0-mail-a8.g.dreamhost.com (Postfix) with ESMTPSA id 46C068A59C;
 Sun, 19 Sep 2021 22:31:48 -0700 (PDT)
X-DH-BACKEND: pdx1-sub0-mail-a8
From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson <jidanni@HIDDEN>
To: bug-coreutils@HIDDEN, bug-cpio@HIDDEN
Subject: ls and cpio's idea of "six months ago" are slightly different
Date: Mon, 20 Sep 2021 13:06:36 +0800
Message-ID: <8735pzg7j7.8.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=23.83.214.25; envelope-from=jidanni@HIDDEN;
 helo=bumble.maple.relay.mailchannels.net
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

What a headache.
"Six months ago" means slightly different things to cpio and ls.
And ls documents do say exactly what,
and cpio documents don't even say six months.

$ cat prover
set -eu
cd /tmp
for i in `seq 170 190`
do
    touch -d "$i days ago" x
    {
	env - ls -l x|tr -s ' '
	ls x|cpio -o 2>&-|cpio -tv 2>&-|tr -s ' '
    } > z
    if test `sort -u z|wc -l` != 1
    then cat z; echo
    fi
done
$ sh prover
-rw-r--r-- 1 jidanni jidanni 0 Mar 23 12:47 x
-rw-r--r-- 1 jidanni jidanni 0 Mar 23 2021 x

-rw-r--r-- 1 jidanni jidanni 0 Mar 22 12:47 x
-rw-r--r-- 1 jidanni jidanni 0 Mar 22 2021 x

So two things that should look the same ... don't.

What's worse is there is no option to change cpio's date format.

Well then just change ls's date format to match cpio's right?
Well yes, but then there is no way to change ls's idea of six months,
even if we examined cpio's source code to find out what it uses.

$ ls --version
ls (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.

$ cpio --version
cpio (GNU cpio) 2.13
Copyright (C) 2017 Free Software Foundation, Inc.




Acknowledgement sent to 積丹尼 Dan Jacobson <jidanni@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to bug-coreutils@HIDDEN:
bug#50694; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 20 Sep 2021 05:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.