-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add wrapper for package manipulation #320
base: main
Are you sure you want to change the base?
Conversation
@dimitry-ishenko This could be use to consolidate and refine or replace some of the following. Your idea is a good.
Reference for helper function naming standards,
or
|
Thanks @Tearran. Are you suggesting to rename the file (ie, By the standard it would have to be something like:
IMHO these are a bit less natural, but if that's what we gotta do, then that's what we gotta do. |
Just the function name the prefix is used to separate groups. So if this is a module use module_ if it's a helper to be used with a module see_ set_ even etc.. This I would consider both so your call but only one prefix name. We can even refine and define new prefix to clarify things. We do have "generate_" , Perhaps, "helper_" "manage_". |
TBH none of the prefixes really fit here... How about adding a
or
Please see 👇🏻 |
ed41196
to
46b5412
Compare
46b5412
to
6bbd82e
Compare
6bbd82e
to
e69f563
Compare
package_ should work well. although IMO pkg_ fits the 3 letter prefix better, but that is unimportant ;) would also suggest simply "check" or "status" for the is_installed.
Quick fix : "Disabled" or ""
If you don't mind helping refine module_option. Reference: configng/tools/config-assemble.sh Line 158 in 0a257fd
&&
I think we can leverage this to define what the function is.
For modules it would be. System, Network, Localization, Software. and any other category that may be needed at later date. |
Great idea, I will change it to |
I am still getting a feel for what does what, where and how 😃 but I can take a look. |
@Tearran should I keep the name of the file as |
no standard set, as for the logic it is inconsequential, so snakecase "any_name_will_do.sh" configng/tools/config-assemble.sh Line 26 in 0a257fd
Software does set a president as it uses the prefix "install_" |
@dimitry-ishenko in short code wise currently it does not matter can leave it if you like. But :) this is a good place to clarify, and refine existing precedent for consistency. tested all works with
precedent https://github.com/armbian/configng/blob/main/tools/modules/functions/interface_menu.sh Note : The |
7188227
to
45b2e10
Compare
a4087db
to
c697dc6
Compare
This should be ready to go. I've opted for
|
c697dc6
to
f71a78a
Compare
@Tearran currently there is no differentiation between the menu and the "--api")
shift
if [[ -z "$1" || "$1" == "help" ]]; then
see_use
exit 0
fi
option="$1" shift
args=$(sanitize_input "$@")
# echo -e "\"$option\" \"$args\""
- "$option" "$args"
+ "$option" "$args" <&-
exit 0
;; |
a5de88e
to
629a58e
Compare
3472f94
to
f78c68d
Compare
99ef7ef
to
82e6dc0
Compare
@igorpecovnik IMO nice improvements ready to go, any option? |
Sorry for tuning in late. I was busy in other segments those days ... Great work! I would remove function tools/modules/functions/check_if_installed.sh right away so we don't drag it along anymore if its not used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it was replaced everywhere - in this case, free to merge.
@igorpecovnik I've removed both deprecated functions, but it looks like I need another review before I can merge. |
@dimitry-ishenko would have pushed this but, Something in the Unit tests broke. |
What do you guys think about abstracting away package installation and removal?
This will help add consistency and reduce boilerplate. Usage is as follows:
This will also replace
check_if_installed
andapt_install_wrapper
commands.