From owner-freebsd-ports@FreeBSD.ORG Wed Dec 12 11:47:22 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7E4D4B1 for ; Wed, 12 Dec 2012 11:47:22 +0000 (UTC) (envelope-from t.sowa@ttmath.org) Received: from slimaczek.pl (slimaczek.pl [91.121.5.90]) by mx1.freebsd.org (Postfix) with ESMTP id A9E048FC16 for ; Wed, 12 Dec 2012 11:47:22 +0000 (UTC) Received: from s100.slimaczek.pl (dynamic-78-8-244-198.ssp.dialog.net.pl [78.8.244.198]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by slimaczek.pl (Postfix) with ESMTPSA id DAB7739802 for ; Wed, 12 Dec 2012 12:14:34 +0100 (CET) Message-ID: <50C866EC.3080208@ttmath.org> Date: Wed, 12 Dec 2012 12:13:48 +0100 From: Tomasz Sowa User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121101 Thunderbird/16.0.2 MIME-Version: 1.0 To: freebsd-ports@freebsd.org Subject: [PATCH] pkgng forcing pkg register Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2012 11:47:23 -0000 Hi I'm testing the new pkgng from 10-CURRENT but it seems to not having an option for forcing registering a package. I have got a lot texlive-* packages (more than 1000) but I cannot upgrade them, I still got: Installing [pkg_name]: [pkg_name] conflicts with [other_pkg_name] (installs files into the same place) Googling through "(installs files into the same place)" shows that a lot of people have such a problem with other ports. So I wonder why there is no an option to force registering a port? Below is a small patch for pkg, after setting FORCE_PKG_REGISTER env variable you can force registering a port. May it should be other var than FORCE_PKG_REGISTER? -- Tomek --- pkg-1.0.3.oryginal/libpkg/pkgdb.c 2012-12-12 11:19:29.000000000 +0100 +++ pkg-1.0.3/libpkg/pkgdb.c 2012-12-12 11:33:05.000000000 +0100 @@ -1795,9 +1795,12 @@ lic_t licenselogic; int64_t flatsize; int64_t i; + bool force_register; assert(db != NULL); + force_register = (getenv("FORCE_PKG_REGISTER") != 0); + if (pkg_is_valid(pkg) != EPKG_OK) { pkg_emit_error("the package is not valid"); return (EPKG_FATAL); @@ -1872,7 +1875,7 @@ const char *pkg_sum = pkg_file_cksum(file); ret = run_prstmt(FILES, pkg_path, pkg_sum, package_id); - if (ret == SQLITE_DONE) + if (force_register || ret == SQLITE_DONE) continue; if (ret != SQLITE_CONSTRAINT) { ERROR_SQLITE(s);