[SCM] ci-tooling packaging branch, master, updated. 7b1f88620cd10ca2111e4b5174f9ac9177b49795
Harald Sitter
apachelogger-guest at moszumanska.debian.org
Mon Apr 13 16:21:10 UTC 2015
Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=7b1f886
The following commit has been merged in the master branch:
commit 7b1f88620cd10ca2111e4b5174f9ac9177b49795
Author: Harald Sitter <sitter at kde.org>
Date: Mon Apr 13 18:21:06 2015 +0200
add missing lib
---
lib/lint/series.rb | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/lib/lint/series.rb b/lib/lint/series.rb
new file mode 100644
index 0000000..7ee9e81
--- /dev/null
+++ b/lib/lint/series.rb
@@ -0,0 +1,43 @@
+require 'pathname'
+
+require_relative '../debian/patchseries'
+require_relative 'result'
+
+# NOTE: patches that are in the series but not the VCS cause build failures, so
+# they are not covered in this check
+
+module Lint
+ # Lints a debian patches seris file
+ class Series
+ attr_reader :package_directory
+
+ def initialize(package_directory = Dir.pwd)
+ @package_directory = package_directory
+ # series is lazy init'd because it does a path check. A bit meh.
+ @patch_directory = File.join(@package_directory, 'debian/patches')
+ end
+
+ # @return [Result]
+ def lint
+ result = Result.new.tap { |r| r.valid = true }
+ Dir.glob("#{@patch_directory}/**/*").each do |patch|
+ next if File.basename(patch) == 'series'
+ patch = relative(patch, @patch_directory)
+ next if series.patches.include?(patch)
+ result.warnings << "Patch #{File.basename(patch)} in VCS but not" \
+ ' listed in debian/series file.'
+ end
+ result
+ end
+
+ private
+
+ def relative(path, path_base)
+ Pathname.new(path).relative_path_from(Pathname.new(path_base)).to_s
+ end
+
+ def series
+ @series ||= Debian::PatchSeries.new(@package_directory)
+ end
+ end
+end
--
ci-tooling packaging
More information about the pkg-kde-commits
mailing list