FS#11302 - repo-add should generate the repo.files.tar.gz file
Attached to Project:
Pacman
Opened by Gavin Bisesi (Daenyth) - Monday, 25 August 2008, 15:04 GMT
Last edited by Dan McGee (toofishes) - Thursday, 20 January 2011, 21:48 GMT
Opened by Gavin Bisesi (Daenyth) - Monday, 25 August 2008, 15:04 GMT
Last edited by Dan McGee (toofishes) - Thursday, 20 January 2011, 21:48 GMT
|
Details
repo-add should generate the repo.files.tar.gz file so that
pkgfile can work for any arch repo. (Or users can do it
manually, etc)
|
This task depends upon
Closed by Dan McGee (toofishes)
Thursday, 20 January 2011, 21:48 GMT
Reason for closing: Implemented
Additional comments about closing: For 3.5.0 in eda4d9ec00be1108a
Thursday, 20 January 2011, 21:48 GMT
Reason for closing: Implemented
Additional comments about closing: For 3.5.0 in eda4d9ec00be1108a
http://projects.archlinux.org/?p=dbscripts.git;a=blob_plain;f=cron-jobs/createFileLists;hb=HEAD
repo-add is in pacman :
http://projects.archlinux.org/?p=pacman.git;a=blob_plain;f=scripts/repo-add.sh.in;hb=HEAD
So that is the problem :)
Additionally, could you make this optional? Something like:
repo-add foo.db.tar.gz blah.pkg.tar.gz #just update the DB
repo-add --files foo.db.tar.gz blah.pkg.tar.gz #update both the DB and the .files.tar.gz
repo-add foo.db.tar.gz blah1.pkg.tar.gz # add blah1 in db but not in files
repo-add --files foo.db.tar.gz blah2.pkg.tar.gz # add blah2 in both db and files
So db and files end up to be inconsistent.
Or maybe this should be an env var like REPOADD_FILES to be more sure we keep a consistent value?
If I split it into a --files thing I see two ways to do it.. I could either update all entries (slow and ugly), or try to somehow figure out which entries are missing and do those. If --files was used with an update arg then it would update the DB and also the file list for that package. I don't think that would allow errors.
Anyone have any opinions/suggestions?
repo-add [--files] foo.db.tar.gz bar.pkg.tar.gz :
if --files then remove old bar/files entry from foo.files.tar.gz , and extract the new bar/files one
Note that you don't even have the option to update all entries, you can only choose to update for the packages that are being added.
So if you need to rebuild the whole db, you simply do : repo-add --files *.pkg.tar.gz , and that's all.
Otherwise you would have to "guess" where the packages are, which is not so nice.
What we need is for this to be quick and work for a single package at a time. Generating file lists should also be optional, for the sake of people running their own repos.
Having a simple "--files" flag that enables files entries to be created as well would be fine for me, but I don't think we can make that the default.
So for files, calling:
repo-add --files foo.db.tar.gz foobar.pkg.tar.gz
would only create a filelist for foobar, and not touch anything else. It would remove any existing filelist for foobar.
What I don't know is what you would pass for the DB name- I would assume the files DB (so foo.files.db.tar.gz). In order to "fully" add a package, you would have one call to "repo-add" and one call to "repo-add --files".
That is:
repo-add --files foo.files.tar.gz foo.db.tar.gz *.pkg.tar.gz
This will future-proof us if we change names of any of these files.
1) repo-add foo.db.tar.gz *.pkg.tar.gz
2) repo-add --files foo.files.db.tar.gz *.pkg.tar.gz
http://projects.archlinux.org/dbscripts.git/tree/cron-jobs/create-filelists
Imho it would make sense to add functionality to create the pkgfile-db and the normal one in one run.
This would only require changes at the end of the script, when the db gets re-archived:
It could very easily be tar'ed a second time with an "--exclude=files" (or similar, I don't know about the syntax of the --exclude switch) directive.
This would also simplify what seems to be the main use case: Modifying both a db.tar.gz and a files.tar.gz
1. You will need doc/repo-add.8.txt updates as well.
2. Please find a way other than awk to include this list- we just had compat issues with it in makepkg (http://projects.archlinux.org/pacman.git/commit/?id=bd98b93a6e161c436c22f6c39d2d6293f420cbcc) and you can do this more simply- do it like lines 76/77 in here: http://projects.archlinux.org/dbscripts.git/tree/cron-jobs/create-filelists
3. Keep the flags in the "Usage" part in alpha order. And why did you add it to repo-remove? That makes no sense the way you set this up, right?
4. Thanks! I know this looks like a lot of whining but I just want to make sure it is done right. And if you would like to be attributed under your full name, make sure you submit the patch that way.
I added that (the delta-feature is missing documentation too, btw.)
> Please find a way other than awk to include this list- we just had compat issues with it in makepkg (http://projects.archlinux.org/pacman.git/commit/?id=bd98b93a6e161c436c22f6c39d2d6293f420cbcc) and you can do this more simply- do it like lines 76/77 in here: http://projects.archlinux.org/dbscripts.git/tree/cron-jobs/create-filelists
It's now using sed and echo.
> 3. Keep the flags in the "Usage" part in alpha order. And why did you add it to repo-remove? That makes no sense the way you set this up, right?
I assumed it may be of use in later states of development (see my last comment), but it really is unapt.
> 4. Thanks! I know this looks like a lot of whining but I just want to make sure it is done right. And if you would like to be attributed under your full name, make sure you submit the patch that way.
It would have been surprising if my first patch for pacman had been perfect. I appreciate your comments.
I would rather use a pseudonym (I am a bit paranoid).
1. Fixed alpha ordering in the docs, thanks for pointing out missing -d/--delta docs there.
2. Removed reference to pkgfile. This is not an official tool, so we shouldn't talk about it and we can be more generic.
3. Removed $startdir prefixing in the files bsdtar call, this behaved nothing like the rest of the metadata reading and we have no right assuming files are in $startdir anyway.
And a script? It's one line to our dbscripts (just call repo-add with the -f arg and the files DB instead), and we can kill the entire create-filelists cronjob after that.
Anyway, the point is that this simplifies the dbscripts and also syncs the db and files.