[pacman-dev] [PATCH] unlink_file: strip trailing slashes

Andrew Gregory andrew.gregory.8 at gmail.com
Wed Apr 12 13:22:34 UTC 2017


On 04/12/17 at 12:08pm, Allan McRae wrote:
> On 12/04/17 12:00, Allan McRae wrote:
> > On 10/04/17 09:49, Andrew Gregory wrote:
> >> Subtle problems like this could be avoided by removing the trailing slashes
> >> from libalpm's internal file lists.  Is there any reason not to remove them and
> >> use a field in the file_t struct to indicate type?  It already has a mode field
> >> that we could use.
> > 
> > At the moment, that is the only way we know something should be a
> > directory from the local db.  If the local db contained that information
> > in another format, I'd be happy to remove the trailing slash.
> 
> I forgot about mtree files!
> 
> There a possibility of a package being installed for a long time with no
> mtree file.  To make this change to the local database files, we would
> need to enforce mtree files being present.  At least one release with a
> deprecation message.

We should be able to leave the db format alone.  I think all we need
to do is have the various filelist builders strip the trailing slash,
or not add it as the case may be.  The major drawback that I see is
breaking libalpm front-ends that rely on the current behavior.

apg


More information about the pacman-dev mailing list