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

eos_bootloader: installing packages from ISO if installing packages from REPO crashed #27

Open
Valeria-Fadeeva opened this issue Nov 5, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Valeria-Fadeeva
Copy link

Valeria-Fadeeva commented Nov 5, 2023

if package not in repo or crash

file: src/modules/eos_bootloader/main.py

    # install packages
    if offline:
        package_files = get_local_packages(packages)
        if package_files is not None:
            try:
                libcalamares.utils.target_env_process_output(["pacman", "--noconfirm", "-U"] + package_files)
            except subprocess.CalledProcessError as cpe:
                return f"Failed to install packages for {bootloader_name}", f"The install failed with error: {cpe.stderr}"
    else:
        if packages is not None:
            try:
                libcalamares.utils.target_env_process_output(["pacman", "--noconfirm", "-S"] + packages)
            except subprocess.CalledProcessError as cpe:
                return f"Failed to install packages for {bootloader_name}", f"The install failed with error: {cpe.stderr}"

replace

    # install packages
    if offline:
        package_files = get_local_packages(packages)
        if package_files is not None:
            try:
                libcalamares.utils.target_env_process_output(["pacman", "--noconfirm", "--needed", "-U"] + package_files)
            except subprocess.CalledProcessError as cpe:
                return f"Failed to install packages for {bootloader_name}", f"The install failed with error: {cpe.stderr}"
    else:
        if packages is not None:
            try:
                libcalamares.utils.target_env_process_output(["pacman", "--noconfirm", "--needed", "-S"] + packages)
            except subprocess.CalledProcessError as cpe:
                package_files = get_local_packages(packages)
                if package_files is not None:
                    try:
                        libcalamares.utils.target_env_process_output(["pacman", "--noconfirm", "--needed", "-U"] + package_files)
                    except subprocess.CalledProcessError as cpe:
                        return f"Failed to install packages for {bootloader_name}", f"The install failed with error: {cpe.stderr}"
@dalto8
Copy link

dalto8 commented Nov 5, 2023

This isn't really something that could ever happen in our installer the way we use this module.

If it would help you to add support for that, I don't have a problem with adding it. I think in that case it would be be better to broadly refactor it so it has better handling for non-repo packages during an online install.

I would warn you that installing offline packages during an online install may carry some risk as the package you are installing could be out-of-date with the repos at the point of the install.

Either way, it would probably not come until after our upcoming release though.

@dalto8 dalto8 added the enhancement New feature or request label Nov 5, 2023
@Valeria-Fadeeva
Copy link
Author

Yes, i want =).
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants