aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/version.rb
diff options
context:
space:
mode:
authorBaptiste Fontaine2015-10-02 22:52:25 +0200
committerBaptiste Fontaine2015-10-04 10:31:46 +0200
commitcc7a047edc8dbd34706dfe4014a78dc0b176cf6b (patch)
treed6d01b18442edd559dc1e90be736830f89ca0d8b /Library/Homebrew/version.rb
parent5f29dee138a2478f89480710af3905546fa98368 (diff)
downloadbrew-cc7a047edc8dbd34706dfe4014a78dc0b176cf6b.tar.bz2
version: parse opam archives
Closes Homebrew/homebrew#44544. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
Diffstat (limited to 'Library/Homebrew/version.rb')
-rw-r--r--Library/Homebrew/version.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb
index d3f0417b0..49296a142 100644
--- a/Library/Homebrew/version.rb
+++ b/Library/Homebrew/version.rb
@@ -328,6 +328,13 @@ class Version
m = /-(\d+\.\d+(?:\.\d+)?)-w(?:in)?(?:32|64)$/.match(stem)
return m.captures.first unless m.nil?
+ # Opam packages
+ # e.g. https://opam.ocaml.org/archives/sha.1.9+opam.tar.gz
+ # e.g. https://opam.ocaml.org/archives/lablgtk.2.18.3+opam.tar.gz
+ # e.g. https://opam.ocaml.org/archives/easy-format.1.0.2+opam.tar.gz
+ m = /\.(\d+\.\d+(?:\.\d+)?)\+opam$/.match(stem)
+ return m.captures.first unless m.nil?
+
# e.g. http://ftpmirror.gnu.org/mtools/mtools-4.0.18-1.i686.rpm
# e.g. http://ftpmirror.gnu.org/autogen/autogen-5.5.7-5.i386.rpm
# e.g. http://ftpmirror.gnu.org/libtasn1/libtasn1-2.8-x86.zip