From owner-freebsd-bugs Mon Sep 9 13:10:10 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A5CB37B400 for ; Mon, 9 Sep 2002 13:10:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50AE343E4A for ; Mon, 9 Sep 2002 13:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g89KA2JU094005 for ; Mon, 9 Sep 2002 13:10:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g89KA24E094004; Mon, 9 Sep 2002 13:10:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CB48637B4FD for ; Mon, 9 Sep 2002 13:07:46 -0700 (PDT) Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50B5543E42 for ; Mon, 9 Sep 2002 13:07:46 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g89K7jOT022132 for ; Mon, 9 Sep 2002 13:07:45 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.4/8.12.4/Submit) id g89K7jUj022131; Mon, 9 Sep 2002 13:07:45 -0700 (PDT) Message-Id: <200209092007.g89K7jUj022131@www.freebsd.org> Date: Mon, 9 Sep 2002 13:07:45 -0700 (PDT) From: Jeff King To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: bin/42609: pkg_info -qg doesn't handle missing files well Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 42609 >Category: bin >Synopsis: pkg_info -qg doesn't handle missing files well >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Sep 09 13:10:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Jeff King >Release: 4.6.2 >Organization: >Environment: FreeBSD segfault.intra 4.6.2-RELEASE FreeBSD 4.6.2-RELEASE #0: Mon Sep 9 03:31:47 EDT 2002 root@segfault.intra:/usr/obj/usr/src/sys/SEGFAULT i386 >Description: When using pkg_info -qg , one can obtain a list of files which fail the MD5 checksum. A list of files of the form " fails the original MD5 checksum\n" will be output to stdout. If a file is missing, however, it is *not* listed as failing the checksum. Instead, the following message is printed to stderr: "pkg_info: doesn't exist\n\n". While the semantics of "failing an MD5 checksum" may be up for debate (does a missing file fail because it is missing?) it seems that the intent of the -g option is to do an integrity check on the package. Missing files are clearly an integrity problem, but parsing the stdout of pkg_info -g will not include them. >How-To-Repeat: Choose a file from an installed package. Move the file to a backup area. Run pkg_info -qg . >Fix: My suggestion, therefore, is to do away with the stderr message in the case of a missing file, and instead output a message to stdout of the form " does not exist". The change is actually a one liner. Change /usr/src/usr.sbin/pkg_install/info/show.c:283 from warnx("%s doesn't exist\n", tmp); to printf("%s does not exist\n", tmp); As an aside, even if this change is not accepted, the '\n' in the warnx is redundant and should be removed. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message