From owner-svn-src-stable@FreeBSD.ORG Thu Mar 29 23:57:54 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE214106564A; Thu, 29 Mar 2012 23:57:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97A098FC0A; Thu, 29 Mar 2012 23:57:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2TNvsfB015808; Thu, 29 Mar 2012 23:57:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2TNvs54015806; Thu, 29 Mar 2012 23:57:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201203292357.q2TNvs54015806@svn.freebsd.org> From: Eitan Adler Date: Thu, 29 Mar 2012 23:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233685 - stable/9/usr.sbin/pkg_install/create X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2012 23:57:54 -0000 Author: eadler Date: Thu Mar 29 23:57:54 2012 New Revision: 233685 URL: http://svn.freebsd.org/changeset/base/233685 Log: MFC r231300, r231328: Permit the use of relative paths for the prefix argument. Remove an unnecessary cwd from created plists when -p is specified Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/pkg_install/create/perform.c Directory Properties: stable/9/usr.sbin/pkg_install/ (props changed) Modified: stable/9/usr.sbin/pkg_install/create/perform.c ============================================================================== --- stable/9/usr.sbin/pkg_install/create/perform.c Thu Mar 29 23:31:48 2012 (r233684) +++ stable/9/usr.sbin/pkg_install/create/perform.c Thu Mar 29 23:57:54 2012 (r233685) @@ -214,8 +214,12 @@ pkg_perform(char **pkgs) read_plist(&plist, pkg_in); /* Prefix should add an @cwd to the packing list */ - if (Prefix) - add_plist_top(&plist, PLIST_CWD, Prefix); + if (Prefix) { + char resolved_prefix[PATH_MAX]; + if (realpath(Prefix, resolved_prefix) == NULL) + err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix); + add_plist_top(&plist, PLIST_CWD, resolved_prefix); + } /* Add the origin if asked, at the top */ if (Origin) @@ -260,7 +264,9 @@ pkg_perform(char **pkgs) /* mark_plist(&plist); */ /* Now put the release specific items in */ - add_plist(&plist, PLIST_CWD, "."); + if (!Prefix) { + add_plist(&plist, PLIST_CWD, "."); + } write_file(COMMENT_FNAME, Comment); add_plist(&plist, PLIST_IGNORE, NULL); add_plist(&plist, PLIST_FILE, COMMENT_FNAME);