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

Add package finalize in addition to global finalize #312

Open
msdobrescu opened this issue Dec 1, 2022 · 1 comment
Open

Add package finalize in addition to global finalize #312

msdobrescu opened this issue Dec 1, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@msdobrescu
Copy link

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

On the path /var/luet/db/repos/mocaccino-community/treefs/apps/xemacs/21.4.24-r5+6/finalize.yaml, for example, there is a copy of the mocaccino-community repo finalize.yaml.

Needing specific ops at finalization for a specific package, I have added code in the finalize.yaml of the collection (in C-R: /community-repository/packages/apps/finalize.yaml). Generally, it's like this:

install:

{{ range .Values.requires | uniq }}
  {{ if or (eq .name "X") (eq .name "gnome-common") (eq .name "gnome") }}
- glib-compile-schemas /usr/share/glib-2.0/schemas > /dev/null 2>&1
  {{ end }}
{{ end }}
- update-mime-database /usr/share/mime/
- ldconfig
{{ range .Values.requires | uniq }}
- env-update && source /etc/profile
{{ end }}

But for emacs or xemacs only, I add to the same file:

{{ if and (eq .Values.category "apps") (or (eq .Values.name "emacs") (eq .Values.name "xemacs")) }}
- eselect ctags update ifunset
{{ end }}
{{ if and (eq .Values.category "apps") (eq .Values.name "xemacs") }}
- eselect gnuclient update ifunset
{{ end }}

This entire thing goes to every package now, in /var/luet/db/repos/mocaccino-community/treefs/apps/<name>/<version>/finalize.yaml, regardless the package.
What I would do? How I would prefer?

  1. Keep the first part as global (as before emacs)
  2. Add the second part to the package setup and end up this finalization to the package only:
- &apps-xemacs
  category: "apps"
  name: "xemacs"
  version: "21.4.24-r5+7"
...
finalize:
- glib-compile-schemas /usr/share/glib-2.0/schemas > /dev/null 2>&1
- env-update && source /etc/profile

That would be copied in /var/luet/db/repos/mocaccino-community/treefs/apps/xemacs/21.4.24-r5+6/finalize.yaml, at the end of the install section for that very package only, right after the global finalize.yaml install section content.

Describe alternatives you've considered

Additional context

@msdobrescu msdobrescu added the enhancement New feature or request label Dec 1, 2022
@msdobrescu
Copy link
Author

To summarize:

  • Having many packages in a repo, requires particular finalization to some of the and general finalization per batch.
  • As it is implemented now, it runs the finalization for every package - a fact that renders the finalization defined in the tree's finalize.yaml file for every package.

According to the above, the ideal implementation would be:

  • Having a finalize file per package as it is now - optionally to add the finalize step in the package definition or in a finalize.yaml file with package entries in the same form as in the collection file, but this would add complexity while as it now is enough to check for the name and category in order to decide what to apply.
  • Having an additional tree global finalize file, that is run once at the end of the batch and do the common stuff once.

This solution means to reduce installation and especially upgrade times. Now, it may upgrade in minutes, literally, if the finalization would not be so long (hours in the case of some commands runs accumulation).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants