-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
fix: flatpak comparison in ujust script #172
Conversation
The previous comparison approach didn't work as newlines in the list were trimmed to form one string with all the flatpaks, and comm compares line by line. This uses bash arrays to properly manipulate the lists, additionally it sends a notification when new flatpaks are installed.
CURR_LIST_FILE={{ CURR_LIST_FILE }} | ||
IMAGE_NAME=$(jq -r '."image-name"' < "/usr/share/ublue-os/image-info.json") | ||
FLATPAK_LIST="$(curl https://raw.githubusercontent.com/ublue-os/aurora/main/aurora_flatpaks/flatpaks | tr '\n' ' ')" | ||
flatpak --system -y install --or-update ${FLATPAK_LIST} |
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.
no clue how this got through lol
just/aurora-system.just
Outdated
CURR_LIST_FILE={{ CURR_LIST_FILE }} | ||
IMAGE_NAME=$(jq -r '."image-name"' < "/usr/share/ublue-os/image-info.json") | ||
FLATPAK_LIST="$(curl https://raw.githubusercontent.com/ublue-os/aurora/main/aurora_flatpaks/flatpaks | tr '\n' ' ')" | ||
flatpak --system -y install --or-update ${FLATPAK_LIST} | ||
FLATPAK_LIST=($(curl https://raw.githubusercontent.com/ublue-os/aurora/main/aurora_flatpaks/flatpaks)) |
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.
Would it be possible / would it make sense to put these files in the image instead of downloading them every time from the internet, in order to:
- avoid depending on internet connection to githubusercontent.com on every boot
- only consider the historical version of the recommended flatpak list that was active at the point in time when the image was built.
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.
Hmm, yeah we could curl the list in build time into /usr/share/ublue-os and compare against that in the recipe. I do like that approach much more, on it!
This way we don't need to curl against gh on boot, thx @etvt
derp... I also dont wanna add stuff to the main justfile
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.
Thanks for the fixes. LGTM!
I'm going to force merge this PR because it fixes an issue with code that has already been merged, so it needs to be available in the |
IMAGE_NAME=$(jq -r '."image-name"' < "/usr/share/ublue-os/image-info.json") | ||
FLATPAK_LIST=($(curl https://raw.githubusercontent.com/ublue-os/aurora/main/aurora_flatpaks/flatpaks)) | ||
|
||
if [[ ${IMAGE_NAME} =~ "dx" ]]; then | ||
FLATPAK_LIST+=($(curl https://raw.githubusercontent.com/ublue-os/aurora/main/dx_flatpaks/flatpaks)) | ||
fi |
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.
Is there any reason why this else branch is not
FLATPAK_LIST=($(cat /usr/share/ublue-os/flatpak_list))
?
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.
It keeps the old behavior of the recipe consistent. When the argument that points to a flatpak list is not given, it installs all the flatpaks from the repo (this only happens when the user manually does ujust install-system-flatpaks
)
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.
makes sense, thanks!
The previous comparison approach didn't work as newlines in the list were trimmed to form one string with all the flatpaks, and comm compares line by line.
This uses bash arrays to properly manipulate the lists, additionally it sends a notification when new flatpaks are installed.