From owner-freebsd-ports@freebsd.org Wed Jan 27 18:24:15 2021 Return-Path: Delivered-To: freebsd-ports@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 853125273DA for ; Wed, 27 Jan 2021 18:24:15 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from maybe.home.utahime.org (gate.home.utahime.org [183.180.29.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DQsSZ1b2Dz4sMy for ; Wed, 27 Jan 2021 18:24:13 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from eastasia.home.utahime.org (eastasia.home.utahime.org [192.168.174.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by maybe.home.utahime.org (Postfix) with ESMTPS id C058712842 for ; Thu, 28 Jan 2021 03:24:09 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=utahime.org; s=maybe2019112701; t=1611771849; bh=fyGCPo7GX6jF/LLr2ZogEh02XU8U+isrBnckRP8fJ0o=; h=Date:To:Subject:From:In-Reply-To:References; b=WkzDpOn3RYkZtYl+KRlxTaNmxEHp5lgWao7hmeOq6L/aZG3JldS4Y8rLbLNiFlXtF wDJPAtfLsGbjCjU6w1KCSD25/XtxBbIKNnHEGfITbOEhXrpwgtzcNYnXXni28QgEKd /kY0nYWoOB33UIEqvgwl3PaY5l385zcMQNn3lVPitHnsgu+bnUvh1Rf5boXqpzZwSf d3DOhV8YKAx2hI0Lwx9G/ucwveIkwAPDSzkP7x/aMZPdYbiwF236T3ifdQrdB5VZTh 29YxPdn+pCHdEbIKzrw91mstkcIYGgbdu02xvXAN5IcXPLN3cEb4wW5rrvCjW+ayFx eViDy/3mMdONA== Received: from localhost (rolling.home.utahime.org [192.168.174.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by eastasia.home.utahime.org (Postfix) with ESMTPSA id 384BD1C1BE; Thu, 28 Jan 2021 03:24:07 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.0 at eastasia.home.utahime.org Date: Thu, 28 Jan 2021 03:23:57 +0900 (JST) Message-Id: <20210128.032357.1244236311987046987.yasu@utahime.org> To: freebsd-ports@freebsd.org Subject: Re: List of packages upgraded last time `pkg upgrade` was executed From: Yasuhiro Kimura In-Reply-To: <20210127100557.4cae09a8@bsd64.grem.de> References: <20210127.105722.43271801537229412.yasu@utahime.org> <20210127100557.4cae09a8@bsd64.grem.de> X-Mailer: Mew version 6.8 on Emacs 27.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DQsSZ1b2Dz4sMy X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=utahime.org header.s=maybe2019112701 header.b=WkzDpOn3; dmarc=none; spf=pass (mx1.freebsd.org: domain of yasu@utahime.org designates 183.180.29.210 as permitted sender) smtp.mailfrom=yasu@utahime.org X-Spamd-Result: default: False [-0.70 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+a:spf-authorized.utahime.org]; HFILTER_HELO_NORES_A_OR_MX(0.30)[maybe.home.utahime.org]; TO_DN_NONE(0.00)[]; HFILTER_HELO_IP_A(1.00)[maybe.home.utahime.org]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[utahime.org:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[183.180.29.210:from]; ASN(0.00)[asn:2519, ipnet:183.180.0.0/16, country:JP]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[utahime.org:s=maybe2019112701]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org]; DMARC_NA(0.00)[utahime.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[183.180.29.210:from:127.0.2.255]; MID_CONTAINS_FROM(1.00)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-ports] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2021 18:24:15 -0000 From: Michael Gmelin Subject: Re: List of packages upgraded last time `pkg upgrade` was executed Date: Wed, 27 Jan 2021 10:05:57 +0100 > This will give you a list of all packages that were updated/installed > last: > > pkg query -e %t=$(pkg query %t | sort -n | tail -n1) %n-%v I tried this but unfortunately it doesn't seem to work as is expected. On the host I tried it, following packages are upgraded when I did `pkg upgrade` last time. p5-URI-5.06 p5-Module-CoreList-5.20210120 rubygem-bundler-2.2.7_1,1 sudo-1.9.5p2 1611721387 And I got following result. yasu@eastasia[1213]% pkg query -e %t=$(pkg query %t | sort -n | tail -n1) %n-%v p5-Module-CoreList-5.20210120 p5-URI-5.06 yasu@eastasia[1213]% So I checked timestamp of install packages. yasu@eastasia[1216]% pkg query -a '%n-%v %t' | sort -k 2 -n -r | head -10 ~ p5-URI-5.06 1611721389 p5-Module-CoreList-5.20210120 1611721389 rubygem-bundler-2.2.7_1,1 1611721388 sudo-1.9.5p2 1611721387 p5-Config-General-2.63 1611685127 libunwind-20201110 1611685127 bind916-9.16.11 1611685127 zstd-1.4.8 1611685126 sqlite3-3.34.1,1 1611685126 bind-tools-9.16.11 1611685125 yasu@eastasia[1217]% As you can see timestamps of rubygem-bundler-2.2.7_1,1 and sudo-1.9.5p2 are smaller than that of p5-URI-5.06 and p5-Module-CoreList-5.20210120. So they aren't included in the list. > As far as I can tell, packages installed by the same pkg invocation run > share the same installation timestamp (I didn't check the pkg sources, > but that's what appears to be the case), According to the above result, it doesn't seem to be true. And I think it's quite possible. When packages are upgraded they are upgraded not in parallel but sequentially. So let me assume following situation. * Pakcage A and B are to be upgraded. * A is upgraded first and B is next. * Both are quite large package. * Host is low-spec. In this case upgrade of each package may take a few minutes. And it result in that there is difference of a few minites between the timestamps of them after upgrade. > If you use a script to do upgrades, you could store the timestamp as > part of that and do something like this: > > touch /tmp/lastupgrade > pkg upgrade > # then, later: > pkg query -e "%t>=$(stat -f %m /tmp/lastupgrade)" %n-%v This didn't hit upon me and I think it's really excellent way to use file for timestamp. I'll use it in my shell script. Thank you for letting me know. --- Yasuhiro Kimura