-
Notifications
You must be signed in to change notification settings - Fork 94
packager: fetch glibc corresponding to the host architecture on debian multiarch #126
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
Conversation
@@ -66,14 +65,16 @@ function package_libc_via_pacman { | |||
|
|||
function package_libc_via_dpkg() { | |||
if type dpkg-query > /dev/null 2>&1; then | |||
if [[ $(dpkg-query --listfiles libc6 | wc -l) -gt 0 ]]; then | |||
dpkg-query --listfiles libc6 | sed -E '/\.so$|\.so\.[0-9]+$/!d' | |||
architecture=$(dpkg --print-architecture) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added Arch Linux support in the packager the other day, and I switched to using uname -m
for checking the system architecture for rpm-based distros.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't work on Debian though:
$ uname -m
x86_64
$ dpkg --print-architecture
amd64
Using x86_64
as the architecture does not work with dpkg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, interesting.
And I just took a look with a fedora image from docker hub, and it turns out arch
comes with coreutils
on some distros:
$ arch --help
Usage: arch [OPTION]...
Print machine architecture.
--help display this help and exit
--version output version information and exit
GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Report any translation bugs to <https://translationproject.org/team/>
Full documentation <https://www.gnu.org/software/coreutils/arch>
or available locally via: info '(coreutils) arch invocation'
And the docs say:
arch
prints the machine hardware name, and is equivalent touname -m
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to give you a heads up, I just opened PR #136, which has some simplifications in the same area as this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description of changes:
This is a Debian version of PR #120. Many Debian machines have both amd64 and i386 (64 and 32 bit x86-64) installed. When "dpkg-query --listfiles libc6" is run, dpkg doesn't know which package it's referring to:
The main page for more information on MultiArch is https://wiki.debian.org/Multiarch .
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.