Skip to content

Commit 0495656

Browse files
committed
Change version format to use periods
Because vanagon replaces all dashes in tags or git describes with periods, we end up with artifacts having different file names than the tag, and they end up being stored in a artifacts.voxpupuli.org in a directory with the tag that differs from the filename. While this isn't a huge deal, it makes automation more complicated. In order to standardize, this changes the tag format to use periods instead.
1 parent 5a58275 commit 0495656

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tasks/vox.rake

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class Version
44
def initialize(v)
55
@raw = v
66

7-
if (m = v.match(%r{\A(?<date>\d{4}-\d{2}-\d{2})-(?<x>\d+)\z}))
7+
if (m = v.match(%r{\A(?<date>\d{4}[-|\.]\d{2}[-|\.]\d{2})[-|\.](?<x>\d+)\z}))
88
@date = m['date']
99
@x = m['x'].to_i
1010
else
@@ -16,6 +16,7 @@ class Version
1616
def self.load_from_changelog
1717
changelog = File.expand_path('../CHANGELOG.md', __dir__)
1818
version = File.read(changelog).match(/^## \[([^\]]+)\]/) { |match| match[1] }
19+
version = version.gsub('-', '.')
1920
new(version)
2021
rescue Errno::ENOENT
2122
new('')
@@ -25,7 +26,7 @@ class Version
2526
if malformed?
2627
raw
2728
else
28-
"#{date}-#{x}"
29+
"#{date}.#{x}"
2930
end
3031
end
3132

@@ -47,7 +48,7 @@ class Version
4748
end
4849

4950
def today
50-
Time.now.strftime('%Y-%m-%d')
51+
Time.now.strftime('%Y.%m.%d')
5152
end
5253
end
5354

0 commit comments

Comments
 (0)