Package: git-buildpackage
Version: 0.9.34
Severity: wishlist
tags: patch

Dear Maintainer,

when trying to clone libreoffice no upstream metadata was found,
because it lives in upstream/metadata (not debian/upstream/metadata).

$ gbp clone --add-upstream-vcs vcs-git:libreoffice
gbp:info: Cloning from
'https://salsa.debian.org/libreoffice-team/libreoffice/libreoffice.git'
gbp:warning: No upstream metadata, can't track upstream repo


I've attached a small patch that would make gbp look for the metadata
in this other location.

Thanks for maintaining git-buildpackage!


-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.9.10-amd64 (SMP w/32 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages git-buildpackage depends on:
ii  devscripts                       2.23.7
ii  git                              1:2.45.2-1
ii  man-db                           2.12.1-2
ii  python3 [python3-supported-min]  3.12.4-1
ii  python3-dateutil                 2.9.0-2
ii  python3-importlib-metadata       8.2.0-1
ii  python3-pkg-resources            70.3.0-2
ii  python3-yaml                     6.0.1-2+b1
ii  sensible-utils                   0.0.24

Versions of packages git-buildpackage recommends:
ii  cowbuilder        0.90
ii  pbuilder          0.231
ii  pristine-tar      1.50+nmu2
ii  python3-requests  2.32.3+dfsg-1
ii  sbuild            0.85.10

Versions of packages git-buildpackage suggests:
pn  python3-notify2  <none>
ii  sudo             1.9.15p5-3+b1
ii  unzip            6.0-28

-- no debconf information

From 8b3a2cf00e77ef823c0d525f7b69ca5ab23aaf92 Mon Sep 17 00:00:00 2001
From: Evangelos Ribeiro Tzaras <devrtz-deb...@fortysixandtwo.eu>
Date: Sun, 4 Aug 2024 05:57:43 +0200
Subject: [PATCH] clone: Look for upstream metadata in more places

The LibreOffice package on salsa [0] puts the debian packaging
in the root directory, not debian/.

This patch ensures the metadata is found,
allowing --add-upstream-vcs to work.
---
 gbp/scripts/clone.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/gbp/scripts/clone.py b/gbp/scripts/clone.py
index 7e02f0e2..8d3d1bb5 100755
--- a/gbp/scripts/clone.py
+++ b/gbp/scripts/clone.py
@@ -104,8 +104,15 @@ def repo_to_url(repo):
 
 
 def add_upstream_vcs(repo):
-    upstream_info = os.path.join('debian', 'upstream', 'metadata')
-    if not os.path.exists(upstream_info):
+    upstream_info = None
+    candidates = [os.path.join('debian', 'upstream', 'metadata'), os.path.join('upstream', 'metadata')]
+
+    for info in upstream_info_candidates:
+        if os.path.exists(info):
+            upstream_info = info
+            break
+
+    if upstream_info is None:
         gbp.log.warn("No upstream metadata, can't track upstream repo")
         return
 
-- 
2.45.2

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to