XPost: linux.debian.bugs.dist
From: guillem@debian.org
Hi!
On Thu, 2025-03-13 at 16:25:16 +0100, Daniel Gr€€ber wrote:
> Package: dpkg-dev
> Version: 1.21.22
> Severity: normal
> X-Debbugs-Cc: dxld@darkboxed.org
> I'm trying to use source/format 3.0 (git) to share a git-bundle of some WIP
> packaging changes with another DD.
>
> The package in question rubs dpkg-source the wrong way:
>
> dpkg-source: error: git repository yosys uses submodules; this is not
yet supported
>
> However the packaging repo itself doesn't have submodules initialized so I
> don't think there is any real problem.
>
> Looking at Dpkg/Source/Package/V3/Git.pm the check is simply based on the
> presence of the .gitmodules config file.
>
> I believe the correct logic to check if submodules are actually in-use in
> the current repo would be to check if `git submodule status` returns
> non-empty output.
>
> What do you think?
Yes, this makes sense, thanks! Would the attached patch work for you?
Thanks,
Guillem
From f02e7b35f2669f8db251b269a5fb180fb99096e0 Mon Sep 17 00:00:00 2001
From: Guillem Jover
Date: Wed, 13 Aug 2025 07:47:07 +0200
Subject: [PATCH] =?UTF-8?q?Dpkg::Source::Package::V3::Git:=20Use=20=C2=ABg?=
=?UTF-8?q?it=20submodule=C2=BB=20for=20its=20status?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Instead of only relying on the .gitmodules being non-empty, call
=C2=ABgit submodule status --recursive=C2=BB to check whethere there is any
submodule in use.
Suggested-by: Daniel Gr=C3=B6ber
Closes: #1100413
---
scripts/Dpkg/Source/Package/V3/Git.pm | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/scripts/Dpkg/Source/Package/V3/Git.pm b/scripts/Dpkg/Source/Pa=
ckage/V3/Git.pm
index 3d4d8b3da..723424c8d 100644
--- a/scripts/Dpkg/Source/Package/V3/Git.pm
+++ b/scripts/Dpkg/Source/Package/V3/Git.pm
@@ -41,6 +41,7 @@ use Dpkg::Gettext;
use Dpkg::ErrorHandling;
use Dpkg::Exit qw(push_exit_handler pop_exit_handler);
use Dpkg::Path qw(find_command);
+use Dpkg::IPC;
use Dpkg::Source::Functions qw(erasedir);
=20
use parent qw(Dpkg::Source::Package);
@@ -70,8 +71,19 @@ sub _check_workdir {
'specified'), $srcdir);
}
if (-s "$srcdir/.gitmodules") {
- error(g_('git repository %s uses submodules; this is not yet suppo=
rted'),
- $srcdir);
+ my $stdout;
+
+ spawn(
+ exec =3D> [ qw(git submodule status --recursive) ],
+ chdir =3D> $srcdir,
+ wait_child =3D> 1,
+ to_string =3D> \\$stdout,
+ );
+ if (length $stdout) {
+ error(g_('git repository %s uses submodules; ' .
+ 'this is not yet supported'),
+ $srcdir);
+ }
}
=20
return 1;
--=20
2.50.1
--- SoupGate-Win32 v1.05
* Origin: you cannot sedate... all the things you hate (1:229/2)
|