Skip to content

Add caller-controlled orig tarball assembly for externally-prepared source trees#27

Open
bjordiscollaku wants to merge 2 commits into
mainfrom
feat/generate-source-package-non-gbp-quilt
Open

Add caller-controlled orig tarball assembly for externally-prepared source trees#27
bjordiscollaku wants to merge 2 commits into
mainfrom
feat/generate-source-package-non-gbp-quilt

Conversation

@bjordiscollaku
Copy link
Copy Markdown

@bjordiscollaku bjordiscollaku commented May 19, 2026

Problem

generate-source-package has no mechanism to handle source trees that
were assembled externally and have no upstream tarball available via gbp
or pristine-tar. Attempting to build such a package causes gbp to fail
when it cannot locate or reconstruct the orig tarball.

Solution

Add a DEBUSINE_ASSEMBLE_ORIG environment variable (default: false).
When set to true, the script:

  1. Creates the .orig.tar.gz directly from the source tree, excluding
    debian/ (the packaging overlay) and .git/ (version-control history)
  2. Invokes dpkg-buildpackage -S to produce the .dsc, .debian.tar.xz,
    and .changes files

The caller, which has full knowledge of its own packaging structure and
upstream tarball availability, sets this flag explicitly. All existing
gbp-managed paths are unchanged.

Rationale

Callers such as pkg-linux-qcom assemble their source tree at CI time
with no upstream tarball available via gbp or pristine-tar. An explicit
flag makes the contract between caller and script unambiguous and avoids
encoding packaging decisions as heuristics inside this script.

Testing

Validated against pkg-linux-qcom (3.0 (quilt)), kernel
7.1.0-rc2-qcom-next-20260515, suite trixie:

linux-image-7.1.0-rc2-qcom-next-20260515-qcom_1.orig.tar.gz
linux-image-7.1.0-rc2-qcom-next-20260515-qcom_1-1.debian.tar.xz
linux-image-7.1.0-rc2-qcom-next-20260515-qcom_1-1.dsc
linux-image-7.1.0-rc2-qcom-next-20260515-qcom_1-1_source.changes

The existing gbp-managed path was not exercised by this change and remains
unmodified.

@bjordiscollaku bjordiscollaku changed the title generate-source-package: support 3.0 (quilt) packages without gbp.conf generate-source-package: add non-gbp path for 3.0 (quilt) packages with externally-assembled source trees May 19, 2026
@bjordiscollaku bjordiscollaku changed the title generate-source-package: add non-gbp path for 3.0 (quilt) packages with externally-assembled source trees Add source package generation support for 3.0 (quilt) packages without gbp.conf May 19, 2026
Add a new code path for 3.0 (quilt) packages that have no debian/gbp.conf
(e.g. pkg-linux-qcom). In this case the source tree has been prepared
externally and there is no pristine-tar branch or upstream tag available
to reconstruct the orig tarball via gbp.

When this condition is met, the script:
1. Creates the .orig.tar.gz directly from the source tree, excluding
   debian/ (the packaging overlay) and .git/ (version-control history),
   which are not part of the upstream source.
2. Invokes dpkg-buildpackage -S to produce the .dsc, .debian.tar.xz,
   and .changes files.

The detection criterion — absence of debian/gbp.conf — is the canonical
indicator that a quilt package is not managed by gbp. All existing
gbp-managed quilt packages and native packages continue to use the
existing code path unchanged.

Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
…emble-orig flag

Previously, the script detected externally-assembled source trees by
checking for the absence of debian/gbp.conf. This is a heuristic:
generate-source-package should not be making packaging decisions based
on the presence or absence of configuration files it does not own.

Replace the implicit detection with an explicit DEBUSINE_ASSEMBLE_ORIG
environment variable (default: false). When set to 'true', the script
creates the .orig.tar.gz directly from the source tree (excluding
debian/ and .git/) and invokes dpkg-buildpackage -S, bypassing gbp
entirely.

This places the decision with the caller, which has full knowledge of
its own packaging structure and upstream tarball availability. The
gbp.conf detection logic is removed entirely from this script.

Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>
@bjordiscollaku bjordiscollaku force-pushed the feat/generate-source-package-non-gbp-quilt branch from 12381f1 to 1eabfae Compare May 21, 2026 22:02
@bjordiscollaku bjordiscollaku changed the title Add source package generation support for 3.0 (quilt) packages without gbp.conf generate-source-package: add assemble-orig flag for externally-assembled source trees May 21, 2026
@bjordiscollaku bjordiscollaku changed the title generate-source-package: add assemble-orig flag for externally-assembled source trees Add caller-controlled orig tarball assembly for externally-prepared source trees May 21, 2026
@bjordiscollaku bjordiscollaku requested a review from basak-qcom May 21, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant