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

opkg: --autoremove exits with error if dependencies are duplicated #12241

Open
1 task done
jefferyto opened this issue Mar 22, 2023 · 0 comments
Open
1 task done

opkg: --autoremove exits with error if dependencies are duplicated #12241

jefferyto opened this issue Mar 22, 2023 · 0 comments
Labels
bug issue report with a confirmed bug

Comments

@jefferyto
Copy link
Member

Describe the bug

opkg remove --autoremove can exit with an error even when all packages were removed successfully:

root@OpenWrt:~# opkg remove bmon --autoremove
Removing package bmon from root...
libncurses6 was autoinstalled and is now orphaned, removing.
Removing package libncurses6 from root...
terminfo was autoinstalled and is now orphaned, removing.
Removing package terminfo from root...
libnl-route200 was autoinstalled and is now orphaned, removing.
Removing package libnl-route200 from root...
libnl-core200 was autoinstalled and is now orphaned, removing.
Removing package libnl-core200 from root...
confuse was autoinstalled and is now orphaned, removing.
Removing package confuse from root...
No packages removed.
root@OpenWrt:~# echo $?
255

This is because bmon depends on libncursesw (libncurses6) and terminfo, and libcurses6 also depends on terminfo. opkg will try to remove terminfo twice, and the second attempt will result in an error because the package was already removed by the first attempt.

OpenWrt version

r22307-4bfbecbd9a

OpenWrt target/subtarget

armvirt/32

Device

linux,dummy-virt

Image kind

Official downloaded image

Steps to reproduce

No response

Actual behaviour

No response

Expected behaviour

No response

Additional info

No response

Diffconfig

No response

Terms

  • I am reporting an issue for OpenWrt, not an unsupported fork.
@jefferyto jefferyto added the bug issue report with a confirmed bug label Mar 22, 2023
jefferyto added a commit to jefferyto/openwrt-packages that referenced this issue Mar 22, 2023
836b4e1 added
--force-removal-of-dependent-packages but it does not do what the commit
message says it does.

When package A depends on package B (package B is a dependency of
package A; package A is a dependent of package B), trying to remove
package B while package A is installed will result in an error. Adding
--force-removal-of-dependent-packages in this case will cause the
removal of package B and package A (package B's dependent).

But in the case of the CI testing step, it is package A that is being
installed and removed. Removing package A with
--force-removal-of-dependent-packages will not cause package B (package
A's dependency) to be removed.

This adds --autoremove to actually remove the package's dependencies.

This also ignores any errors returned by opkg remove as --autoremove can
sometimes falsely return an error[1].

[1]: openwrt/openwrt#12241

Fixes: 836b4e1 ("github-ci: add --force-removal-of-dependent-packages")
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
PolynomialDivision pushed a commit to PolynomialDivision/routing that referenced this issue Jun 12, 2023
836b4e1 added
--force-removal-of-dependent-packages but it does not do what the commit
message says it does.

When package A depends on package B (package B is a dependency of
package A; package A is a dependent of package B), trying to remove
package B while package A is installed will result in an error. Adding
--force-removal-of-dependent-packages in this case will cause the
removal of package B and package A (package B's dependent).

But in the case of the CI testing step, it is package A that is being
installed and removed. Removing package A with
--force-removal-of-dependent-packages will not cause package B (package
A's dependency) to be removed.

This adds --autoremove to actually remove the package's dependencies.

This also ignores any errors returned by opkg remove as --autoremove can
sometimes falsely return an error[1].

[1]: openwrt/openwrt#12241

Fixes: 836b4e1 ("github-ci: add --force-removal-of-dependent-packages")
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
PolynomialDivision pushed a commit to PolynomialDivision/routing that referenced this issue Jun 12, 2023
836b4e1 added
--force-removal-of-dependent-packages but it does not do what the commit
message says it does.

When package A depends on package B (package B is a dependency of
package A; package A is a dependent of package B), trying to remove
package B while package A is installed will result in an error. Adding
--force-removal-of-dependent-packages in this case will cause the
removal of package B and package A (package B's dependent).

But in the case of the CI testing step, it is package A that is being
installed and removed. Removing package A with
--force-removal-of-dependent-packages will not cause package B (package
A's dependency) to be removed.

This adds --autoremove to actually remove the package's dependencies.

This also ignores any errors returned by opkg remove as --autoremove can
sometimes falsely return an error[1].

[1]: openwrt/openwrt#12241

Fixes: 836b4e1 ("github-ci: add --force-removal-of-dependent-packages")
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
PolynomialDivision pushed a commit to PolynomialDivision/routing that referenced this issue Jun 13, 2023
836b4e1 added
--force-removal-of-dependent-packages but it does not do what the commit
message says it does.

When package A depends on package B (package B is a dependency of
package A; package A is a dependent of package B), trying to remove
package B while package A is installed will result in an error. Adding
--force-removal-of-dependent-packages in this case will cause the
removal of package B and package A (package B's dependent).

But in the case of the CI testing step, it is package A that is being
installed and removed. Removing package A with
--force-removal-of-dependent-packages will not cause package B (package
A's dependency) to be removed.

This adds --autoremove to actually remove the package's dependencies.

This also ignores any errors returned by opkg remove as --autoremove can
sometimes falsely return an error[1].

[1]: openwrt/openwrt#12241

Fixes: 836b4e1 ("github-ci: add --force-removal-of-dependent-packages")
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
PolynomialDivision pushed a commit to openwrt/routing that referenced this issue Jun 26, 2023
836b4e1 added
--force-removal-of-dependent-packages but it does not do what the commit
message says it does.

When package A depends on package B (package B is a dependency of
package A; package A is a dependent of package B), trying to remove
package B while package A is installed will result in an error. Adding
--force-removal-of-dependent-packages in this case will cause the
removal of package B and package A (package B's dependent).

But in the case of the CI testing step, it is package A that is being
installed and removed. Removing package A with
--force-removal-of-dependent-packages will not cause package B (package
A's dependency) to be removed.

This adds --autoremove to actually remove the package's dependencies.

This also ignores any errors returned by opkg remove as --autoremove can
sometimes falsely return an error[1].

[1]: openwrt/openwrt#12241

Fixes: 836b4e1 ("github-ci: add --force-removal-of-dependent-packages")
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
PolynomialDivision pushed a commit to PolynomialDivision/routing that referenced this issue Jun 26, 2023
836b4e1 added
--force-removal-of-dependent-packages but it does not do what the commit
message says it does.

When package A depends on package B (package B is a dependency of
package A; package A is a dependent of package B), trying to remove
package B while package A is installed will result in an error. Adding
--force-removal-of-dependent-packages in this case will cause the
removal of package B and package A (package B's dependent).

But in the case of the CI testing step, it is package A that is being
installed and removed. Removing package A with
--force-removal-of-dependent-packages will not cause package B (package
A's dependency) to be removed.

This adds --autoremove to actually remove the package's dependencies.

This also ignores any errors returned by opkg remove as --autoremove can
sometimes falsely return an error[1].

[1]: openwrt/openwrt#12241

Fixes: 836b4e1 ("github-ci: add --force-removal-of-dependent-packages")
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 53a53b8)
jefferyto added a commit to jefferyto/openwrt-video that referenced this issue Jul 18, 2023
836b4e1c734f9705bfd8db0da0c04214c2647932 added
--force-removal-of-dependent-packages but it does not do what the commit
message says it does.

When package A depends on package B (package B is a dependency of
package A; package A is a dependent of package B), trying to remove
package B while package A is installed will result in an error. Adding
--force-removal-of-dependent-packages in this case will cause the
removal of package B and package A (package B's dependent).

But in the case of the CI testing step, it is package A that is being
installed and removed. Removing package A with
--force-removal-of-dependent-packages will not cause package B (package
A's dependency) to be removed.

This adds --autoremove to actually remove the package's dependencies.

This also ignores any errors returned by opkg remove as --autoremove can
sometimes falsely return an error[1].

[1]: openwrt/openwrt#12241

Fixes: 836b4e1c734f ("github-ci: add --force-removal-of-dependent-packages")
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
BKPepe pushed a commit to openwrt/routing that referenced this issue Sep 1, 2023
836b4e1 added
--force-removal-of-dependent-packages but it does not do what the commit
message says it does.

When package A depends on package B (package B is a dependency of
package A; package A is a dependent of package B), trying to remove
package B while package A is installed will result in an error. Adding
--force-removal-of-dependent-packages in this case will cause the
removal of package B and package A (package B's dependent).

But in the case of the CI testing step, it is package A that is being
installed and removed. Removing package A with
--force-removal-of-dependent-packages will not cause package B (package
A's dependency) to be removed.

This adds --autoremove to actually remove the package's dependencies.

This also ignores any errors returned by opkg remove as --autoremove can
sometimes falsely return an error[1].

[1]: openwrt/openwrt#12241

Fixes: 836b4e1 ("github-ci: add --force-removal-of-dependent-packages")
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 53a53b8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue report with a confirmed bug
Projects
None yet
Development

No branches or pull requests

1 participant