Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#17196 - Add support for .bz2 and .xz databases to pacman

Attached to Project: Pacman
Opened by xduugu (xduugu) - Wednesday, 18 November 2009, 21:30 GMT
Last edited by Allan McRae (Allan) - Thursday, 15 July 2010, 05:01 GMT
Task Type Feature Request
Category Backend/Core
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version git
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

repo-add can generate gzip'ed, bzip'ed and xz'ed repo databases but pacman only looks for <reponame>.db.tar.gz. For this reason, you currently need a workaround which is either creating a symlink to the real database file or redirecting pacman's request to it, e.g. via mod_rewrite.
It may however be a good idea to add some kind of database discovery to pacman, for example check for <reponame>.db.tar.xz if <reponame>.db.tar.gz cannot be accessed and for <reponame>.db.tar.bz2 if neither a gzip'ed nor a xz'ed database exists.
This task depends upon

Closed by  Allan McRae (Allan)
Thursday, 15 July 2010, 05:01 GMT
Reason for closing:  Implemented
Additional comments about closing:  git commits 5dffef78 and 68dcabdf
Comment by Dan McGee (toofishes) - Tuesday, 01 December 2009, 02:26 GMT
Xavier, any thoughts? I see a few options:
1. Drop the .tar.xxx stuff completely, and always look for core.db, extra.db, etc. The file extension is really for human use (and unfortunately web server use) only.
2. Have repo-add always produce a symlink like core.db that points to the real database file.
3. The above suggestion- try one extension first, then another, then another. I don't really like this solution as it could result in a lot of unnecessary traffic.
4. Add a new conf file option that can either be global or repo-specific: "DbExt = db.tar.gz" or something.
5. Change the conf file slightly to also accommodate an extension, e.g. [core.db.tar.xz]
Comment by xduugu (xduugu) - Tuesday, 01 December 2009, 03:49 GMT
> 3. The above suggestion- try one extension first, then another, then another. I don't really like this solution as it could result in a lot of unnecessary traffic.

I do not like it either for the same reason like you. It was just the first naive approach I could think of which does not require config file changes.

Your first suggestion sounds good to me though. The only downside is that you have to specify the compression method on the initial database creation (or use the default).
Comment by Xavier (shining) - Tuesday, 01 December 2009, 11:39 GMT
I think I agree with what xduugu just said.
Comment by Nagy Gabor (combo) - Tuesday, 01 December 2009, 23:24 GMT
Since libarchive detects compression format from the header (not from filename), this is already implemented, I guess. ;-)

My vote: 2. (or 1.)

In addition, we should change DBEXT to ".db" asap, and then later we can migrate to any other compression format without pain. Btw, option 2 is the best for migration...
Comment by Dan McGee (toofishes) - Wednesday, 02 December 2009, 03:27 GMT
The only drawback of 1 (and/or 2) is the webserver Content-type thing I mentioned. If this doesn't seem like a problem to anyone, I'm go for that.

How would one specify a file format for repo-add to zip the database up if we went with (1)?
Comment by Xavier (shining) - Wednesday, 02 December 2009, 11:26 GMT
Some silly ideas :

case "$REPO_DB_FILE" in
*tar.gz) TAR_OPT="z" ;; -> repo-add -z or ext=tar.gz
*tar.bz2) TAR_OPT="j" ;; -> repo-add -j or ext=tar.bz2
*tar.xz) TAR_OPT="J" ;; -> repo-add -J or ext=tar.xz
*) warning "$(gettext "'%s' does not have a valid archive extension.")" \
"$REPO_DB_FILE" ;;
esac
Comment by Nagy Gabor (combo) - Wednesday, 02 December 2009, 12:38 GMT
The main reason I still prefer 2 is that if we just _remove_ repo.db.tar.gz and replace with repo.db, many users will be unable to sync. So for the "migrating" period, we _must_ use symlinks (until we can assume that most users have up-to-date pacman). And imho repo.db -> repo.db.tar.gz is much nicer than repo.db.tar.gz -> repo.db (or duplicated files)...

But in fact, there is no difference between 1 and 2 on pacman side, we use DBEXT=".db " in both cases, so this is just a very minor difference.
Comment by xduugu (xduugu) - Wednesday, 02 December 2009, 14:14 GMT
@Xavier
> *tar.gz) TAR_OPT="z" ;; -> repo-add -z or ext=tar.gz
> *tar.bz2) TAR_OPT="j" ;; -> repo-add -j or ext=tar.bz2
> *tar.xz) TAR_OPT="J" ;; -> repo-add -J or ext=tar.xz

My first thought was to use some kind of abstraction like your "ext=tar.gz" or in my case "-c{gz,bz2,xz}" but using bsdtar flags directly should be fine, too.

The repo-add command could look like

repo-add [-z|-j|-J] <repo-name> <pkg-file>...

then. The compression part can be made optional when updating a database and repo-add could fall back to a default compression method if none is specified on database creation.

IMO it would be a good idea to jump at the chance and get rid of the database extensions at commandline level in the same sweep. The only thing I am not sure about is how to take the path into account. "repo-add /a/b/c/core" does not make much sense when the file will actually be located at /a/b/c/core.db.


@Nagy
Is it really worth to add backward compatibility to repo-add? This mainly affects arch's official repositories and the only repo which really needs a symlink is core (to be able to update pacman).
Comment by Gavin Bisesi (Daenyth) - Friday, 04 December 2009, 01:40 GMT
I like repo.db symlinked to repo.db.foo
Comment by Allan McRae (Allan) - Wednesday, 07 April 2010, 14:28 GMT
Famous last words... but this looks like something I could code. Assigning to me!
Comment by Allan McRae (Allan) - Thursday, 15 July 2010, 05:00 GMT

Loading...