Repository source .repo file in config.xml

57 views
Skip to first unread message

Michael Cartwright

unread,
Nov 20, 2020, 1:09:39 PM11/20/20
to kiwi
Hi all,

I thought I read somewhere that a version of Kiwi-ng would support .repo files in <repository><source> element paths.
i.e.

<repository>
    <source path="https://someserver/allmyrepos.repo"/>
</repository>

Did I dream this?

I was hoping there was some way to add a set of repositories to kiwi in one lump, theoretically utilizing the output of `zypper lr -e allmyrepos.repo`.

FWIW, I'm currently prototyping some new images with:
KIWI (next generation) version 9.21.23

Thanks!
-Mike

Marcus Schäfer

unread,
Nov 23, 2020, 5:58:55 AM11/23/20
to kiwi-...@googlegroups.com
Hi,

> I thought I read somewhere that a version of Kiwi-ng would support
> .repo files in <repository><source> element paths.

That is not quite correct. kiwi creates the .repo files from the
information given in the <repository> element for those package managers
who needs this.

> <repository>
>
> <source path="https://someserver/allmyrepos.repo"/>
>
> </repository>
>
> Did I dream this?

I don't know :) but the above setup would not work the way you expected
it. For this to work we would need to add another uri type, e.g

path="repo://https://someserver/allmyrepos.repo"

and that does not exist yet

> I was hoping there was some way to add a set of repositories to kiwi in
> one lump, theoretically utilizing the output of `zypper lr -e
> allmyrepos.repo`.

If you consider to use a little more code to utilize zypper in this
regard, you can think of the following:

---
#!/bin/bash

repos=$(mktemp --suffix .repo)

zypper lr --export "${repos}" &>/dev/null

for entry in $(cat "${repos}" | grep -E "\[|baseurl=|name=");do
if [[ "${entry}" =~ "[" ]];then
echo -n "<repository "
elif [[ "${entry}" =~ "name=" ]];then
echo "alias=\"$(echo ${entry} | cut -f2 -d=)\">"
elif [[ "${entry}" =~ "baseurl=" ]];then
echo " <source path=\"$(echo ${entry} | cut -f2 -d=)\"/>"
echo "</repository>"
fi
done

rm -f ${repos}
---

This is quick and dirty and not perfect, but maybe sufficient for
your use case ? Other than that I like the idea of allowing kiwi to
read .repo files.

Feel free to open an enhancement issue for this here:

https://github.com/OSInside/kiwi/issues

Thoughts ?

Regards,
Marcus
--
Public Key available via: https://keybase.io/marcus_schaefer/key.asc
keybase search marcus_schaefer
-------------------------------------------------------
Marcus Schäfer (Res. & Dev.) SUSE Software Solutions Germany GmbH
Tel: 0911-740 53 0 Maxfeldstrasse 5
FAX: 0911-740 53 479 D-90409 Nürnberg
HRB: 21284 (AG Nürnberg) Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
http://www.suse.de
-------------------------------------------------------
signature.asc

Michael Cartwright

unread,
Nov 8, 2021, 5:55:17 PM11/8/21
to kiwi
Hi Marcus,

I'm revisiting this discussion to inquire whether or not something like this has been implemented/requested in the past year since I mentioned it...?
I was just about to open an enhancement issue for this in github, but I figured I'd quickly ask if that would still be required, or if something like this has already been implemented and I just haven't taken enough kiwi updates yet to notice.

Thanks,
-Mike
Reply all
Reply to author
Forward
0 new messages