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

DietPi-Software | Rework dependency and choice system #4314

Merged
merged 44 commits into from
May 17, 2021
Merged

Conversation

ravenclaw900
Copy link
Collaborator

@ravenclaw900 ravenclaw900 commented Apr 28, 2021

Status: Testing

  • Migrate all software to use new system
  • Add dummy IDs for webserver/desktop/browser EDIT: Not used anymore. Another way to resolve such meta dependencies has been implemented.
  • Add own Firefox install option
  • Add browser meta dependency, used by desktops
  • Add desktop default menu
  • Add browser default menu

Reference: #3921 (comment)

Commit list/description:

  • DietPi-Software | Begin to rework dependency system
  • DietPi-Software | Begin to switch to new system

Init v7.2
+ DietPi-Software | Begin to rework dependency system
@ravenclaw900 ravenclaw900 added the Coding 📑 Improving code stability, performance and consistancy label Apr 28, 2021
@ravenclaw900 ravenclaw900 added this to the v7.2 milestone Apr 28, 2021
@ravenclaw900 ravenclaw900 requested a review from MichaIng April 28, 2021 23:41
@ravenclaw900 ravenclaw900 self-assigned this Apr 28, 2021
ravenclaw900 and others added 8 commits April 28, 2021 19:20
+ DietPi-Software | Fix loop
+ DietPi-Software | Fix array and conditional
+ DietPi-Software | Begin to switch to new system
+ DietPi-Software | Add missing !
+ DietPi-Software | Remove $
+ Attempt to resolve merge conflict
+ Attempt to resolve merge conflict
+ META | Update "dependencies" branch
@MichaIng
Copy link
Owner

Awesome start with this, many thanks!

  • We can corporate all this "Software that requires XYZ"/"Software required by XYZ" stuff as well.
  • For webserver and desktop, I through about some kind of "OR" operator. But in case of webserver, it needs to be handled specially anyway to respect the preference system. And I want a desktop preference menu as well, as currently LXDE is always chosen, if no desktop is installed or selected but required. Same could follow for browsers, after making Firefox an own install option. We could add a dummy webserver and desktop software ID. In the loop we then check the these IDs specifically to handle them, e.g. in a different function to keep it clean, which basically changes the $j ID based on the preference. An important difference for those is that webservers and desktops are never reinstalled (< 1), while all other dependencies are (!= 1). We should keep that behaviour for now until we're able to rework them to not overwrite existing configs.
  • And we need to do the loop incrementally. My idea was to make inner dependency loop for j in "${aSOFTWARE_REQUIRES[@]}" an own function with the current outer loop software ID as input, which continues, if a dependency is already set to 1, else calls itself with the current dependency as input. The == 1 )) && continue is important then to avoid unlimited nesting.

dietpi/dietpi-software Outdated Show resolved Hide resolved
@ravenclaw900
Copy link
Collaborator Author

We could add a dummy webserver and desktop software ID.

What about automated upgrades and user input?

+ DietPi-Software | Switch built-in dependencies to new system
+ DietPi-Software | Update showings in list
+ DietPi-Software | Fix spacing
+ DietPi-Software | Rename git
+ DietPi-Software | Add Resolve_Dependencies function
+ DietPi-Software | Fix loop
+ DietPi-Software | Make all software use new dependency system
+ DietPi-Software | Add dependencies for webserver stacks
+ DietPi-Software | CodeFactor fixes
+ DietPi-Software | Add Firefox and Lynx web browsers as own install options
+ DietPi-Software | Add dummy software IDs
@MichaIng MichaIng changed the title DietPi-Software | Rework DietPi-Software dependency system DietPi-Software | Rework dependency and choice system May 14, 2021
MichaIng added 4 commits May 14, 2021 21:29
+ DietPi-Survey_report | Add support for Firefox with v7.2 and remove DietPi-NordVPN, forgotten with v7.1
+ README | Add Firefox source code to 3rd party links
+ DietPi-Software | Start implementing desktop and browser preference system
+ DietPi-Software | WiFi/Tor HotSpot: When HotSpot criteria are not fulfilled, only unmark "to be installed" mark (1) but do not mark "already installed" mark, e.g. when a hotspot has been set but the adapter temporarily unplugged or connection issue.
+ DietPi-Software | Use aSOFTWARE_NAME[<ID>] variable where possible instead of hardcoded name in menus
+ DietPi-Software | Minor coding
+ DietPi-Software | Apply desktop and browser preference via dependency system
+ DietPi-Software | Explain preference systems in initial selection menu instead of in another separate prompt
+ DietPi-Software | Fix Nginx install detection when selecting a webserver preference: We install nginx-light and there would be nginx-full and nginx-extra as well, all providing the "nginx" meta package. Check for nginx-common, which is pulled by all of them.
+ DietPi-Software | Fix docs links from help prompt
+ DietPi-Software | Minor coding
@MichaIng MichaIng linked an issue May 16, 2021 that may be closed by this pull request
+ DietPi-Software | Syntax
@MichaIng MichaIng linked an issue May 16, 2021 that may be closed by this pull request
+ DietPi-Software | Syntax
@MichaIng MichaIng requested a review from Joulinar May 16, 2021 18:46
@MichaIng
Copy link
Owner

So far so good. Ready for testing and review. First install test with XRDP, Xfce an "no" browser preference. X server + ALSA and those preferences are selected correctly.

MichaIng added 3 commits May 16, 2021 21:04
+ DietPi-Software | Fix disabling dietpi-desktop_setup: dash's echo does not support the "-e" option but expands escape sequences automatically
+ DietPi-Patches | Fix disabling dietpi-desktop_setup
+ dietpi.txt | Add desktop and browser preference settings and enhance explanation of such preferences which are only installed when another software requires it
@Joulinar
Copy link
Collaborator

do we need to check other software title who have dependency as well?

+ DietPi-Software | Respect new dietpi.txt settings for desktop and browser preferences and apply intended default when the webserver preference setting is missing
+ DietPi-Software | Apply preference indices when related software title is installed to avoid the situation that e.g. Xfce is manually installed but LXDE still shown as desktop preference.
@MichaIng
Copy link
Owner

It doesn't hurt to test others, just to verify the general functionality of this dependency system.

+ DietPi-Software | Enhance final install prompt a bit
@Joulinar
Copy link
Collaborator

Joulinar commented May 16, 2021

ok I did 3 basic checks

  1. NextCloud - all dependency installed as expected
  2. XRDP with LXDE and Chromium - all dependency installed as expected
  3. Docker-Compose + Portainer - all dependency installed as expected

MichaIng added 3 commits May 16, 2021 23:30
+ DietPi-Software | Typo
+ DietPi-Software | Do not print software list in lower case and somehow formatted letters anymore, there is no real reason for this
+ DietPi-Software | Rename "X Server" back to "X.Org X Server" as this does not imply issues with CLI list print anymore. Leave "Git" renamed from "Git Client", as there is not really a separation. The "git" package and command can act as both, respectively a local Git repository can be accessed like a server as well.
+ DietPi-Software | Try to make pretty clear that webserver/desktop/browser preferences will "only" be installed when another selection depends on it.
@MichaIng
Copy link
Owner

Great, I also ran a few tests installs and reinstalls and added some debug output to all parts of the loop. It works pretty well as expected 💯. I'll add the changelogs and merge it then.

+ CHANGELOG | DietPi-Software: A desktop preference choice has been added. Before first boot via new dietpi.txt AUTO_SETUP_DESKTOP_INDEX setting or with the new menu entry it can be now chosen which desktop to install when another software selection requires one, especially remote desktop solutions. It works like the webserver preference, so it only play a role when a desktop is installed as dependency and is overridden by manual desktop selections.
+ CHANGELOG | DietPi-Software: A browser preference choice has been added. Before first boot via new dietpi.txt AUTO_SETUP_BROWSER_INDEX setting or with the new menu entry it can be now chosen whether and which browser to install automatically together with desktops. Previously Firefox was installed with every desktop. It only plays a role when a desktop is installed and is overridden by manual browser selections. With this change, Firefox has become an independent software option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Coding 📑 Improving code stability, performance and consistancy Feature request 🏭
Projects
None yet
3 participants