On Wednesday, November 13, 2024 4:09:28 PM MST Serafeim (Serafi) Zanikolas wrote: > On Tue Nov 12, 2024 at 4:12 AM CET, Soren Stoutner wrote: > > In addition to adding an adequate Salsa CI job, you might also consider > > updating the .sbuildrc example to contain the necessary information to also > > run adequate (assuming it isn’t too complicated). > > > > https://wiki.debian.org/sbuild#Setup > > that makes sense. here's the .sbuildrc snippet I came up with: > > $external_commands = { > "chroot-cleanup-commands" => [ > [ 'apt install -y --install-recommends adequate' ], > [ 'perl -e \'open(FH, ">", "/var/lib/adequate/pending") or die $!; while > (<>) { my @c=split(" ", $_); print FH "$c[1]\n" if $c[0] eq "Package:" }; > close(FH);\' %SBUILD_PKGBUILD_DIR/debian/control' ], [ 'adequate', '--fail', > '--pending' ], > ] > }; > > before I update the wiki, any suggestions on how to simplify? it'd be much > simpler if: > > - sbuild external commands would allow for subshells: > adequate --fail $(grep ^Binary: %SBUILD_PKGBUILD_DIR/debian/control' | cut > -d: -f2) - sbuild would populate an escape variable with the list of built > binary packages: > adequate --fail %SBUILD_BINARY_PKG_NAMES > > thanks, > serafi
The sbuild page has recently been edited to handle the new unshare backend.
The current version of the adequate code on the page is as follows:
## run adequate(1) and fail upon policy errors. Depends on adequate >= 0.17.2.
$external_commands = {
"chroot-cleanup-commands" => [
[ 'apt install -y --install-recommends adequate' ],
[ ‘/usr/share/doc/adequate/examples/sbuild-hook’,
’%SBUILD_PKGBUILD_DIR’],
]
};
This code produces an error for me:
I: Finished running 'apt install -y --install-recommends adequate'.
/usr/share/doc/adequate/examples/sbuild-hook /<<PKGBUILDDIR>>
---------------------------------------------------------------------------------------------------
2024/11/25 22:37:58 "dpkg-query -Wf ${binary:Package} ${Package};${Status};$
{Provides}\n -- feather-wallet" failed: exit status 1
E: Command '/usr/share/doc/adequate/examples/sbuild-hook /<<PKGBUILDDIR>>'
failed to run.
The example code above in the email also produces an error:
I: Finished running 'apt install -y --install-recommends adequate'.
perl -e 'open(FH, ">", "/var/lib/adequate/pending") or die $!; while
(<>) { my @c=split(" ", $_); print FH "$c[1]\n" if $c[0] eq "Package:" };
close(FH);' /<<PKGBUILDDIR>>/debian/control
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I: Finished running 'perl -e 'open(FH, ">", "/var/lib/adequate/pending") or
die $!; while
(<>) { my @c=split(" ", $_); print FH "$c[1]\n" if $c[0] eq "Package:" };
close(FH);' /<<PKGBUILDDIR>>/debian/control'.
adequate --fail --pending
-------------------------
2024/11/25 22:46:14 "dpkg-query -Wf ${binary:Package} ${Package};${Status};$
{Provides}\n -- feather-wallet" failed: exit status 1
E: Command 'adequate --fail --pending' failed to run.
Finished processing commands.
--
Soren Stoutner
[email protected]
signature.asc
Description: This is a digitally signed message part.

