From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 15 18:57:34 2020 Received: (at 39575) by debbugs.gnu.org; 15 Feb 2020 23:57:34 +0000 Received: from localhost ([127.0.0.1]:36596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j37JV-0004ic-Qn for submit@debbugs.gnu.org; Sat, 15 Feb 2020 18:57:34 -0500 Received: from imta-37.everyone.net ([216.200.145.37]:41072 helo=imta-38.everyone.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j37JU-0004iU-A7 for 39575@debbugs.gnu.org; Sat, 15 Feb 2020 18:57:33 -0500 Received: from pps.filterd (localhost.localdomain [127.0.0.1]) by imta-38.everyone.net (8.16.0.27/8.16.0.27) with SMTP id 01FNs71d022246; Sat, 15 Feb 2020 15:57:31 -0800 X-Eon-Originating-Account: ervDGRthh_bri2n5PVDA80z4v4NoiQ_RL44_Z0rNDJQ X-Eon-Dm: m0116787.ppops.net Received: by m0116787.mta.everyone.net (EON-AUTHRELAY2 - 5a81c4f2) id m0116787.5e0ea4a1.420ef2; Sat, 15 Feb 2020 15:57:30 -0800 X-Eon-Sig: AQMHrIJeSIVq776KxAIAAAAE,374e6cd72dfe9f4057694361c338fb9a X-Eip: t9tLyQdwE1xvNbpl4qV79O1OY03bVzHEQgQHX50x1_0 Date: Sun, 16 Feb 2020 00:57:16 +0100 From: Bengt Richter To: Tobias Geerinckx-Rice Subject: Re: bug#39575: guix time-machine fails when a tarball was modified in-place Message-ID: <20200215235716.GA10983@LionPure> References: <87y2t7j54n.fsf@gnu.org> <87eeuy2mua.fsf@gnu.org> <87tv3ticcx.fsf@gnu.org> <87r1yxe1z7.fsf@gnu.org> <87tv3tgtv2.fsf@gnu.org> <875zg78vsk.fsf@nckx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <875zg78vsk.fsf@nckx> User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2020-02-15_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1034 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2002050000 definitions=main-2002150211 X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 39575 Cc: 39575@debbugs.gnu.org, Jan Nieuwenhuizen , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bengt Richter Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) On +2020-02-15 21:01:36 +0100, Tobias Geerinckx-Rice via Bug reports for GNU Guix wrote: > Jan, Simon, > > Janneke 写道: > > https://snapshot.debian.org/archive/debian/20190406T212022Z/pool/main/h/harfbuzz/harfbuzz_2.4.0.orig.tar.bz2 > > This is a wonderful resource! Thank you, Janneke (and Debian)! > > zimoun 写道: > > Cool! > > But how do you determine the "date", i.e., this reference > > '20190406T212022Z' ? > > You'd take the timestamp immediately preceding your desired (Guix) commit's > date, or something like that. The fact that git commit dates aren't linear > shouldn't hurt here. > > > Could it be automated? > > Not without parsing HTML to get the valid timestamps: > . > You may not need to parse the html fully if the part you need is isolatable into delimited scopes that you can successively narrow. For example, I while back I wanted a command I could type to get the url of the latest linux kernel at kernel.org: stable-kernel.scm -h --8<---------------cut here---------------start------------->8--- Usage: stable-kernel-scm [ -h ] -h for this message (without args): go to https://www.kernel.org/ to wget page, extract URL of latest stable release tarball and write that URL to stdout. --8<---------------cut here---------------end--------------->8--- (oops, I see I din't use $0 in the usage text -- should be .scm, not -scm) I offer it below [1], with the thought that you could probably modify (not to mention improve :-) it to get the timestamps you want. Especially if you could get them to make the narrow context unique enough that it's delimiters can delimit it in one shot. The page at kernel.org is apparently stable enough that this still works, but YMMV until the snapshot page is similarly stable. (You could ask them to make it easy :) > Also, this doesn't seem to be a supported service yet[0]: > > “This is an implementation for a possible snapshot.debian.org service. > It's not yet finished, it's more a prototype/proof of concept to show > and learn what we want and can provide. So far it seems to actually > work.” > > Still really cool, > > T G-R > > [0]: https://salsa.debian.org/snapshot-team/snapshot HTH or is useful some way. -- Regards, Bengt Richter [1] --8<---------------cut here---------------start------------->8--- #!/usr/bin/bash exec guile -e main -s "$0" "$@" !# ;;;; stable-kernel.scm ;;;; goes to https://www.kernel.org/ to wget page, then ;;;; extracts name of latest stable release tarball to stdout ;;;; (define (usage) (format (current-error-port) (string-join '( "Usage: stable-kernel-scm [ -h ]" " -h for this message" " (without args):" " go to https://www.kernel.org/ to wget page," " extract URL of latest stable release tarball" " and write that URL to stdout." "") "\n"))) (use-modules (ice-9 format)) (use-modules (ice-9 rdelim)) (use-modules (ice-9 popen)) (use-modules (ice-9 textual-ports)) (use-modules (ice-9 and-let-star)) (use-modules (ice-9 regex)) (define (extract-delimited str s-beg s-end) (and-let* ((ix-beg (string-contains str s-beg)) (ix-post-beg (+ ix-beg (string-length s-beg))) (ix-end (string-contains str s-end ix-post-beg))) (substring str ix-post-beg ix-end))) (define kernel-url "https://www.kernel.org/") (define (get-kern-name) (let*((cmd-kern (string-append "wget -q -O - " kernel-url)) (p-inp (open-input-pipe cmd-kern)) (wgot-pinp-str (get-string-all p-inp)) (extracted-table-releases (extract-delimited wgot-pinp-str "" "
")) (extracted-stable-tarball-anchor (extract-delimited extracted-table-releases "stable:" ">tarball<")) (extracted-stable-href (extract-delimited extracted-stable-tarball-anchor "8---