Skip to content

Instantly share code, notes, and snippets.

@supechicken
Created February 26, 2023 18:52
Show Gist options
  • Select an option

  • Save supechicken/a52e1fa4686274ce12f95fdeeed953af to your computer and use it in GitHub Desktop.

Select an option

Save supechicken/a52e1fa4686274ce12f95fdeeed953af to your computer and use it in GitHub Desktop.
Check chromebrew package update from archlinux repository
$LOAD_PATH << "#{Dir.pwd}/lib"
require 'package'
`grep -A1 '# Adapted from Arch Linux .* PKGBUILD at:' packages/*.rb`.split('--').map do |message|
message.strip.lines(chomp: true)[1].sub(/ # .*/, '').split('-# ', 2)
end.each do |pkgFile, archLink|
latest_ver = `curl -Ls '#{archLink.sub('blob', 'raw')}'`[/^pkgver=(.*)$/, 1]
current_ver = Package.load_package(pkgFile).version
puts "#{pkgFile}: current: #{current_ver}, latest: #{latest_ver}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment