[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#731340:



tags 833007 + patch
thanks

Hi,

Please find attached a patch which also partially fix #731340 (in CC).
This patch will emit the tag for many packages. I did not update
t/tests/*/tags according to this new tag. I am waiting for some
reviews of the patch to do the job.

Best regards,
Dylan
From 38cab176a195a51cdc1803495851287d2ec52089 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dylan=20A=C3=AFssi?= <bob.dybian@gmail.com>
Date: Tue, 2 May 2017 22:49:36 +0200
Subject: [PATCH] c/upstream-metadata: Add a check
 upstream-metadata-file-is-missing

---
 checks/upstream-metadata.desc             | 7 +++++++
 checks/upstream-metadata.pm               | 6 +++++-
 t/tests/upstream-metadata-is-missing/desc | 7 +++++++
 t/tests/upstream-metadata-is-missing/tags | 2 ++
 4 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 t/tests/upstream-metadata-is-missing/desc
 create mode 100644 t/tests/upstream-metadata-is-missing/tags

diff --git a/checks/upstream-metadata.desc b/checks/upstream-metadata.desc
index 5f3c2c5..6c69b41 100644
--- a/checks/upstream-metadata.desc
+++ b/checks/upstream-metadata.desc
@@ -18,3 +18,10 @@ Certainty: certain
 Ref: http://dep.debian.net/deps/dep12/
 Info: The DEP 12 metadata file is not well formed.  The formatting
  need to be adjusted to match the YAML specification.
+
+Tag: upstream-metadata-file-is-missing
+Severity: pedantic
+Certainty: certain
+Ref: http://dep.debian.net/deps/dep12/
+Info: This source package is not Debian-native but it does not have a
+ <tt>debian/upstream/metadata</tt> file.
diff --git a/checks/upstream-metadata.pm b/checks/upstream-metadata.pm
index 08798db..8011bd5 100644
--- a/checks/upstream-metadata.pm
+++ b/checks/upstream-metadata.pm
@@ -30,7 +30,11 @@ use YAML::XS;
 sub run {
     my (undef, undef, $info) = @_;
     my $yamlfile = $info->index_resolved_path('debian/upstream/metadata');
-    return if not $yamlfile;
+
+    if (not $yamlfile) {
+        tag 'upstream-metadata-file-is-missing' unless ($info->native);
+        return;
+    }
 
     if ($yamlfile->is_open_ok) {
         my $yaml;
diff --git a/t/tests/upstream-metadata-is-missing/desc b/t/tests/upstream-metadata-is-missing/desc
new file mode 100644
index 0000000..df7f36e
--- /dev/null
+++ b/t/tests/upstream-metadata-is-missing/desc
@@ -0,0 +1,7 @@
+Testname: upstream-metadata-is-missing
+Type: non-native
+Version: 1.0-1
+Description: Tests for missing upstream metadata file
+Skeleton: pedantic
+Options: --pedantic
+Test-For: upstream-metadata-file-is-missing
diff --git a/t/tests/upstream-metadata-is-missing/tags b/t/tests/upstream-metadata-is-missing/tags
new file mode 100644
index 0000000..45e6185
--- /dev/null
+++ b/t/tests/upstream-metadata-is-missing/tags
@@ -0,0 +1,2 @@
+P: upstream-metadata-is-missing source: debian-watch-may-check-gpg-signature
+P: upstream-metadata-is-missing source: upstream-metadata-file-is-missing
-- 
2.1.4


Reply to: