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

luci-app-package-manager: rename from luci-app-opkg and add APK support #7341

Closed
wants to merge 3 commits into from

Conversation

Ansuel
Copy link
Member

@Ansuel Ansuel commented Oct 22, 2024

Rename luci-app-opkg to luci-app-ipkg and add APK support for it.

The idea is to adapt APK to mimic OPKG output to require minimal changes
to the luci app.

Signed-off-by: Christian Marangi ansuelsmth@gmail.com


@jow- @aparcar @hauke

TODO:

  • Config handling
  • Test install/remove
  • Test update scenario
  • Handle --autoremove
  • Handle --force-overwrite
  • Handle --force-removal-of-dependent-packages

What works:

  • List packages
  • Update package list

Depends on:
openwrt/openwrt#16759

Fix passing wrong option on opkg update/install. While starting to
introduce support for APK in the opkg module, it was notice that
--force-removal-of-dependent-packages was always passed even with update
and install command.

This was probably a leftover/oversight of old one. To fix this, limit
this option only on remove and also update the acl.d to support single
call to update or install.

Fixes: 9b25031 ("luci-app-opkg: rework backend operations")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
@systemcrash
Copy link
Contributor

Does this mean all rpc calls or otherwise to opkg must be updated?

@stangri
Copy link
Member

stangri commented Oct 22, 2024

Rename luci-app-opkg to luci-app-ipkg and add APK support for it.

Why luci-app-ipkg? Why not luci-app-pkg-manager/luci-app-package-manager for example?

@systemcrash
Copy link
Contributor

@stangri

Why luci-app-ipkg? Why not luci-app-pkg-manager/luci-app-package-manager for example?

standard naming convention ig.

@Ansuel
Copy link
Member Author

Ansuel commented Oct 23, 2024

Does this mean all rpc calls or otherwise to opkg must be updated?

all rpc calls -> none

OPKG is enough sensible to wrap it in helper script and we already minimize it to just opkg-call script hence it's all handled there, we don't call opkg directly. But would love some comments by jow confirming this.

@Ansuel
Copy link
Member Author

Ansuel commented Oct 23, 2024

Rename luci-app-opkg to luci-app-ipkg and add APK support for it.

Why luci-app-ipkg? Why not luci-app-pkg-manager/luci-app-package-manager for example?

yes can be an idea but for sure the name needs to be changed to something more generic.

@hnyman
Copy link
Contributor

hnyman commented Oct 23, 2024

+1 for a clear name that is also understandable by newcomers.

luci-app-packagemanager would be my favorite

@lorand-horvath
Copy link

luci-app-opm - short for Openwrt Package Manager

luci-app-pm - even shorter

@castillofrancodamian
Copy link
Contributor

+1 for a clear name that is also understandable by newcomers.

luci-app-packagemanager would be my favorite

Or luci-app-package-manager. I like it better.

Add APK as detectable feature so that generic luci-app-pkg can detect
OPKG or APK package manager.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
@systemcrash
Copy link
Contributor

Full names tend to serve better than ambiguous acronyms and abbreviations for first-timers.

I like luci-app-package-manager

@Ansuel Ansuel force-pushed the wip-apk-luci branch 2 times, most recently from 246635b to e0c6c17 Compare October 23, 2024 20:53
@Ansuel Ansuel changed the title luci-app-ipkg: rename from luci-app-opkg and add APK support luci-app-package-manager: rename from luci-app-opkg and add APK support Oct 23, 2024
Rename luci-app-opkg to luci-app-package-manager and add APK support for it.

The idea is to adapt APK to mimik OPKG output to require minimal changes
to the luci app.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
@Ansuel Ansuel marked this pull request as ready for review October 23, 2024 20:58
@Ansuel
Copy link
Member Author

Ansuel commented Oct 23, 2024

Actually this went pretty fast... Should be finished... Maybe the po file needs some bit of touchup...

@systemcrash
Copy link
Contributor

systemcrash commented Oct 23, 2024

@Ansuel

build/i18n-sync.sh applications/luci-app-package-manager

@systemcrash
Copy link
Contributor

Closed by bcd13b9

@@ -1133,7 +1146,7 @@ return view.extend({
E('h2', {}, _('Software')),

E('div', { 'class': 'cbi-map-descr' }, [
E('span', _('Install additional software and upgrade existing packages with opkg.')),
E('span', _('Install additional software and upgrade existing packages with %s.').format(L.hasSystemFeature('apk') ? 'apk' : 'opkg')),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to replace the opkg in the existing translation keys to not lost them.
But I would rather simplify the sentence to Install additional software and upgrade existing packages

E('button', { 'class': 'btn cbi-button-action', 'click': handleUpload, 'disabled': isReadonlyView }, [ _('Upload Package…') ]), ' ',
E('button', { 'class': 'btn cbi-button-neutral', 'click': handleConfig }, [ _('Configure opkg') ])
E('button', { 'class': 'btn cbi-button-neutral', 'click': handleConfig }, [ _('Configure %s').format(L.hasSystemFeature('apk') ? 'apk' : 'opkg') ])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the APK also has a plain text config file?
For the opkg we have a window OPKG Configuration with many options that shouldn't be same with APT.

Maybe this can be also simplified to just Configure…

@@ -0,0 +1,387 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(just a wish) It would be great to have a separate commit with the file rename and then with changing of keys to easily see the diff


#: applications/luci-app-ipkg/htdocs/luci-static/resources/view/package_manager.js:878
msgid ""
"Below is a listing of the various configuration files used by <em>ipkg</em>. "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ipkg or opkg?


json_init
json_add_int code $code
[ -n "$stdout" ] && json_add_string stdout "$stdout"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can simplify this and always add the field even if empty i.e. just json_add_string stdout "$stdout"

fi
;;
install|update|remove)
(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so big subshell, maybe it's possible to extract a function here?

@stokito
Copy link
Contributor

stokito commented Oct 23, 2024

I added some minor comments, you may ignore them since it's merged

@Ansuel
Copy link
Member Author

Ansuel commented Oct 23, 2024

@stokito thanks for the comments I will take care of fixing them

@systemcrash
Copy link
Contributor

Yo @Ansuel can this get cherry-picked to 23 or is there stuff it requires from master?

@Ansuel
Copy link
Member Author

Ansuel commented Oct 25, 2024

not at all... 23 doesn't even have working apk. Why should we backport?

@systemcrash
Copy link
Contributor

Ah, maybe I can just take the useful fix from #7340 to 23?

@Ansuel
Copy link
Member Author

Ansuel commented Oct 25, 2024

@systemcrash yep that was why it was in a dedicated commit :D

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

Successfully merging this pull request may close these issues.

7 participants