From owner-freebsd-ports@FreeBSD.ORG Wed Sep 3 13:45:12 2014 Return-Path: Delivered-To: ports@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 ESMTPS id 5AA19269; Wed, 3 Sep 2014 13:45:12 +0000 (UTC) Received: from mail-we0-x232.google.com (mail-we0-x232.google.com [IPv6:2a00:1450:400c:c03::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBAE41A7C; Wed, 3 Sep 2014 13:45:11 +0000 (UTC) Received: by mail-we0-f178.google.com with SMTP id u57so8542234wes.23 for ; Wed, 03 Sep 2014 06:45:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=Af9rg5BkOnYFXjLr7K1cPFLJ+u8a9uoUFIyqfHngwYM=; b=La8zEqvk56y/7yx+ZVMj14EPiVnmkPdSRQWSOjmRsKLsUfWLBi4vRulxiIZFka691N Uxc/reYOV+HLZLjKXDLpmMzY4tgU4EsdPmHheIyZOq1kTWtWrcLdtovyJm0nU6zQqbuY khMyzAhrk7U5RE0XTQBcAl/UvvX8IUAagxA27xaU5Aa1SR6uKRDatbFSNXkF9DnGAejv m3QcZLQRfe3SwnpalrUcxv4FuFZtVq3CVvT2KZrO/GFNAKsGC7Y1huOuAydMfIz/3bN6 HTez5zyurI5bw0yKHsPjQcCGE7wsIJDzIMX1uCAjUaVBZNXBsTkpdwYmHdF5uc9z1OsX uWNw== X-Received: by 10.180.20.196 with SMTP id p4mr35337468wie.56.1409751909930; Wed, 03 Sep 2014 06:45:09 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id hi4sm15836604wjb.46.2014.09.03.06.45.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Sep 2014 06:45:08 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 3 Sep 2014 15:45:06 +0200 From: Baptiste Daroussin To: Tijl Coosemans Subject: Re: [BRAINSTORMING] simplifying maintainer's life Message-ID: <20140903134506.GJ63085@ivaldir.etoilebsd.net> References: <20140903082538.GE63085@ivaldir.etoilebsd.net> <20140903120144.5bfc3fde@kalimero.tijl.coosemans.org> <20140903100751.GG63085@ivaldir.etoilebsd.net> <20140903143017.372e42a4@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="huG+SbfbdD6eblZQ" Content-Disposition: inline In-Reply-To: <20140903143017.372e42a4@kalimero.tijl.coosemans.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 13:45:12 -0000 --huG+SbfbdD6eblZQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 03, 2014 at 02:30:17PM +0200, Tijl Coosemans wrote: > On Wed, 3 Sep 2014 12:07:51 +0200 Baptiste Daroussin w= rote: > > On Wed, Sep 03, 2014 at 12:01:44PM +0200, Tijl Coosemans wrote: > >> On Wed, 3 Sep 2014 10:25:39 +0200 Baptiste Daroussin wrote: > >>> 2/ make pkg automatically remove directories under PREFIX without the > >>> need of adding them in plist, such as only empty directories and > >>> directories not under PREFIX will have to be listed. Of course pkg wi= ll > >>> not try to remove directories owned by another package. > >>>=20 > >>> To achieve the point 2 that will mean we will stop using the mtree > >>> inside packages and create a "hier" package that will have the default > >>> hierarchy and every package but pkg will depend on this hier package > >>> (except if PREFIX !=3D LOCALBASE) > >>=20 > >> I think you can avoid the hier package and thus the PREFIX !=3D LOCALB= ASE > >> problem. > >>=20 > >> Assume there are no packages with empty directories, then pkg can > >> always remove empty directories when deinstalling a package, because > >> no files in the directory means no package requires it. You don't need > >> a hier package in this case. > >>=20 > >> You can add support for packages with empty directories in two ways: > >> - Put a dummy file in the directory, e.g. .PKGNAME.keepme > >> (simple to implement, but maybe some packages really need the > >> directory to be empty or maybe they only expect a specific type of > >> files) > >> - Record something like .PKGNAME.keepme in the pkg db but don't > >> actually create that file. > >=20 > > We do already support empty directories natively we do not need the .ke= ep > > whatever and this works pretty well :) > > if a line in the plist is a directory (or @dirrm* ) then the directory = is > > considered as owned by the package and always created >=20 > Does this work: packages A and B both create the same empty directory > and package C installs files in that directory. Can you install and > deinstall A, B and C in any order and will that directory only be > deleted when you deinstall the last package? yes >=20 > Is pkg already keeping a reference count or something for every > directory? yes >=20 > > My only problem is to still provide the default grobal hier in provided > > by BSD.local.dist (like etc/rc.conf.d etc/libmap.d etc) that said we > > have actually only 4 empty directories all documented in the respective > > manpages from base where they are used, so yes probably I can just > > ignore the mtree at all > > Which makes the feature easy to implement then. >=20 > I don't think those directories actually need to exist. On a fresh > installation /usr/local is empty. true >=20 > > In anycase I will limit auto removal to PREFIX (the one supplied when > > creating the package) because base has its own mtree and I do not want > > to delete any empty directory from base at least until base is package > > itself. >=20 > Yes, it's probably a good idea to list everything outside PREFIX > explicitly. Maybe you can limit it to the current @cwd instead of > PREFIX but then some existing pkg-plists may need to be fixed. regards, Bapt --huG+SbfbdD6eblZQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlQHG2IACgkQ8kTtMUmk6Ex+mACgjeNi3AcKr0Zdbf1xXz913KXs qTwAoLqwjFzov3bcfiZu0UaEYbE17JcP =UghQ -----END PGP SIGNATURE----- --huG+SbfbdD6eblZQ--