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 | |
parent | 9004b4c00ff7a76d2850b6bcb2a95c0fd44808a7 (diff) | |
download | aur-a8c60a4ede52477c9bc094804d5ebf397c2c6c7f.tar.gz |
Make updates scripted
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | update.rb | 30 |
4 files changed, 36 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore index f05a7493bf44..62844c527a03 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /src/ /*.deb /*.tar.xz +Gemfile.lock diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000000..383c431e141f --- /dev/null +++ b/Gemfile @@ -0,0 +1,2 @@ +gem "mixlib-install" + @@ -1,6 +1,9 @@ default: clean build build: namcap + rm Gemfile.lock + bundle install + bundle exec ruby update.rb makepkg makepkg --printsrcinfo > .SRCINFO 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) } |