[SCM] ci-tooling packaging branch, master, updated. bc8916e1c1000cc946fb80ddfb2301005b30c505
Harald Sitter
apachelogger-guest at moszumanska.debian.org
Fri Feb 6 14:51:19 UTC 2015
Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=bc8916e
The following commit has been merged in the master branch:
commit bc8916e1c1000cc946fb80ddfb2301005b30c505
Author: Harald Sitter <sitter at kde.org>
Date: Fri Feb 6 15:51:16 2015 +0100
debian/changelog: rbeautify
---
lib/debian/changelog.rb | 95 ++++++++++++++++++++++++-------------------------
1 file changed, 47 insertions(+), 48 deletions(-)
diff --git a/lib/debian/changelog.rb b/lib/debian/changelog.rb
index e87a013..ddd6a3e 100644
--- a/lib/debian/changelog.rb
+++ b/lib/debian/changelog.rb
@@ -1,53 +1,52 @@
class Changelog
- # This is a simplified parser that only reads the first line (latest entry)
- # to get version and name of the package. It is used because parsechangelog
- # has been observed to be incredibly slow at what it does, while it in fact
- # provides more information than we need. So here's the super optimized
- # version for us.
-
- attr_reader :name
+ # This is a simplified parser that only reads the first line (latest entry)
+ # to get version and name of the package. It is used because parsechangelog
+ # has been observed to be incredibly slow at what it does, while it in fact
+ # provides more information than we need. So here's the super optimized
+ # version for us.
- EPOCH = 0b1
- BASE = 0b10
- BASESUFFIX = 0b100
- REVISION = 0b1000
- ALL = 0b1111
+ attr_reader :name
- def initialize()
- line = File.open('debian/changelog', &:gets)
- # plasma-framework (5.3.0-0ubuntu1) utopic; urgency=medium
- match = line.match(/^(.*) \((.*)\) (.+); urgency=(\w+)/)
- # Need a match and 5 elements.
- # 0: full match
- # 1: source name
- # 2: version
- # 3: distribution series
- # 4: urgency
- raise 'E: Cannot read debian/changelog' if match.nil? or match.size != 5
- @name = match[1]
- @version = match[2]
- # Don't even bother with the rest, we don't care right now.
-
- version = @version.dup
- # Split the entire thing.
- @comps = {}
- @comps[:revision] = version.slice!(version.rindex('-')..-1) rescue ""
- if version.include?('~git')
- @comps[:base_suffix] = version.slice!(version.rindex('~git')..-1) rescue ""
- else
- @comps[:base_suffix] = version.slice!(version.rindex('+git')..-1) rescue ""
- end
- @comps[:base] = version.slice!(version.rindex(':')+1..-1) rescue version
- @comps[:epoch] = version.slice!(0..version.rindex(':')+1) rescue ""
- end
-
- def version(flags = ALL)
- p flags
- ret = ""
- ret += @comps[:epoch] if flags & EPOCH > 0
- ret += @comps[:base] if flags & BASE > 0
- ret += @comps[:base_suffix] if flags & BASESUFFIX > 0
- ret += @comps[:revision] if flags & REVISION > 0
- return ret
+ EPOCH = 0b1
+ BASE = 0b10
+ BASESUFFIX = 0b100
+ REVISION = 0b1000
+ ALL = 0b1111
+
+ def initialize()
+ line = File.open('debian/changelog', &:gets)
+ # plasma-framework (5.3.0-0ubuntu1) utopic; urgency=medium
+ match = line.match(/^(.*) \((.*)\) (.+); urgency=(\w+)/)
+ # Need a match and 5 elements.
+ # 0: full match
+ # 1: source name
+ # 2: version
+ # 3: distribution series
+ # 4: urgency
+ fail 'E: Cannot read debian/changelog' if match.nil? or match.size != 5
+ @name = match[1]
+ @version = match[2]
+ # Don't even bother with the rest, we don't care right now.
+
+ version = @version.dup
+ # Split the entire thing.
+ @comps = {}
+ @comps[:revision] = version.slice!(version.rindex('-')..-1) rescue ''
+ if version.include?('~git')
+ @comps[:base_suffix] = version.slice!(version.rindex('~git')..-1) rescue ''
+ else
+ @comps[:base_suffix] = version.slice!(version.rindex('+git')..-1) rescue ''
end
+ @comps[:base] = version.slice!(version.rindex(':')+1..-1) rescue version
+ @comps[:epoch] = version.slice!(0..version.rindex(':')+1) rescue ''
+ end
+
+ def version(flags = ALL)
+ ret = ''
+ ret += @comps[:epoch] if flags & EPOCH > 0
+ ret += @comps[:base] if flags & BASE > 0
+ ret += @comps[:base_suffix] if flags & BASESUFFIX > 0
+ ret += @comps[:revision] if flags & REVISION > 0
+ ret
+ end
end
--
ci-tooling packaging
More information about the pkg-kde-commits
mailing list