From owner-p4-projects@FreeBSD.ORG Mon Jul 19 21:37:06 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 95B891065672; Mon, 19 Jul 2010 21:37:06 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58CF31065670 for ; Mon, 19 Jul 2010 21:37:06 +0000 (UTC) (envelope-from jlaffaye@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 485958FC16 for ; Mon, 19 Jul 2010 21:37:06 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o6JLb68p018138 for ; Mon, 19 Jul 2010 21:37:06 GMT (envelope-from jlaffaye@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o6JLb6eH018136 for perforce@freebsd.org; Mon, 19 Jul 2010 21:37:06 GMT (envelope-from jlaffaye@FreeBSD.org) Date: Mon, 19 Jul 2010 21:37:06 GMT Message-Id: <201007192137.o6JLb6eH018136@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jlaffaye@FreeBSD.org using -f From: Julien Laffaye To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 181198 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 21:37:06 -0000 http://p4web.freebsd.org/@@181198?ac=10 Change 181198 by jlaffaye@jlaffaye-chulak on 2010/07/19 21:36:40 Code cleanup. Affected files ... .. //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/extract.c#3 edit Differences ... ==== //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/extract.c#3 (text+ko) ==== @@ -127,7 +127,7 @@ warnx("package '%s' or its older version already installed%s", pkg.name, FailOnAlreadyInstalled ? "" : " (ignored)"); if (FailOnAlreadyInstalled == TRUE) - return (1); /* close enough for government work */ + return (1); } /* Now check the packing list for conflicts */ @@ -146,8 +146,6 @@ pkg.name, matched[i]); conflictsfound = 1; } - - continue; } } if(conflictsfound) { @@ -362,19 +360,18 @@ } /* - * Test whether to use the old method of passing tokens to installation - * scripts, and set appropriate variables.. - */ - if (fexists(POST_INSTALL_FNAME)) { - sprintf(post_script, "%s", POST_INSTALL_FNAME); - pre_arg[0] = '\0'; - post_arg[0] = '\0'; - } else { - if (fexists(INSTALL_FNAME)) { - sprintf(post_script, "%s", INSTALL_FNAME); - sprintf(pre_arg, "PRE-INSTALL"); - sprintf(post_arg, "POST-INSTALL"); - } + * Test whether to use the old method of passing tokens to installation + * scripts, and set appropriate variables.. + */ + post_script[0] = '\0'; + pre_arg[0] = '\0'; + post_arg[0] = '\0'; + if (fexists(POST_INSTALL_FNAME)) + strlcat(post_script, POST_INSTALL_FNAME, sizeof(post_script)); + else if (fexists(INSTALL_FNAME)) { + strlcat(post_script, INSTALL_FNAME, sizeof(post_script)); + strlcat(pre_arg, "PRE-INSTALL", sizeof(pre_arg)); + strlcat(post_arg, "POST-INSTALL", sizeof(post_arg)); } /* If we're really installing, and have an installation file, run it */ @@ -424,7 +421,7 @@ } if (!Fake && chdir(p->name) == -1) { warn("chdir(%s)", p->name); - return 1; + return (1); } last_dir = p->name; break;