Author: eadler Date: Thu Mar 29 23:58:16 2012 New Revision: 233686 URL: http://svn.freebsd.org/changeset/base/233686
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/8/usr.sbin/pkg_install/create/perform.c Directory Properties: stable/8/usr.sbin/pkg_install/ (props changed) Modified: stable/8/usr.sbin/pkg_install/create/perform.c ============================================================================== --- stable/8/usr.sbin/pkg_install/create/perform.c Thu Mar 29 23:57:54 2012 (r233685) +++ stable/8/usr.sbin/pkg_install/create/perform.c Thu Mar 29 23:58:16 2012 (r233686) @@ -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); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"