summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc A. Paradise2020-07-28 11:13:28 -0400
committerMarc A. Paradise2020-07-28 11:20:53 -0400
commit4afdb1923acdbe47e4b850ff59bac1cd6f401540 (patch)
treed06637cef3a3672581a0846506550ce3c9994a19
parenta106d7bbceec29aa2ce02b9bf64558a3588cb409 (diff)
downloadaur-4afdb1923acdbe47e4b850ff59bac1cd6f401540.tar.gz
Automate the git bits too
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
-rw-r--r--.version_src1
-rw-r--r--Makefile16
-rw-r--r--update.rb6
3 files changed, 20 insertions, 3 deletions
diff --git a/.version_src b/.version_src
new file mode 100644
index 000000000000..aac61dbfb2a5
--- /dev/null
+++ b/.version_src
@@ -0,0 +1 @@
+20.7.96 → 20.7.96 \ No newline at end of file
diff --git a/Makefile b/Makefile
index 75faaf28d7ad..85071e3e5086 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,26 @@
default: build
-build: clean namcap
+prep: clean namcap
rm -rf Gemfile.lock
bundle install
+ # Fetches latest version info, updates
+ # PKGBUILD, and creates a .commit_msg
bundle exec ruby update.rb
+
+build: prep
makepkg
makepkg --printsrcinfo > .SRCINFO
+# .commit_msg is created by update.rb,
+# if there is a new version.
+commit: .commit_msg
+ echo "Committing: "
+ cat .commit_msg
+ git add .SRCINFO
+ git add PKGBUILD
+ git commit -S -s -F .commit_msg
+ rm .commit_msg
+
clean:
git clean -fd
rm -rf pkg src *.deb *.tar.xz
diff --git a/update.rb b/update.rb
index bdaac6f4c29b..4df701a584f2 100644
--- a/update.rb
+++ b/update.rb
@@ -13,11 +13,13 @@ 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!"
+ puts "#{$1}: This version is already current!"
exit 1
end
+ File.open(".commit_msg", "w") do |f|
+ f.write("#{$1} → #{artifact.version}")
+ end
break
end
end