Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Sep 2014 12:07:51 +0200
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        Tijl Coosemans <tijl@FreeBSD.org>
Cc:        ports@freebsd.org
Subject:   Re: [BRAINSTORMING] simplifying maintainer's life
Message-ID:  <20140903100751.GG63085@ivaldir.etoilebsd.net>
In-Reply-To: <20140903120144.5bfc3fde@kalimero.tijl.coosemans.org>
References:  <20140903082538.GE63085@ivaldir.etoilebsd.net> <20140903120144.5bfc3fde@kalimero.tijl.coosemans.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--6BvahUXLYAruDZOj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Sep 03, 2014 at 12:01:44PM +0200, Tijl Coosemans wrote:
> On Wed, 3 Sep 2014 10:25:39 +0200 Baptiste Daroussin <bapt@FreeBSD.org> w=
rote:
> > On of the most borring thing IMHO in the plist maintainance is all the
> > directories.
> >=20
> > I have been working on some evolutions I want to share and discuss befo=
re
> > making them official.
> >=20
> > First you have to know that since pkg 1.3 @dirrm and @dirrmtry are
> > equivalent.
> >=20
> > Evolutions:
> > 1/ stop prepending directories in plist with @dir*: let pkg discover
> > the path correspond to a directory and handle it as such (easy)
>=20
> Good.
>=20
> > 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 will
> > 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 LOCALBASE
> 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.

We do already support empty directories natively we do not need the .keep
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

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 actu=
ally
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.

In anycase I will limit auto removal to PREFIX (the one supplied when creat=
ing
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.

regards,
Bapt

--6BvahUXLYAruDZOj
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlQG6HcACgkQ8kTtMUmk6Ex2jACgj74RVUo3ZcP+z9TT7Eorb2Sr
mIoAn2HJQNoz1wMWDGhtWs0uJHWXdmqc
=WBqD
-----END PGP SIGNATURE-----

--6BvahUXLYAruDZOj--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140903100751.GG63085>