[Git][noosfero/noosfero][master] Noosfero::VERSION: fix detecting git version for good
Antonio Terceiro
gitlab at mg.gitlab.com
Fri Nov 6 11:11:09 BRST 2015
Antonio Terceiro pushed to branch master at Noosfero / noosfero
Commits:
d877a56d by Antonio Terceiro at 2015-11-06T11:10:01Z
Noosfero::VERSION: fix detecting git version for good
- - - - -
1 changed file:
- lib/noosfero/version.rb
Changes:
=====================================
lib/noosfero/version.rb
=====================================
--- a/lib/noosfero/version.rb
+++ b/lib/noosfero/version.rb
@@ -6,7 +6,13 @@ end
root = File.expand_path(File.dirname(__FILE__) + '/../..')
if File.exist?(File.join(root, '.git')) && system('which git >/dev/null')
git_version = Dir.chdir(root) { `git describe --tags`.to_s.strip.sub('-rc', '~rc') }
- if git_version > Noosfero::VERSION
+ version_sort = IO.popen(['sort', '--version-sort'], 'w+')
+ version_sort.puts(Noosfero::VERSION)
+ version_sort.puts(git_version)
+ version_sort.close_write
+ new_version = version_sort.readlines.last.strip
+ if new_version != Noosfero::VERSION
Noosfero::VERSION.clear << git_version
end
+ version_sort.close
end
View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/d877a56dd9ad293683a28ff3be347994ea1bcf3a
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151106/30027a18/attachment.html>
More information about the Noosfero-dev
mailing list