diff options
author | Marc A. Paradise | 2020-02-04 12:15:03 -0500 |
---|---|---|
committer | Marc A. Paradise | 2020-02-04 12:22:30 -0500 |
commit | a8c60a4ede52477c9bc094804d5ebf397c2c6c7f (patch) | |
tree | 91589a12505564e9ca04445164f878d6e95b0318 /update.rb | |
parent | 9004b4c00ff7a76d2850b6bcb2a95c0fd44808a7 (diff) | |
download | aur-a8c60a4ede52477c9bc094804d5ebf397c2c6c7f.tar.gz |
Make updates scripted
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
Diffstat (limited to 'update.rb')
-rw-r--r-- | update.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/update.rb b/update.rb new file mode 100644 index 000000000000..0ec5f1e8a2a4 --- /dev/null +++ b/update.rb @@ -0,0 +1,30 @@ +require 'mixlib/install' +require 'json' + +options = { + channel: :stable, + product_name: 'chefdk', + platform: "debian", + platform_version: "9", + architecture: "x86_64" +} + +artifact = Mixlib::Install.new(options).artifact_info +pkgbuild = File.read("PKGBUILD") +pkgbuild.split("\n").each do |line| + if line =~ /pkgver=(.*)/ + puts "#{$1} → #{artifact.version}" + if $1 == artifact.version + puts "This version is already current!" + exit 1 + end + break + end +end + +pkgbuild = pkgbuild.gsub(/pkgver=.*/, "pkgver=#{artifact.version}"). + gsub(/sha256sums=.*/, "sha256sums=('#{artifact.sha256}')"). + gsub(/source=.*/, "source=('#{artifact.url}')"). + gsub(/arch=.*/, "arch=('#{artifact.architecture}')") + +File.open("PKGBUILD", "w") { |f| f.write(pkgbuild) } |