Skip to content

Commit 05ca235

Browse files
Syeda Shagufta Naazfmoessbauer
authored andcommitted
fix(repack): correct apply-patches handling and exclude upstream tarballs
The --apply-patches flag was not propagated to the packer, causing dpkg-source to always use --skip-patches and omit the .pc directory in merged source archives. Additionally, the repack step included the upstream .orig.tar.* file alongside the extracted source tree. Forward the flag correctly and ensure only the unpacked source directory is included in the merged tarball. Fixes: b1837f8 ("feat: add command to create a standard bom ...") Signed-off-by: Syeda Shagufta Naaz <[email protected]>
1 parent a45ba32 commit 05ca235

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/debsbom/commands/repack.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ def run(cls, args):
4141
pkg_subset = None
4242

4343
packer = Packer.from_format(
44-
fmt=args.format, dldir=Path(args.dldir), outdir=Path(args.outdir), compress=compress
44+
fmt=args.format,
45+
dldir=Path(args.dldir),
46+
outdir=Path(args.outdir),
47+
compress=compress,
48+
apply_patches=args.apply_patches,
4549
)
4650
resolver = cls.get_sbom_resolver(args)
4751
bt = BomTransformer.create(args.format, resolver.sbom_type(), resolver.document)

src/debsbom/repack/merger.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ def merge(
166166
)
167167

168168
# repack archive
169-
sources = [s.name for s in Path(tmpdir).iterdir() if s.is_dir() or s.is_file()]
169+
sources = [
170+
s.name for s in Path(tmpdir).iterdir() if s.is_dir() and (s / "debian").is_dir()
171+
]
170172
tmpfile = merged.with_suffix(f"{merged.suffix}.tmp")
171173

172174
if not mtime:

0 commit comments

Comments
 (0)