[DRE-commits] [ruby-rspec] 08/19: add some stuff to report newer version
Jérémy Bobbio
lunar at alioth.debian.org
Sun Oct 20 17:01:20 UTC 2013
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch pu/multideb
in repository ruby-rspec.
commit d758c9d017cb1d03f4e92e879ddf53854f3d92ae
Author: Jérémy Bobbio <lunar at debian.org>
Date: Sun Oct 20 11:25:16 2013 +0200
add some stuff to report newer version
---
debian/rspec-core.watch | 2 ++
debian/rspec-expectations.watch | 2 ++
debian/rspec-mocks.watch | 2 ++
debian/{watch => rspec.watch} | 0
debian/rules | 40 +++++++++++++++++++++++++++++++++++++++
5 files changed, 46 insertions(+)
diff --git a/debian/rspec-core.watch b/debian/rspec-core.watch
new file mode 100644
index 0000000..b910b2f
--- /dev/null
+++ b/debian/rspec-core.watch
@@ -0,0 +1,2 @@
+version=3
+http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/rspec-core .*/rspec-core-(.*).tar.gz
diff --git a/debian/rspec-expectations.watch b/debian/rspec-expectations.watch
new file mode 100644
index 0000000..30e1d8d
--- /dev/null
+++ b/debian/rspec-expectations.watch
@@ -0,0 +1,2 @@
+version=3
+http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/rspec-expectations .*/rspec-expectations-(.*).tar.gz
diff --git a/debian/rspec-mocks.watch b/debian/rspec-mocks.watch
new file mode 100644
index 0000000..b6e6cd3
--- /dev/null
+++ b/debian/rspec-mocks.watch
@@ -0,0 +1,2 @@
+version=3
+http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/rspec-mocks .*/rspec-mocks-(.*).tar.gz
diff --git a/debian/watch b/debian/rspec.watch
similarity index 100%
rename from debian/watch
rename to debian/rspec.watch
diff --git a/debian/rules b/debian/rules
index 4ec3338..835dfd4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,6 +11,46 @@
# If you need to specify the .gemspec (eg there is more than one)
#export DH_RUBY_GEMSPEC=gem.gemspec
+DEB_VERSION = $(shell dpkg-parsechangelog | awk '/^Version:/ { print $$2 }')
+UPSTREAM_VERSION = $(word 1, $(subst -, ,$(DEB_VERSION)))
+MAJOR = $(word 1, $(subst ., ,$(UPSTREAM_VERSION)))
+MINOR = $(word 2, $(subst ., ,$(UPSTREAM_VERSION)))
+PATCHLEVEL = $(word 3, $(subst ., ,$(UPSTREAM_VERSION)))
+PATCHLEVEL_RSPEC = $(word 1, $(subst +, ,$(PATCHLEVEL)))
+PATCHLEVEL_RSPEC_CORE = $(word 2, $(subst +, ,$(PATCHLEVEL)))
+PATCHLEVEL_RSPEC_EXPECTATIONS = $(word 3, $(subst +, ,$(PATCHLEVEL)))
+PATCHLEVEL_RSPEC_MOCKS = $(word 4, $(subst +, ,$(PATCHLEVEL)))
+RSPEC_VERSION = $(MAJOR).$(MINOR).$(PATCHLEVEL_RSPEC)
+RSPEC_CORE_VERSION = $(MAJOR).$(MINOR).$(PATCHLEVEL_RSPEC_CORE)
+RSPEC_EXPECTATIONS_VERSION = $(MAJOR).$(MINOR).$(PATCHLEVEL_RSPEC_EXPECTATIONS)
+RSPEC_MOCKS_VERSION = $(MAJOR).$(MINOR).$(PATCHLEVEL_RSPEC_MOCKS)
+
+test:
+ @echo $(RSPEC_VERSION)
+ @echo $(RSPEC_CORE_VERSION)
+ @echo $(RSPEC_EXPECTATIONS_VERSION)
+ @echo $(RSPEC_MOCKS_VERSION)
+
+report:
+ @set -e && \
+ (echo rspec $(RSPEC_VERSION); echo rspec-core $(RSPEC_CORE_VERSION); echo rspec-expectations $(RSPEC_EXPECTATIONS_VERSION); echo rspec-mocks $(RSPEC_MOCKS_VERSION)) | { while read gem version; do \
+ new_version=$$(uscan --report --watch debian/$$gem.watch --upstream-version $$version | sed -n -e 's/^Newest version on remote site is \([^,]*\), .*$$/\1/p'); \
+ if [ "$$new_major_minor" ]; then \
+ [ "$$new_major_minor" = "$${new_version%.*}" ] || { echo 'Major/minor version mismatch between gems!' >&2; exit 1; }; \
+ fi; \
+ new_major_minor="$${new_version%.*}"; \
+ new_patchlevel="$${new_version##*.}"; \
+ new_patchlevels="$${new_patchlevels:+$$new_patchlevels+}$$new_patchlevel"; \
+ done; \
+ new_upstream_version="$$new_major_minor.$$new_patchlevels"; \
+ echo "Newest version on remote site is $$new_upstream_version, local version is $(UPSTREAM_VERSION)"; \
+ if [ "$$new_upstream_version" = "$(UPSTREAM_VERSION)" ]; then \
+ echo " => Package is up to date"; \
+ else \
+ echo " => Newer versions available. Update debian/changelog and run 'debian/rules download'"; \
+ fi; \
+ }
+
%:
dh $@ --buildsystem=ruby --with ruby
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-rspec.git
More information about the Pkg-ruby-extras-commits
mailing list