From owner-svn-ports-head@FreeBSD.ORG Sat Oct 5 22:27:00 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EFB1373B; Sat, 5 Oct 2013 22:27:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CDC4A2903; Sat, 5 Oct 2013 22:27:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r95MR0mY085067; Sat, 5 Oct 2013 22:27:00 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r95MR0rs085063; Sat, 5 Oct 2013 22:27:00 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310052227.r95MR0rs085063@svn.freebsd.org> From: Bryan Drewery Date: Sat, 5 Oct 2013 22:27:00 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r329517 - in head/ports-mgmt/pkg-devel: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 22:27:01 -0000 Author: bdrewery Date: Sat Oct 5 22:26:59 2013 New Revision: 329517 URL: http://svnweb.freebsd.org/changeset/ports/329517 Log: - Sync with pkg update Fix pkg register -i (staged pass mode) not properly respecting @owner/@group With hat: portmgr Added: head/ports-mgmt/pkg-devel/files/patch-libpkg__packing.c - copied unchanged from r329516, head/ports-mgmt/pkg/files/patch-libpkg__packing.c Modified: head/ports-mgmt/pkg-devel/Makefile head/ports-mgmt/pkg-devel/files/patch-libpkg__pkg.c Modified: head/ports-mgmt/pkg-devel/Makefile ============================================================================== --- head/ports-mgmt/pkg-devel/Makefile Sat Oct 5 22:07:06 2013 (r329516) +++ head/ports-mgmt/pkg-devel/Makefile Sat Oct 5 22:26:59 2013 (r329517) @@ -2,7 +2,7 @@ PORTNAME= pkg DISTVERSION= 1.1.4 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= ports-mgmt MASTER_SITES= http://files.etoilebsd.net/pkg/ \ http://mirror.shatow.net/freebsd/${PORTNAME}/ \ Copied: head/ports-mgmt/pkg-devel/files/patch-libpkg__packing.c (from r329516, head/ports-mgmt/pkg/files/patch-libpkg__packing.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg-devel/files/patch-libpkg__packing.c Sat Oct 5 22:26:59 2013 (r329517, copy of r329516, head/ports-mgmt/pkg/files/patch-libpkg__packing.c) @@ -0,0 +1,59 @@ +--- libpkg/packing.c.orig 2013-10-05 19:46:59.920058519 +0200 ++++ libpkg/packing.c 2013-10-05 19:49:46.531103495 +0200 +@@ -36,6 +36,8 @@ + #include + #include + #include ++#include ++#include + + #include "pkg.h" + #include "private/event.h" +@@ -44,6 +46,7 @@ + static const char *packing_set_format(struct archive *a, pkg_formats format); + + struct packing { ++ bool pass; + struct archive *aread; + struct archive *awrite; + struct archive_entry_linkresolver *resolver; +@@ -67,6 +70,7 @@ + archive_read_disk_set_symlink_physical((*pack)->aread); + + if (!is_dir(path)) { ++ (*pack)->pass = false; + (*pack)->awrite = archive_write_new(); + archive_write_set_format_pax_restricted((*pack)->awrite); + ext = packing_set_format((*pack)->awrite, format); +@@ -89,6 +93,7 @@ + return EPKG_FATAL; + } + } else { /* pass mode directly write to the disk */ ++ (*pack)->pass = true; + (*pack)->awrite = archive_write_disk_new(); + archive_write_disk_set_options((*pack)->awrite, + EXTRACT_ARCHIVE_FLAGS); +@@ -177,11 +182,21 @@ + archive_entry_set_size(entry, 0); + } + +- if (uname != NULL && uname[0] != '\0') ++ if (uname != NULL && uname[0] != '\0') { ++ if (pack->pass) { ++ struct passwd *pw = getpwnam(uname); ++ archive_entry_set_uid(entry, pw->pw_uid); ++ } + archive_entry_set_uname(entry, uname); ++ } + +- if (gname != NULL && gname[0] != '\0') ++ if (gname != NULL && gname[0] != '\0') { ++ if (pack->pass) { ++ struct group *gr = getgrnam(gname); ++ archive_entry_set_gid(entry, gr->gr_gid); ++ } + archive_entry_set_gname(entry, gname); ++ } + + if (perm != 0) + archive_entry_set_perm(entry, perm); Modified: head/ports-mgmt/pkg-devel/files/patch-libpkg__pkg.c ============================================================================== --- head/ports-mgmt/pkg-devel/files/patch-libpkg__pkg.c Sat Oct 5 22:07:06 2013 (r329516) +++ head/ports-mgmt/pkg-devel/files/patch-libpkg__pkg.c Sat Oct 5 22:26:59 2013 (r329517) @@ -1,5 +1,5 @@ ---- ./libpkg/pkg.c.orig 2013-09-24 14:53:00.000000000 +0200 -+++ ./libpkg/pkg.c 2013-09-24 14:58:33.000000000 +0200 +--- libpkg/pkg.c.orig 2013-07-06 12:48:19.000000000 +0200 ++++ libpkg/pkg.c 2013-10-05 19:45:16.675062417 +0200 @@ -1181,6 +1181,20 @@ struct pkg_dir *dir = NULL; char spath[MAXPATHLEN + 1]; @@ -21,15 +21,27 @@ if (packing_init(&pack, dest, 0) != EPKG_OK) { /* TODO */ -@@ -1200,6 +1214,11 @@ +@@ -1190,15 +1204,21 @@ + while (pkg_dirs(pkg, &dir) == EPKG_OK) { + snprintf(spath, sizeof(spath), "%s%s", src, pkg_dir_path(dir)); + snprintf(dpath, sizeof(dpath), "%s%s", dest, pkg_dir_path(dir)); +- packing_append_file(pack, spath, dpath); ++ packing_append_file_attr(pack, spath, dpath, ++ dir->uname, dir->gname, dir->perm); } + while (pkg_files(pkg, &file) == EPKG_OK) { + snprintf(spath, sizeof(spath), "%s%s", src, pkg_file_path(file)); + snprintf(dpath, sizeof(dpath), "%s%s", dest, pkg_file_path(file)); +- packing_append_file(pack, spath, dpath); ++ packing_append_file_attr(pack, spath, dpath, ++ file->uname, file->gname, file->perm); + } + /* + * Execute post install scripts + */ + pkg_script_run(pkg, PKG_SCRIPT_POST_INSTALL); -+ + return (packing_finish(pack)); } -