Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

[Bug] ./scripts/dev_setup.sh misidentified package manager #137

Closed
jiangying000 opened this issue May 14, 2022 · 1 comment · Fixed by #146
Closed

[Bug] ./scripts/dev_setup.sh misidentified package manager #137

jiangying000 opened this issue May 14, 2022 · 1 comment · Fixed by #146
Labels
bug Something isn't working

Comments

@jiangying000
Copy link
Contributor

jiangying000 commented May 14, 2022

🐛 Bug

running ./scripts/dev_setup.sh on my ubuntu, the script identified yum as package manager

because somebody installed yum on the shared ubuntu server, the script misidentified the package manager.

screenshot:
image

@jiangying000 jiangying000 added the bug Something isn't working label May 14, 2022
@jiangying000
Copy link
Contributor Author

move/scripts/dev_setup.sh

Lines 148 to 153 in 1a0214a

echo "Installing ${package}."
if [[ "$PACKAGE_MANAGER" == "yum" ]]; then
"${PRE_COMMAND[@]}" yum install "${package}" -y
elif [[ "$PACKAGE_MANAGER" == "apt-get" ]]; then
"${PRE_COMMAND[@]}" apt-get install "${package}" --no-install-recommends -y
echo apt-get install result code: $?

current scripts/dev_setup.sh identifies binary programs, may be it's more accurate to identify distributions, like:

declare -A osInfo;
osInfo[/etc/redhat-release]=yum
osInfo[/etc/arch-release]=pacman
osInfo[/etc/gentoo-release]=emerge
osInfo[/etc/SuSE-release]=zypp
osInfo[/etc/debian_version]=apt-get
osInfo[/etc/alpine-release]=apk

for f in ${!osInfo[@]}
do
    if [[ -f $f ]];then
        echo Package manager: ${osInfo[$f]}
    fi
done

see also:
https://unix.stackexchange.com/questions/46081/identifying-the-system-package-manager

@wrwg wrwg closed this as completed in #146 May 18, 2022
brson pushed a commit to brson/move that referenced this issue May 11, 2023
This patch adds support for address and a few LLVM bits to
support it. Each address is represented in a target agnostic way
as an LLVM [AccountAddress::LENGTH x i8] array.
brson pushed a commit to brson/move that referenced this issue Jul 17, 2023
This patch adds support for address and a few LLVM bits to
support it. Each address is represented in a target agnostic way
as an LLVM [AccountAddress::LENGTH x i8] array.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
1 participant