Re: [arch-releng] [arch-general] [patch] AIF, discover repos on iso.
On Fri, 19 Feb 2010 22:26:54 +0100 (CET) Mark Pustjens <pustjens@dds.nl> wrote:
Hi List,
The attached patch fixes a TODO in lib-pacman of aif. Instead of hardcoding that `core' is always available locally and falling back to net for others, it now checks /src/ for repos.
It assumes repos are stored at /src/$repo/pkg/. All these repos are added as cache dirs.
While preparing pacman, a number of repo names are provided to be prepared.
All those repos which were requested are added as actual repo. If this repo is available locally, the url points to disk. Otherwise it falls back to the mirrorlist.
Please let me know what you think.
Greetings/Groetjes
Mark Pustjens
thanks. it looks pretty good. i like how you automatically add the right cachedirs. However, when adding repositories to the pacman config, * i would not do "Server = file:///src/${repo}/pkg" just because /src/repo/pkg exists. what if the user has an outdated core image and wants to do a netinstall? he might have explicitly configured a mirror (SYNC_URL), but it would get ignored like this. * in prefill_configs(), we only add an entry to the mirrorlist when [ "$var_PKG_SOURCE_TYPE" = "net" -a -n "${var_SYNC_URL}" ] i.e. with the following config: SOURCE=cd FILE_URL=file:///src/core/pkg nothing is added to $var_MIRRORLIST which is probably a good thing because we don't want `file:///src/core/pkg`-eqsue urls on the target system. Since you point to $var_MIRRORLIST instead of $serverurl for repo's which are not available in /src/ at all, this means they must be configured as netinstall. So if the user wants a netinstall, it's his own reponsability to fill in SYNC_URL correctly. however, this also implies if he wants to mount a custom package repository, he _must_ do it under /src/<reponame>, not any other dir. otherwise the code won't see it and use $var_MIRRORLIST which may contain a mirror not containing <reponame>, or even nothing at all. basically, the way i see it is this: - setting cachedirs for repos in /src never hurts - SYNC_URL set and netinstall: use $var_MIRRORLIST for all requested repo's, even if they are in /src - netinstall but -z $SYNC_URL: same as above, it's the users responsability to set SYNC_URL - cd install and FILE_URL not set: check if the repo is in /src, if so add it. if not, don't add it to pacman.conf at all - cd install and FILE_URL set: same as above but try to use FILE_URL first (*). I've also been thinking if things should not be more configurable then this. (for example, user wants to use core in /src, but extra from SYNC_URL (**)), but per-repository settings seem more complicated so I hope they are not needed. Actually, since we only support "updating all packages simultaneously only" anyway, the per-repo configurability might be to be avoided by definition. I hope you understand what i mean. i put some thought into this and it's getting late, so .. let me know. and if you want to update your patch, it would be much more convenient if you could host a git clone somewhere i could pull from. Dieter (*): we should probably only let the user specify /src himself and add /$repo/pkg ourself in the automatic procedure. as the '/pkg' part probably never changes?? otherwise the user must specify something like '/src/$repo/pkg' and we replace $repo. (**): if you think wanting to use any other repo then core is an overcomplication and you can install extra packages after rebooting, don't forget about automatic installations where you want to install all needed packages at once.
participants (1)
-
Dieter Plaetinck