Date: Sat, 20 Sep 2003 05:36:23 +0200 From: Oliver Eikemeier <eikemeier@fillmore-labs.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/57029: [PATCH] pkg_install: make more robust against corrupted package database Message-ID: <3F6BCB37.4050107@fillmore-labs.com> Resent-Message-ID: <200309200340.h8K3e9c2062512@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 57029 >Category: bin >Synopsis: [PATCH] pkg_install: make more robust against corrupted package database >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Sep 19 20:40:09 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Oliver Eikemeier >Release: FreeBSD 5.1-CURRENT i386 >Organization: Fillmore Labs - http://www.fillmore-labs.com >Environment: System: FreeBSD nuuk.fillmore-labs.com 5.1-CURRENT >Description: If the package info files in /var/db/pkg/<packagename> become corrupted, pkg_info and pkg_version react with various unhelpful error messages, see also PR 57016 >How-To-Repeat: # mkdir /var/db/pkg/corrupt_pkg_1.0 # touch /var/db/pkg/corrupt_pkg_1.0/+REQUIREMENTS # pkg_version -v pkg_version: unable to open +CONTENTS file # cd /usr/ports/sysutils/pkg_install; make install [...] ===> Installing for pkg_install-20030714_1 ===> Generating temporary packing list ===> Checking if sysutils/pkg_install already installed *** Error code 1 Stop in /usr/ports/sysutils/pkg_install. # pkg_delete -f corrupt_pkg_1.0 pkg_delete: no such package 'corrupt_pkg_1.0' installed >Fix: A patch is available on ftp://ftp.fillmore-labs.com/pub/FreeBSD/patches/patch-pkg_install-20030917_3.gz MD5 (patch-pkg_install-20030917_3.gz) = 29ce1c8dd938fba5b3f68d8f2def5551 It fixes pkg_info, pkg_delete and gives more helpful messages for pkg_version: # pkg_version -v pkg_version: the package info for package 'corrupt_pkg_1.0' is corrupt # cd /usr/ports/sysutils/pkg_install; make install [...] ===> Installing for pkg_install-20030714_1 ===> Generating temporary packing list ===> Checking if sysutils/pkg_install already installed [...] ===> Registering installation for pkg_install-20030714_1 # pkg_delete corrupt_pkg_1.0 pkg_delete: the package info for package 'corrupt_pkg_1.0' is corrupt (use -f to force removal) # pkg_delete -f corrupt_pkg_1.0 pkg_delete: the package info for package 'corrupt_pkg_1.0' is corrupt (but I'll delete it anyway) pkg_delete: couldn't completely deinstall package 'corrupt_pkg_1.0', only the log entry in /var/db/pkg/corrupt_pkg_1.0 was removed This patch build on the patches in PR 56961 and PR 56989, which fix additional bugs described there. >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F6BCB37.4050107>