Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch-nspawn: Generalize mirrorlist sed arch and repo variable replacement #54

Closed

Conversation

tylerjl
Copy link

@tylerjl tylerjl commented Nov 22, 2020

The host_mirrors value uses a sed pattern that is closely coupled with the mirror URL pattern in-use by most Arch mirrors. For some variants, like Arch Linux ARM, values such as $repo and $arch sit in other parts in the mirror path. This change makes the sed replacement more generic to accommodate for variations in mirrorlist URLs while remaining backward compatible.

I ran into this when trying to use some downstream tools that rely on arch-nspawn (aurutils) and these changes seem to resolve things for my aarch64 and armv7 hosts.

The host_mirrors value uses a sed pattern that is closely coupled with
the mirror URL pattern in-use by most Arch mirrors. For some variants,
like Arch Linux ARM, values such as $repo and $arch sit in other parts
in the mirror path. This change makes the sed replacement more generic
to accomodate for variations in mirrorlist URLs while remaining backward
compatible.

if (( ${#cache_dirs[@]} == 0 )); then
mapfile -t cache_dirs < <($pacconf_cmd --config "${pac_conf:-$working_dir/etc/pacman.conf}" CacheDir)
fi

# shellcheck disable=2016
host_mirrors=($($pacconf_cmd --repo extra Server 2> /dev/null | sed -r 's#(.*/)extra/os/.*#\1$repo/os/$arch#'))
host_mirrors=($($pacconf_cmd --repo extra Server 2> /dev/null | sed -r 's#'"${pacconf_arch}"'#$arch#;s#extra#$repo#'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a problem here: what about mirror url containing word extra somewhere beside last path element 😕

@klausenbusk
Copy link
Member

devtools has been migrated to our GitLab, closing..

Migrated to: https://gitlab.archlinux.org/archlinux/devtools/-/merge_requests/54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants