sbuild: add Trisquel's auto-selector DistroInfo switch for backports
This commit is contained in:
parent
d61972afb9
commit
6183e8282b
2 changed files with 106 additions and 0 deletions
|
|
@ -0,0 +1,75 @@
|
|||
diff --git a/lib/Sbuild/Conf.pm b/lib/Sbuild/Conf.pm
|
||||
index 79ae1c15..4ae269ce 100644
|
||||
--- a/lib/Sbuild/Conf.pm
|
||||
+++ b/lib/Sbuild/Conf.pm
|
||||
@@ -42,9 +42,35 @@ BEGIN {
|
||||
@EXPORT = qw(new setup read);
|
||||
}
|
||||
|
||||
-my $ubuntu_mmdebstrap_extra_args = {};
|
||||
use Debian::DistroInfo;
|
||||
-for my $series (UbuntuDistroInfo->new()->supported()) {
|
||||
+
|
||||
+# Add distro-info provider auto-detect switch
|
||||
+our $DISTROINFO_CLASS;
|
||||
+our $IS_TRISQUEL = 0;
|
||||
+BEGIN {
|
||||
+ eval {
|
||||
+ require Debian::DistroInfo;
|
||||
+ Debian::DistroInfo->import();
|
||||
+ 1;
|
||||
+ };
|
||||
+ if (defined &UbuntuDistroInfo::new) {
|
||||
+ $DISTROINFO_CLASS = 'UbuntuDistroInfo';
|
||||
+ warn "sbuild: Debian::DistroInfo used: Ubuntu\n";
|
||||
+ } elsif (defined &TrisquelDistroInfo::new) {
|
||||
+ $DISTROINFO_CLASS = 'TrisquelDistroInfo';
|
||||
+ $IS_TRISQUEL = 1;
|
||||
+ warn "sbuild: Debian::DistroInfo used: Trisquel\n";
|
||||
+ } else {
|
||||
+ $DISTROINFO_CLASS = undef;
|
||||
+ warn "sbuild: Debian::DistroInfo not available; mmdebstrap extras disabled at build-time\n";
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+my $ubuntu_mmdebstrap_extra_args = {};
|
||||
+my $trisquel_mmdebstrap_extra_args = {};
|
||||
+
|
||||
+if (defined $DISTROINFO_CLASS && $DISTROINFO_CLASS eq 'UbuntuDistroInfo') {
|
||||
+ for my $series (UbuntuDistroInfo->new()->supported()) {
|
||||
$ubuntu_mmdebstrap_extra_args->{$series} = [ '--components=main,universe' ];
|
||||
# We use snapshot.ubuntu.com here so it works both for ports and non-ports architectures without having to do complicated architecture detection logic
|
||||
$ubuntu_mmdebstrap_extra_args->{"$series-proposed"} = [
|
||||
@@ -63,6 +83,32 @@ for my $series (UbuntuDistroInfo->new()->supported()) {
|
||||
'--components=main,universe',
|
||||
'--setup-hook=sed -i /-updates/d "$1"/etc/apt/sources.list',
|
||||
];
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if (defined $DISTROINFO_CLASS && $DISTROINFO_CLASS eq 'TrisquelDistroInfo') {
|
||||
+ for my $series (TrisquelDistroInfo->new()->supported()) {
|
||||
+ $trisquel_mmdebstrap_extra_args->{$series} = [ '--components=main' ];
|
||||
+ $trisquel_mmdebstrap_extra_args->{"$series-updates"} = [
|
||||
+ '--components=main',
|
||||
+ '--include=ca-certificates',
|
||||
+ '--setup-hook=echo "deb [signed-by=/usr/share/keyrings/trisquel-archive-keyring.gpg] https://archive.trisquel.org/trisquel ' . $series . '-updates main" > "$1"/etc/apt/sources.list.d/updates.list'
|
||||
+ ];
|
||||
+ $trisquel_mmdebstrap_extra_args->{"$series-security"} = [
|
||||
+ '--components=main',
|
||||
+ '--include=ca-certificates',
|
||||
+ '--setup-hook=echo "deb [signed-by=/usr/share/keyrings/trisquel-archive-keyring.gpg] https://archive.trisquel.org/trisquel ' . $series . '-security main" > "$1"/etc/apt/sources.list.d/security.list'
|
||||
+ ];
|
||||
+ $trisquel_mmdebstrap_extra_args->{"$series-backports"} = [
|
||||
+ '--components=main',
|
||||
+ '--include=ca-certificates',
|
||||
+ '--setup-hook=echo "deb [signed-by=/usr/share/keyrings/trisquel-archive-keyring.gpg] https://archive.trisquel.org/trisquel ' . $series . '-backports main" > "$1"/etc/apt/sources.list.d/backports.list'
|
||||
+ ];
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+if ($IS_TRISQUEL) {
|
||||
+ $ubuntu_mmdebstrap_extra_args = $trisquel_mmdebstrap_extra_args;
|
||||
}
|
||||
|
||||
sub setup ($);
|
||||
31
helpers/make-sbuild
Normal file
31
helpers/make-sbuild
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2025 Luis Guzmán <ark@switnet.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
VERSION=1
|
||||
EXTERNAL='deb-src https://archive.ubuntu.com/ubuntu $UPSTREAM-backports main'
|
||||
BACKPORTS=true
|
||||
|
||||
. ./config
|
||||
|
||||
apply_patch_changes
|
||||
|
||||
changelog "Add switch to use Trisquel's DistroInfo on 0.88.3 and later versions"
|
||||
|
||||
package
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue