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

Make the user visible patterns configurable, added MicroOS products #916

Merged
merged 15 commits into from
Dec 6, 2023
Merged
4 changes: 2 additions & 2 deletions .yupdate.post
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function restart_service() {

if [ -n "$SERVICE_START" ]; then
SERVICE_START_UNIX_TIME=$(date -d "$SERVICE_START" +"%s")
# find the date of the latest file in the gem
NEWEST_FILE_TIME=$(find /usr/lib*/ruby/gems/*/gems/$SERVICE_NAME-* -exec stat --format %Y "{}" \; | sort -nr | head -n 1)
# find the date of the latest file in the product configuration or in the gem
NEWEST_FILE_TIME=$(find /usr/share/agama/products.d /usr/lib*/ruby/gems/*/gems/$SERVICE_NAME-* -exec stat --format %Y "{}" \; | sort -nr | head -n 1)

# when a file is newer than the start time then restart the service
if [ -n "$NEWEST_FILE_TIME" ] && [ "$SERVICE_START_UNIX_TIME" -lt "$NEWEST_FILE_TIME" ]; then
Expand Down
16 changes: 16 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,21 @@ if ENV["YUPDATE_FORCE"] == "1" || File.exist?("/.packages.initrd") || live_iso?
FileUtils.mkdir_p(File.join(destdir, "/usr/share"))
FileUtils.cp_r("playwright/.", File.join(destdir, "/usr/share/agama-playwright"))
end

if ENV["YUPDATE_SKIP_PRODUCTS"] != "1"
files = Dir.glob("products.d/*.y{a}ml")
files.each do |f|
# the sources contain several products, update only the existing files
oldfile = File.join("/usr/share/agama/", f)
if File.exist?(oldfile)
target = File.join(destdir, "/usr/share/agama/", f)
FileUtils.mkdir_p(File.dirname(target))
FileUtils.cp(f, target)
else
# if there is a new product file it needs to be copied manually
Copy link
Contributor

Choose a reason for hiding this comment

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

Without putting too much thinking into it... not sure if this is the behavior I would expect.

Copy link
Contributor

Choose a reason for hiding this comment

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

well, problem is that it is hard to know which product belongs to which iso

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is that the Git repository contains YAML files for all product. If you are patching the openSUSE Agama installer then the Live medium contains only the openSUSE products.

If yupdate would install all files you would suddenly see the ALP Dolomite product in the list, that would be confusing. So I decided to patch only the existing files and to not blindly copy everything available. IMHO it is better to have a safer default behavior.

puts "Skipping product file: #{f}"
end
end
end
end
end