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

Adding better support for opkg #70

Open
jseifeddine opened this issue Feb 13, 2024 · 0 comments
Open

Adding better support for opkg #70

jseifeddine opened this issue Feb 13, 2024 · 0 comments

Comments

@jseifeddine
Copy link

jseifeddine commented Feb 13, 2024

We are trying to install packages via their .ipk - for offline package installations

Ensuring that the list of dependencies is properly organized to meet the required order of installation.

What this tries to resolve is the following

    - opkg:
        name: "/tmp/snmp/libpcre_8.45-1_mips_24kc.ipk"
        state: present
        force: overwrite

Basically, it installs fine, but the module always returns fail, as it is doing:

opkg status /tmp/snmp/libpcre_8.45-1_mips_24kc.ipk

As per:

query_package() {
    [ -n "$(opkg status "$1")" ]
}

So to make it "work" - I modified install_packages() function inside library/openwrt_opkg.sh like so:

install_packages() {
    local _IFS pkg pkg_name install_output
    _IFS="$IFS"; IFS=","; set -- $name; IFS="$_IFS"
    for pkg; do
        pkg_name="$pkg"
        if [[ "$pkg" == *.ipk ]]; then
            pkg_name=$(basename "$pkg" .ipk | sed -r 's/_.*//')
        fi
        ! query_package "$pkg_name" || continue
        [ -n "$_ansible_check_mode" ] || {
            try opkg install$force $nodeps "$pkg"
            query_package "$pkg_name" || fail "failed to install $pkg: $_result"
        }
        changed
    done
}

Anyway, this is working well now, installing and returning OK if installed already, changed if it's really changed etc...

@gekmihesg seems to be AWOL

bit of a shame 😞

great repo

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

No branches or pull requests

1 participant