Date: Thu, 9 Feb 2012 20:51:03 +0000 (UTC) From: Eitan Adler <eadler@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r231300 - head/usr.sbin/pkg_install/create Message-ID: <201202092051.q19Kp3pj028436@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: eadler Date: Thu Feb 9 20:51:03 2012 New Revision: 231300 URL: http://svn.freebsd.org/changeset/base/231300 Log: Permit the use of relative paths for the prefix argument. Remove an unnecessary cwd from created plists when -p is specified PR: bin/145000 Submitted by: gcooper Approved by: portmgr (flo) MFC after: 1 month Modified: head/usr.sbin/pkg_install/create/perform.c Modified: head/usr.sbin/pkg_install/create/perform.c ============================================================================== --- head/usr.sbin/pkg_install/create/perform.c Thu Feb 9 20:49:03 2012 (r231299) +++ head/usr.sbin/pkg_install/create/perform.c Thu Feb 9 20:51:03 2012 (r231300) @@ -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) != 0) + 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202092051.q19Kp3pj028436>