NetBSD Problem Report #56458

From www@netbsd.org  Mon Oct 18 13:04:50 2021
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_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 C0EF41A9239
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 18 Oct 2021 13:04:49 +0000 (UTC)
Message-Id: <20211018130448.41B401A923A@mollari.NetBSD.org>
Date: Mon, 18 Oct 2021 13:04:48 +0000 (UTC)
From: mmaruska@gmail.com
Reply-To: mmaruska@gmail.com
To: gnats-bugs@NetBSD.org
Subject: pkg_add leaves files installed when POST-INSTALL fails
X-Send-Pr-Version: www-1.0

>Number:         56458
>Category:       install
>Synopsis:       pkg_add leaves files installed when POST-INSTALL fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 18 13:05:00 +0000 2021
>Originator:     Michal Maruška
>Release:        
>Organization:
>Environment:
>Description:
INSTALL script can exit with failure, say during POST-INSTALL stage.
In that case pkg_add will revert the installation, i.e. the package is marked as not-installed, yet the files remain on the filesystem, so an attempt to reinstall (a working version) will fail.

A possible workaround (in such situation) is currently
   pkg_admin rebuild


>How-To-Repeat:
Prepare a package which in INSTALL script does:
   exit 1

then install such a package.

$ pkg_add -v pkg-N.tgz
pkg_add: install script returned error status
pkg_add: 1 package addition failed


then try again:
$ pkg_add -v pkg-N.tgz
pkg_add: Conflicting PLIST with pkg-N: dir/filename

>Fix:
workaround:

pkg_admin rebuild

fix: https://github.com/NetBSD/pkgsrc/pull/95

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.