NetBSD Problem Report #55079

From www@netbsd.org  Tue Mar 17 13:59:26 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 7F84D1A9213
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 17 Mar 2020 13:59:26 +0000 (UTC)
Message-Id: <20200317135925.727BB1A921A@mollari.NetBSD.org>
Date: Tue, 17 Mar 2020 13:59:25 +0000 (UTC)
From: kikadf.01@gmail.com
Reply-To: kikadf.01@gmail.com
To: gnats-bugs@NetBSD.org
Subject: sysupgrade: clean not remove the *.tar.xz files from cache directory
X-Send-Pr-Version: www-1.0

>Number:         55079
>Category:       pkg
>Synopsis:       sysupgrade: clean not remove the *.tar.xz files from cache directory
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jmmv
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 17 14:00:00 +0000 2020
>Closed-Date:    Tue Oct 13 02:56:04 +0000 2020
>Last-Modified:  Tue Oct 13 02:56:04 +0000 2020
>Originator:     kikadf
>Release:        9.0
>Organization:
>Environment:
>Description:
sysupgrade-1.5nb4 patched to support the new tar.xz archive format, but in the clean function, only remove the *gz* files from cache dir. This cause at next upgrade, the sysupgrade fetch don't download the new xz files, just reuse the old components.

Links:
1. bug report: https://github.com/jmmv/sysupgrade/issues/9
2. patch: https://github.com/kikadf/sysupgrade/commit/b2a7e21cc8c7302720904358b5a124b4d1949a43
3. pull request to the xz support patch: https://github.com/triaxx/sysupgrade/pull/1

cc: jmmv, triaxx

>How-To-Repeat:
On NetBSD-9:

# sysupgrade auto [daily-url snapshot1]
# ls /var/cache/sysupgrade
# sysupgrade auto [daily-url snapshot2]

>Fix:
From b2a7e21cc8c7302720904358b5a124b4d1949a43 Mon Sep 17 00:00:00 2001
From: kikadf <kikadf.01@gmail.com>
Date: Mon, 16 Mar 2020 13:20:13 +0100
Subject: [PATCH] Fix clean: remove *.tar.xz files

---
 sysupgrade.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sysupgrade.sh b/sysupgrade.sh
index 2434065..191f3da 100644
--- a/sysupgrade.sh
+++ b/sysupgrade.sh
@@ -432,6 +432,7 @@ sysupgrade_clean() {

     shtk_cli_info "Cleaning downloaded files"
     rm -f "$(shtk_config_get CACHEDIR)"/*.*gz*
+    rm -f "$(shtk_config_get CACHEDIR)"/*.${arch_ext}*
 }



>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->jmmv
Responsible-Changed-By: leot@NetBSD.org
Responsible-Changed-When: Tue, 17 Mar 2020 14:32:15 +0000
Responsible-Changed-Why:
Julio, can you please give it a look?
(over to MAINTAINER)


State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Tue, 13 Oct 2020 02:56:04 +0000
State-Changed-Why:
Fixed (it was reported several times with patches). Thanks for the report & patch.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.