* Guido Günther <a...@sigxcpu.org> [2021-01-31 13:19]:
Awesome. I had fixed the rpm parts here already
https://github.com/agx/git-buildpackage/tree/rpm but went for your
patches so your work is not lost. The reason i wrote 'tip of the
iceberg' is that the component tests need fixing as well - that's the bit
still missing - so tests still fail when the testdata for the component
tests is there (`git submodule update --init --recursive`).

Ha, I missed those. Attached one patch for GBP (gbp-rpm-Fix-tags-in-rpm-spec-files.patch)
and three for the rpm-testdata repo to make all tests work.

Cheers Jochen
From 3da6cd3af18d51cce569f2ee829356c8bbdb9392 Mon Sep 17 00:00:00 2001
From: Jochen Sprickerhof <jspri...@debian.org>
Date: Sun, 31 Jan 2021 22:40:00 +0100
Subject: [PATCH] rpm: Fix tags in rpm spec files

---
 tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec   |  6 +++---
 tests/data/rpm/specs/gbp-test2-reference.spec  | 11 +++++------
 tests/data/rpm/specs/gbp-test2-reference2.spec | 15 +++++++--------
 tests/data/rpm/specs/gbp-test3.spec            |  2 +-
 4 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec b/tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec
index 8a92725..d5b8763 100644
--- a/tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec
+++ b/tests/data/rpm/rpmbuild/SPECS/gbp-test2.spec
@@ -6,10 +6,10 @@ Release:    0
 Group:      Development/Libraries
 License:    GPLv2
 Source10:   ftp://ftp.host.com/%{name}-%{version}.tar.gz
-Source:     foo.txt
+Source0:    foo.txt
 Source20:   bar.tar.gz
-# Gbp-Ignore-Patches: -1
-Patch:      my.patch
+# Gbp-Ignore-Patches: 0
+Patch0:     my.patch
 Patch10:    my2.patch
 Patch20:    my3.patch
 Packager:   Markus Lehtonen <markus.lehto...@linux.intel.com>
diff --git a/tests/data/rpm/specs/gbp-test2-reference.spec b/tests/data/rpm/specs/gbp-test2-reference.spec
index 1882131..5e1f176 100644
--- a/tests/data/rpm/specs/gbp-test2-reference.spec
+++ b/tests/data/rpm/specs/gbp-test2-reference.spec
@@ -6,12 +6,12 @@ Release:    0
 Group:      Development/Libraries
 License:    GPLv2
 Source10:   ftp://ftp.host.com/%{name}-%{version}.tar.gz
-Source:     foo.txt
+Source0:    foo.txt
 Source20:   bar.tar.gz
-# Gbp-Ignore-Patches: -1
-Patch:      my.patch
+# Gbp-Ignore-Patches: 0
+Patch0:     my.patch
 # Patches auto-generated by git-buildpackage:
-Patch0:     new.patch
+Patch1:     new.patch
 Packager:   Markus Lehtonen <markus.lehto...@linux.intel.com>
 
 %description
@@ -27,14 +27,13 @@ Empty subpackage for the %{name} test package.
 %prep
 %setup -T -n %{name}-%{version} -c -a 10
 
-%patch
 
 echo "Do things"
 
 # Gbp-Patch-Macros
 # new.patch
 %if 1
-%patch0 -p1
+%patch1 -p1
 %endif
 
 %build
diff --git a/tests/data/rpm/specs/gbp-test2-reference2.spec b/tests/data/rpm/specs/gbp-test2-reference2.spec
index d41f450..32bbe97 100644
--- a/tests/data/rpm/specs/gbp-test2-reference2.spec
+++ b/tests/data/rpm/specs/gbp-test2-reference2.spec
@@ -6,13 +6,13 @@ Release:    0
 Group:      Development/Libraries
 License:    GPLv2
 Source10:   ftp://ftp.host.com/%{name}-%{version}.tar.gz
-Source:     foo.txt
+Source0:    foo.txt
 Source20:   bar.tar.gz
-# Gbp-Ignore-Patches: -1
-Patch:      my.patch
+# Gbp-Ignore-Patches: 0
+Patch0:     my.patch
 # Patches auto-generated by git-buildpackage:
-Patch0:     1.patch
-Patch1:     2.patch
+Patch1:     1.patch
+Patch2:     2.patch
 Packager:   Markus Lehtonen <markus.lehto...@linux.intel.com>
 VCS:        myvcstag
 
@@ -29,18 +29,17 @@ Empty subpackage for the %{name} test package.
 %prep
 %setup -T -n %{name}-%{version} -c -a 10
 
-%patch
 
 echo "Do things"
 
 # Gbp-Patch-Macros
 # 1.patch
 %if true
-%patch0 -p1
+%patch1 -p1
 %endif
 # 2.patch
 %ifarch %ix86
-%patch1 -p1
+%patch2 -p1
 %endif
 
 %build
diff --git a/tests/data/rpm/specs/gbp-test3.spec b/tests/data/rpm/specs/gbp-test3.spec
index c0c20c8..043afec 100644
--- a/tests/data/rpm/specs/gbp-test3.spec
+++ b/tests/data/rpm/specs/gbp-test3.spec
@@ -6,7 +6,7 @@ Group:      Development/Libraries
 License:    GPLv2
 Source:     %{name}-%{version}.tar.gz
 # Gbp-Ignore-Patches: 10
-Patch:      my.patch
+Patch0:     my.patch
 Patch10:    my2.patch
 Patch20:    my3.patch
 
-- 
2.30.0

From 6753fd1cb848efe21c67589ca0cc00d636dfd1e4 Mon Sep 17 00:00:00 2001
From: Jochen Sprickerhof <g...@jochen.sprickerhof.de>
Date: Sun, 31 Jan 2021 16:22:55 +0100
Subject: [PATCH 1/3] Adopt to Python 3

---
 manage.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/manage.py b/manage.py
index 3eb8c39..57a56c7 100755
--- a/manage.py
+++ b/manage.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 # vim:fileencoding=utf-8:et:ts=4:sw=4:sts=4
 #
 # Copyright (C) 2015 Intel Corporation <markus.lehto...@linux.intel.com>
@@ -20,7 +20,7 @@
 """Script for managing test package repositories and unittest data"""
 
 import argparse
-import ConfigParser
+import configparser
 import json
 import logging
 import os
@@ -55,9 +55,9 @@ def run_cmd(cmd, opts=None, capture_stdout=False, capture_stderr=False,
     LOG.debug("Running command: '%s'", ' '.join(args))
     popen = subprocess.Popen(args, stdin=stdin, stdout=stdout, stderr=stderr,
                              env=env)
-    stdout, stderr = popen.communicate(input_data)
-    ret_out = stdout.splitlines() if stdout else stdout
-    ret_err = stderr.splitlines() if stderr else stderr
+    stdout, stderr = popen.communicate(input_data.encode() if input_data else None)
+    ret_out = stdout.decode().splitlines() if stdout else stdout
+    ret_err = stderr.decode().splitlines() if stderr else stderr
     return (popen.returncode, ret_out, ret_err)
 
 
@@ -240,7 +240,7 @@ def cmd_build(args):
         raise Exception("No repositories found, run 'import' in order to "
                         "initialize test package repositories for building")
     # Read build config
-    config = ConfigParser.RawConfigParser()
+    config = configparser.RawConfigParser()
     config.read('build.conf')
 
     for repodir in repos:
@@ -351,7 +351,7 @@ def import_repo(datadir, repodir, force):
 
         # Create child mapping of commit history
         commits = defaultdict(list)
-        for sha1, info in manifest['commits'].iteritems():
+        for sha1, info in manifest['commits'].items():
             if 'parents' not in info:
                 commits['root'].append(sha1)
             else:
@@ -367,7 +367,7 @@ def import_repo(datadir, repodir, force):
         import_commit_history('root')
 
         # Re-create tags
-        for sha1, tag in manifest['tags'].iteritems():
+        for sha1, tag in manifest['tags'].items():
             signature_data = "object %s\ntype %s\ntag %s\ntagger %s\n\n%s\n" % (
                 tag['object'], tag['type'], tag['tag'], tag['tagger'],
                 tag['message'])
@@ -377,7 +377,7 @@ def import_repo(datadir, repodir, force):
                 (new_sha1, sha1)
 
         # Re-create refs
-        for ref, sha1 in manifest['refs'].iteritems():
+        for ref, sha1 in manifest['refs'].items():
             git_cmd('update-ref', [ref, sha1], True)
 
         # Forcefully set HEAD
-- 
2.30.0

From d03e46bd51c1a713611199511526d38f47b2700f Mon Sep 17 00:00:00 2001
From: Jochen Sprickerhof <g...@jochen.sprickerhof.de>
Date: Sun, 31 Jan 2021 21:56:04 +0100
Subject: [PATCH 2/3] Add commands to README

---
 README | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/README b/README
index 89c6d82..80e20c0 100644
--- a/README
+++ b/README
@@ -1,2 +1,10 @@
 Data for testing git-buildpackage-rpm. Used in nose unittests of the RPM
 variants of the git-buildpackage tools.
+
+To change the patches:
+
+$ ./manage.py -v import-repo
+
+change the git repo
+
+$ ./manage.py -v export-repo
-- 
2.30.0

From e7c44bc588cc3d8b367c454d6668771608f3039c Mon Sep 17 00:00:00 2001
From: Jochen Sprickerhof <g...@jochen.sprickerhof.de>
Date: Sun, 31 Jan 2021 22:04:37 +0100
Subject: [PATCH 3/3] Fix tags in rpm spec files

Patches and Sources, counting from 0.

https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s03s04.html
---
 gbp-test2.data/Add-packaging-files.patch      |   8 +-
 gbp-test2.data/Remove-imported-patches.patch  |   6 +-
 gbp-test2.data/manifest.json                  | 244 +++++++++---------
 ...rnative-spec-file-and-change-patch-p.patch |  16 +-
 ...-the-corrected-patch-number-handling.patch |  20 +-
 5 files changed, 140 insertions(+), 154 deletions(-)

diff --git a/gbp-test2.data/Add-packaging-files.patch b/gbp-test2.data/Add-packaging-files.patch
index 5d13ffe..653c527 100644
--- a/gbp-test2.data/Add-packaging-files.patch
+++ b/gbp-test2.data/Add-packaging-files.patch
@@ -28,7 +28,7 @@ index 0000000..25ed442
 +file for testing rpm support of git-buildpackage.
 diff --git a/packaging/gbp-test2.spec b/packaging/gbp-test2.spec
 new file mode 100644
-index 0000000..61aae33
+index 0000000..5121f17
 --- /dev/null
 +++ b/packaging/gbp-test2.spec
 @@ -0,0 +1,48 @@
@@ -40,10 +40,10 @@ index 0000000..61aae33
 +Group:      Development/Libraries
 +License:    GPLv2
 +Source10:   ftp://ftp.host.com/%{name}-%{version}.tar.gz
-+Source:     foo.txt
++Source0:    foo.txt
 +Source20:   bar.tar.gz
-+# Gbp-Ignore-Patches: 0
-+Patch:      my.patch
++# Gbp-Ignore-Patches: -1
++Patch0:     my.patch
 +Patch10:    my2.patch
 +Patch20:    my3.patch
 +Packager:   Markus Lehtonen <markus.lehto...@linux.intel.com>
diff --git a/gbp-test2.data/Remove-imported-patches.patch b/gbp-test2.data/Remove-imported-patches.patch
index 020a8a1..dc2f57e 100644
--- a/gbp-test2.data/Remove-imported-patches.patch
+++ b/gbp-test2.data/Remove-imported-patches.patch
@@ -19,7 +19,7 @@ index 6c8e847..52a1267 100644
  spec-file = packaging/gbp-test2.spec
  
 diff --git a/packaging/gbp-test2.spec b/packaging/gbp-test2.spec
-index 5b41aae..409a102 100644
+index 95c3dc2..f41abc3 100644
 --- a/packaging/gbp-test2.spec
 +++ b/packaging/gbp-test2.spec
 @@ -2,7 +2,7 @@ Name:       gbp-test2
@@ -33,8 +33,8 @@ index 5b41aae..409a102 100644
  Source10:   ftp://ftp.host.com/%{name}-%{version}.tar.gz
 @@ -11,8 +11,6 @@ Source20:   bar.tar.gz
  Source9999: gbp-test2-alt.spec
- # Gbp-Ignore-Patches: -1
- Patch:      my.patch
+ # Gbp-Ignore-Patches: 0
+ Patch0:     my.patch
 -Patch10:    http://example.com/patches/my2.patch
 -Patch20:    my3.patch
  Packager:   Markus Lehtonen <markus.lehto...@linux.intel.com>
diff --git a/gbp-test2.data/manifest.json b/gbp-test2.data/manifest.json
index bb04e16..7ad3bde 100644
--- a/gbp-test2.data/manifest.json
+++ b/gbp-test2.data/manifest.json
@@ -1,162 +1,148 @@
 {
-    "HEAD": "ref: refs/heads/master\n", 
+    "HEAD": "ref: refs/heads/master\n",
     "commits": {
         "0579e0753b78476ad822c54b6ea07e2e80c0cdd2": {
-            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352272349 +0200", 
-            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352272349 +0200", 
-            "message": "Repository initialization\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>", 
-            "patchfile": "Repository-initialization.patch", 
-            "sha1": "0579e0753b78476ad822c54b6ea07e2e80c0cdd2", 
+            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352272349 +0200",
+            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352272349 +0200",
+            "message": "Repository initialization\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>",
+            "patchfile": "Repository-initialization.patch",
+            "sha1": "0579e0753b78476ad822c54b6ea07e2e80c0cdd2",
             "tree": "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
-        }, 
-        "189b0a152a6f1405e021c2988755ce2f5d89c998": {
-            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1358253459 +0200", 
-            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1448551036 +0200", 
-            "message": "packaging: change my2.patch to git email format\n\nChange my2.patch from plain diff to git email format to test author and\ndate parsing of gbp.\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>", 
+        },
+        "1a0baea83bfe65a07c1ff4fe596ef46dca04ec08": {
+            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352807746 +0200",
+            "committer": "Jochen Sprickerhof <g...@jochen.sprickerhof.de> 1612126847 +0100",
+            "message": "My addition\n\nImport my2.patch to the git tree.\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>",
             "parents": [
-                "db72a4efae2b72b56f7723df844d7a506e549ce1"
-            ], 
-            "patchfile": "packaging-change-my2.patch-to-git-email-format.patch", 
-            "sha1": "189b0a152a6f1405e021c2988755ce2f5d89c998", 
-            "tree": "8bec5b20caa318012584b1e90942949704248a13"
-        }, 
-        "2a17b0d682aa73f10a6e242e0f60408b61812047": {
-            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352807855 +0200", 
-            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1448551076 +0200", 
-            "message": "Remove imported patches\n\nAnd enable automatic patch-generation.\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>", 
+                "dad94e415671a99991753cbb5e67847235a35b28"
+            ],
+            "patchfile": "My-addition.patch",
+            "sha1": "1a0baea83bfe65a07c1ff4fe596ef46dca04ec08",
+            "tree": "026d4c429dfd9b4773e978f71d78a9376dd5cf99"
+        },
+        "61a1ee589ed67ed9a1260983f8df5738d8f2a02a": {
+            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352807855 +0200",
+            "committer": "Jochen Sprickerhof <g...@jochen.sprickerhof.de> 1612126873 +0100",
+            "message": "Remove imported patches\n\nAnd enable automatic patch-generation.\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>",
             "parents": [
-                "9ff4f5f6853622a95489d2d575c63eceedc203f8"
-            ], 
-            "patchfile": "Remove-imported-patches.patch", 
-            "sha1": "2a17b0d682aa73f10a6e242e0f60408b61812047", 
-            "tree": "771f74c3339e47cf7ad767bd39a27eec4aba4df0"
-        }, 
+                "1a0baea83bfe65a07c1ff4fe596ef46dca04ec08"
+            ],
+            "patchfile": "Remove-imported-patches.patch",
+            "sha1": "61a1ee589ed67ed9a1260983f8df5738d8f2a02a",
+            "tree": "6bbe6c1a3bd49d5eb24f89e1f1df7c1c1c0a8211"
+        },
         "6dccee0ab7689e5ae446d39535138ea39a88e70c": {
-            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352272405 +0200", 
-            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352806279 +0200", 
-            "message": "Add dummy Makefile\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>", 
+            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352272405 +0200",
+            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352806279 +0200",
+            "message": "Add dummy Makefile\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>",
             "parents": [
                 "dc4481d39005968f1f2673d760af69b411eccc33"
-            ], 
-            "patchfile": "Add-dummy-Makefile.patch", 
-            "sha1": "6dccee0ab7689e5ae446d39535138ea39a88e70c", 
+            ],
+            "patchfile": "Add-dummy-Makefile.patch",
+            "sha1": "6dccee0ab7689e5ae446d39535138ea39a88e70c",
             "tree": "afdd4586454b4648d29a606ebf6be9c52708332f"
-        }, 
-        "80d0f75635f6ac35f080736236836aac1e596845": {
-            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1357733987 +0200", 
-            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1448551035 +0200", 
-            "message": "packaging: add alternative spec file and change patch path\n\nAdd a second spec file for testing import-srpm spec guessing.\n\nChange one patch filename to be full url for testing import-srpm patch\nimport functionality.\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>", 
+        },
+        "932739692ad1be099125c6efc5662e9457c7eb66": {
+            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352806552 +0200",
+            "committer": "Jochen Sprickerhof <g...@jochen.sprickerhof.de> 1612126708 +0100",
+            "message": "Add packaging files\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>",
             "parents": [
-                "fb1bf5f16bfa1a4e3ffd29fcc0820bd60fbd1a35"
-            ], 
-            "patchfile": "packaging-add-alternative-spec-file-and-change-patch-p.patch", 
-            "sha1": "80d0f75635f6ac35f080736236836aac1e596845", 
-            "tree": "41d5ec4dfb4b4be0d0552d50f34f5045d4512a46"
-        }, 
-        "9ff4f5f6853622a95489d2d575c63eceedc203f8": {
-            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352807746 +0200", 
-            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1448551036 +0200", 
-            "message": "My addition\n\nImport my2.patch to the git tree.\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>", 
+                "b7b009c4f87828ad51e26c5c62b91b7c5f83cfff"
+            ],
+            "patchfile": "Add-packaging-files.patch",
+            "sha1": "932739692ad1be099125c6efc5662e9457c7eb66",
+            "tree": "142c87348f4f4fb4ea39924bb528085beb9cf1cd"
+        },
+        "95125a3ad44149d372b22bf1f70a4767b59628fe": {
+            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1386843313 +0200",
+            "committer": "Jochen Sprickerhof <g...@jochen.sprickerhof.de> 1612126907 +0100",
+            "message": "Update .gbp.conf\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>",
             "parents": [
-                "189b0a152a6f1405e021c2988755ce2f5d89c998"
-            ], 
-            "patchfile": "My-addition.patch", 
-            "sha1": "9ff4f5f6853622a95489d2d575c63eceedc203f8", 
-            "tree": "472db0daae817c14f1cb74608e1d234758301da0"
-        }, 
-        "a93779ad111470b1619f2ceb7a31dd10d6ad6a4f": {
-            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1386843313 +0200", 
-            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1448551387 +0200", 
-            "message": "Update .gbp.conf\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>", 
+                "dad94e415671a99991753cbb5e67847235a35b28"
+            ],
+            "patchfile": "Update-.gbp.conf.patch",
+            "sha1": "95125a3ad44149d372b22bf1f70a4767b59628fe",
+            "tree": "7c1a65bcda91ace32de3f9457c622730d1ae762b"
+        },
+        "abe1c666034b3831c0fd48ae867f34b95cc00a66": {
+            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1357897260 +0200",
+            "committer": "Jochen Sprickerhof <g...@jochen.sprickerhof.de> 1612126798 +0100",
+            "message": "packaging: reflect the corrected patch number handling\n\nFix spec files as GBP now treats 'Patch:' as patch number -1, instead of\n0.\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>",
             "parents": [
-                "189b0a152a6f1405e021c2988755ce2f5d89c998"
-            ], 
-            "patchfile": "Update-.gbp.conf.patch", 
-            "sha1": "a93779ad111470b1619f2ceb7a31dd10d6ad6a4f", 
-            "tree": "e92ab121d622ee866dffd560ce2dcd561223719b"
-        }, 
+                "fb25577a35d33b3ba29faa0cd10a14baa7d99190"
+            ],
+            "patchfile": "packaging-reflect-the-corrected-patch-number-handling.patch",
+            "sha1": "abe1c666034b3831c0fd48ae867f34b95cc00a66",
+            "tree": "b7aed890f27161d04a457dfbfe76270ae57d03de"
+        },
         "b7b009c4f87828ad51e26c5c62b91b7c5f83cfff": {
-            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352806630 +0200", 
-            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1448551002 +0200", 
-            "message": "Add gbp.conf\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>", 
+            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352806630 +0200",
+            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1448551002 +0200",
+            "message": "Add gbp.conf\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>",
             "parents": [
                 "6dccee0ab7689e5ae446d39535138ea39a88e70c"
-            ], 
-            "patchfile": "Add-gbp.conf.patch", 
-            "sha1": "b7b009c4f87828ad51e26c5c62b91b7c5f83cfff", 
+            ],
+            "patchfile": "Add-gbp.conf.patch",
+            "sha1": "b7b009c4f87828ad51e26c5c62b91b7c5f83cfff",
             "tree": "7a64093756c1668d9d2888473baf9fd4d44ba11b"
-        }, 
-        "db72a4efae2b72b56f7723df844d7a506e549ce1": {
-            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1357897260 +0200", 
-            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1448551036 +0200", 
-            "message": "packaging: reflect the corrected patch number handling\n\nFix spec files as GBP now treats 'Patch:' as patch number -1, instead of\n0.\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>", 
+        },
+        "dad94e415671a99991753cbb5e67847235a35b28": {
+            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1358253459 +0200",
+            "committer": "Jochen Sprickerhof <g...@jochen.sprickerhof.de> 1612126799 +0100",
+            "message": "packaging: change my2.patch to git email format\n\nChange my2.patch from plain diff to git email format to test author and\ndate parsing of gbp.\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>",
             "parents": [
-                "80d0f75635f6ac35f080736236836aac1e596845"
-            ], 
-            "patchfile": "packaging-reflect-the-corrected-patch-number-handling.patch", 
-            "sha1": "db72a4efae2b72b56f7723df844d7a506e549ce1", 
-            "tree": "cc668ba4e00ae7308e6a9f1b2225a820e50f618f"
-        }, 
+                "abe1c666034b3831c0fd48ae867f34b95cc00a66"
+            ],
+            "patchfile": "packaging-change-my2.patch-to-git-email-format.patch",
+            "sha1": "dad94e415671a99991753cbb5e67847235a35b28",
+            "tree": "a92ae21b9be0a79a4f050d788746c378e1e1978c"
+        },
         "dc4481d39005968f1f2673d760af69b411eccc33": {
-            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352272394 +0200", 
-            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352806277 +0200", 
-            "message": "Add dummy files\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>", 
+            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352272394 +0200",
+            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352806277 +0200",
+            "message": "Add dummy files\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>",
             "parents": [
                 "0579e0753b78476ad822c54b6ea07e2e80c0cdd2"
-            ], 
-            "patchfile": "Add-dummy-files.patch", 
-            "sha1": "dc4481d39005968f1f2673d760af69b411eccc33", 
+            ],
+            "patchfile": "Add-dummy-files.patch",
+            "sha1": "dc4481d39005968f1f2673d760af69b411eccc33",
             "tree": "af52702a859e84653bfab0a1e0f9253177772f28"
-        }, 
+        },
         "f89f9c7f4662c16559e6b76771a6f6689d48e2ad": {
-            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1449597175 +0200", 
-            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1449597175 +0200", 
-            "message": "pristine-tar data for gbp-test2-2.0.tar.gz", 
-            "patchfile": "pristine-tar-data-for-gbp-test2-2.0.tar.gz.patch", 
-            "sha1": "f89f9c7f4662c16559e6b76771a6f6689d48e2ad", 
+            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1449597175 +0200",
+            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1449597175 +0200",
+            "message": "pristine-tar data for gbp-test2-2.0.tar.gz",
+            "patchfile": "pristine-tar-data-for-gbp-test2-2.0.tar.gz.patch",
+            "sha1": "f89f9c7f4662c16559e6b76771a6f6689d48e2ad",
             "tree": "29de04114bb7e206a81405bd95bb989fba0bce61"
-        }, 
-        "fb1bf5f16bfa1a4e3ffd29fcc0820bd60fbd1a35": {
-            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1352806552 +0200", 
-            "committer": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1448551003 +0200", 
-            "message": "Add packaging files\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>", 
+        },
+        "fb25577a35d33b3ba29faa0cd10a14baa7d99190": {
+            "author": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1357733987 +0200",
+            "committer": "Jochen Sprickerhof <g...@jochen.sprickerhof.de> 1612126753 +0100",
+            "message": "packaging: add alternative spec file and change patch path\n\nAdd a second spec file for testing import-srpm spec guessing.\n\nChange one patch filename to be full url for testing import-srpm patch\nimport functionality.\n\nSigned-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>",
             "parents": [
-                "b7b009c4f87828ad51e26c5c62b91b7c5f83cfff"
-            ], 
-            "patchfile": "Add-packaging-files.patch", 
-            "sha1": "fb1bf5f16bfa1a4e3ffd29fcc0820bd60fbd1a35", 
-            "tree": "321aba18b5f072ecab528e2b004cdd4396b8c780"
+                "932739692ad1be099125c6efc5662e9457c7eb66"
+            ],
+            "patchfile": "packaging-add-alternative-spec-file-and-change-patch-p.patch",
+            "sha1": "fb25577a35d33b3ba29faa0cd10a14baa7d99190",
+            "tree": "64c4072cf8ed067c18f1f8d77ca112b731aa7b9a"
         }
-    }, 
+    },
     "refs": {
-        "refs/heads/master": "2a17b0d682aa73f10a6e242e0f60408b61812047", 
-        "refs/heads/master-orphan": "a93779ad111470b1619f2ceb7a31dd10d6ad6a4f", 
-        "refs/heads/pristine-tar": "f89f9c7f4662c16559e6b76771a6f6689d48e2ad", 
-        "refs/heads/upstream": "6dccee0ab7689e5ae446d39535138ea39a88e70c", 
-        "refs/tags/release/1%2.0-0": "3ee597fee679b6138467ac62e4f857ef5b59b240", 
-        "refs/tags/release/1%2.0-1": "d586d2c9384b2536bc1db0a6940578533ff9d122", 
+        "refs/heads/master": "61a1ee589ed67ed9a1260983f8df5738d8f2a02a",
+        "refs/heads/master-orphan": "95125a3ad44149d372b22bf1f70a4767b59628fe",
+        "refs/heads/pristine-tar": "f89f9c7f4662c16559e6b76771a6f6689d48e2ad",
+        "refs/heads/upstream": "6dccee0ab7689e5ae446d39535138ea39a88e70c",
+        "refs/tags/release/1%2.0-0": "dad94e415671a99991753cbb5e67847235a35b28",
+        "refs/tags/release/1%2.0-1": "61a1ee589ed67ed9a1260983f8df5738d8f2a02a",
         "refs/tags/upstream/2.0": "c5da8dd1e15c6845f9f7e176a1c5208b5157da14"
-    }, 
+    },
     "tags": {
-        "3ee597fee679b6138467ac62e4f857ef5b59b240": {
-            "message": "Test-Distro release 1:2.0-0", 
-            "object": "189b0a152a6f1405e021c2988755ce2f5d89c998", 
-            "tag": "release/1%2.0-0", 
-            "tagger": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1448551734 +0200", 
-            "type": "commit"
-        }, 
         "c5da8dd1e15c6845f9f7e176a1c5208b5157da14": {
-            "message": "Version 2.0", 
-            "object": "6dccee0ab7689e5ae446d39535138ea39a88e70c", 
-            "tag": "upstream/2.0", 
-            "tagger": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1377529719 +0300", 
-            "type": "commit"
-        }, 
-        "d586d2c9384b2536bc1db0a6940578533ff9d122": {
-            "message": "Test-Distro release 1:2.0-1", 
-            "object": "2a17b0d682aa73f10a6e242e0f60408b61812047", 
-            "tag": "release/1%2.0-1", 
-            "tagger": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1448551738 +0200", 
+            "message": "Version 2.0",
+            "object": "6dccee0ab7689e5ae446d39535138ea39a88e70c",
+            "tag": "upstream/2.0",
+            "tagger": "Markus Lehtonen <markus.lehto...@linux.intel.com> 1377529719 +0300",
             "type": "commit"
         }
     }
diff --git a/gbp-test2.data/packaging-add-alternative-spec-file-and-change-patch-p.patch b/gbp-test2.data/packaging-add-alternative-spec-file-and-change-patch-p.patch
index 1295be9..0cf6d94 100644
--- a/gbp-test2.data/packaging-add-alternative-spec-file-and-change-patch-p.patch
+++ b/gbp-test2.data/packaging-add-alternative-spec-file-and-change-patch-p.patch
@@ -21,7 +21,7 @@ index 3d5f92d..6c8e847 100644
  
 diff --git a/packaging/gbp-test2-alt.spec b/packaging/gbp-test2-alt.spec
 new file mode 100644
-index 0000000..155ea43
+index 0000000..54a8f0e
 --- /dev/null
 +++ b/packaging/gbp-test2-alt.spec
 @@ -0,0 +1,48 @@
@@ -33,10 +33,10 @@ index 0000000..155ea43
 +Group:      Development/Libraries
 +License:    GPLv2
 +Source10:   ftp://ftp.host.com/%{name}-%{version}.tar.gz
-+Source:     foo.txt
++Source0:    foo.txt
 +Source20:   bar.tar.gz
-+# Gbp-Ignore-Patches: 0
-+Patch:      my.patch
++# Gbp-Ignore-Patches: -1
++Patch0:     my.patch
 +Patch10:    http://example.com/patches/my2.patch
 +Patch20:    my3.patch
 +Packager:   Markus Lehtonen <markus.lehto...@linux.intel.com>
@@ -74,16 +74,16 @@ index 0000000..155ea43
 +%dir %{_datadir}/%{name}
 +%{_datadir}/%{name}
 diff --git a/packaging/gbp-test2.spec b/packaging/gbp-test2.spec
-index 61aae33..eec5d26 100644
+index 5121f17..fa28beb 100644
 --- a/packaging/gbp-test2.spec
 +++ b/packaging/gbp-test2.spec
 @@ -8,9 +8,10 @@ License:    GPLv2
  Source10:   ftp://ftp.host.com/%{name}-%{version}.tar.gz
- Source:     foo.txt
+ Source0:    foo.txt
  Source20:   bar.tar.gz
 +Source9999: gbp-test2-alt.spec
- # Gbp-Ignore-Patches: 0
- Patch:      my.patch
+ # Gbp-Ignore-Patches: -1
+ Patch0:     my.patch
 -Patch10:    my2.patch
 +Patch10:    http://example.com/patches/my2.patch
  Patch20:    my3.patch
diff --git a/gbp-test2.data/packaging-reflect-the-corrected-patch-number-handling.patch b/gbp-test2.data/packaging-reflect-the-corrected-patch-number-handling.patch
index a0a2264..971510c 100644
--- a/gbp-test2.data/packaging-reflect-the-corrected-patch-number-handling.patch
+++ b/gbp-test2.data/packaging-reflect-the-corrected-patch-number-handling.patch
@@ -8,28 +8,28 @@ Fix spec files as GBP now treats 'Patch:' as patch number -1, instead of
 Signed-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com>
 
 diff --git a/packaging/gbp-test2-alt.spec b/packaging/gbp-test2-alt.spec
-index 155ea43..be5d8bc 100644
+index 54a8f0e..90dab7c 100644
 --- a/packaging/gbp-test2-alt.spec
 +++ b/packaging/gbp-test2-alt.spec
 @@ -8,7 +8,7 @@ License:    GPLv2
  Source10:   ftp://ftp.host.com/%{name}-%{version}.tar.gz
- Source:     foo.txt
+ Source0:    foo.txt
  Source20:   bar.tar.gz
--# Gbp-Ignore-Patches: 0
-+# Gbp-Ignore-Patches: -1
- Patch:      my.patch
+-# Gbp-Ignore-Patches: -1
++# Gbp-Ignore-Patches: 0
+ Patch0:     my.patch
  Patch10:    http://example.com/patches/my2.patch
  Patch20:    my3.patch
 diff --git a/packaging/gbp-test2.spec b/packaging/gbp-test2.spec
-index eec5d26..5b41aae 100644
+index fa28beb..95c3dc2 100644
 --- a/packaging/gbp-test2.spec
 +++ b/packaging/gbp-test2.spec
 @@ -9,7 +9,7 @@ Source10:   ftp://ftp.host.com/%{name}-%{version}.tar.gz
- Source:     foo.txt
+ Source0:    foo.txt
  Source20:   bar.tar.gz
  Source9999: gbp-test2-alt.spec
--# Gbp-Ignore-Patches: 0
-+# Gbp-Ignore-Patches: -1
- Patch:      my.patch
+-# Gbp-Ignore-Patches: -1
++# Gbp-Ignore-Patches: 0
+ Patch0:     my.patch
  Patch10:    http://example.com/patches/my2.patch
  Patch20:    my3.patch
-- 
2.30.0

Attachment: signature.asc
Description: PGP signature

Reply via email to