From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 02 Oct 2026 09:05:13 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f191.google.com (mail-lj1-f191.google.com [209.85.208.191]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 69275C5j004212 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 2 Oct 2026 09:05:12 +0200 Received: by mail-lj1-f191.google.com with SMTP id 38308e7fff4ca-3a78524ac3csf708301fa.3 for ; Fri, 02 Oct 2026 00:05:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1790924707; cv=pass; d=google.com; s=arc-20260327; b=OPh9B2UNIRl4nOgQ7fYuCjojkbFrHNOnJbVSfi9YCZ+0sTZ5z2GSOEGHo2og7SBGIG 54Pq8JcgjD9xeUGrgwpIOEyUn8cTl2y0WDSil0iX4sE+G6VoqKjkz9RPpP0vrIpGjPgr LCbCX2huT/rWU9Bs8iqaifEeMMNmzD+rMEvcv2RaaIMXhjabgmAYx5rMnapkZjyxoi8x SFlxxl1Ha4dbWRoSIJHgc0Mi3iFC3GpGMVN+l5nEMkAwUz3xgHgxn8OW6OoUxFIQ0wUX JEGPBFG1nvslcOIRNqNWdjlqj4li5vt7nYGr+t+zBCKUzj/9cr3i/zNVvvAemyuyh1Nd ugsw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=yIpwCR/ijoFVO9gCHFrI2puMvUZbZUDOi1NV5qsBTVc=; fh=R4AHRLrM4UQViikgCkn4VDY+0rYCU7iKMkYs7YsYp+o=; b=XaRNZ8vISasYOxAMLKRccOB3oGNzoCmytkMlf5iT4J6MKtozxI7D8l14ESytDrhIpD 1Ba4m1GlDtEgcxseN+pamUJqzMTR9Buo7RPJx9SCmAOtycjFHMX+QRkUr8y4xpHd3qOv EU3H8BQ0tVALy1gLFtLL0DaWQnZVnt7utkybvczegztMynfdJbEoKO3ZREJfjIEF8Js1 a1BHC5Oddil1e5JniEQiZcu6gaGYTKcqBOe9QWj/TQbd9Ob6MpDsUjEUmkXiiHu4uAUd Spaty2Tc31tAenJSYBMHIqGY4gO6L9P3LhsuG8dOQoERzoLeboEpQBF9zKoamVgJBTQs nMow==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of akarpovich@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=akarpovich@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20251104; t=1790924707; x=1791529507; darn=ilbers.de; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:content-type :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :from:to:cc:subject:date:message-id:reply-to:content-type; bh=yIpwCR/ijoFVO9gCHFrI2puMvUZbZUDOi1NV5qsBTVc=; b=kz1+ZX9c3LKFa59NnYdJP7+KSMbqK98t3iO9i6pkgvCQubTiUu8AvRWl9rPZasIXDK vBKG2JR4K43Zk23cwAJ8W0L7ktzpbQo4Fb2Kb5M7Gv6V8/7kgaT0WNy9bq+egbaLiYwm p1QVFTgtNjDxo3tOBxpF9eqqXPg6p64t0CccVAADEeWtGfipr0TZsmoK5pvBohZ7OGdL NvRYGUXXv9UAXGcXKK+9PwClIf9aBtltRfXEsSsNUatCHvqKO4OEE/29M3gf+TVGn83X qe6gfSFM9DuhlKZt+yBx4DstDm4lWsTwYRqGe0zX47az05WRClRrSJBHzRxenYg1VLzf +uMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790924707; x=1791529507; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :content-type:x-original-authentication-results:x-original-sender :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to:content-type; bh=yIpwCR/ijoFVO9gCHFrI2puMvUZbZUDOi1NV5qsBTVc=; b=bAPsPL6kJ0Hf+g9zqkySvXH5+jI4DpcD5tLRbvwLIGTmE2C/YQp8FluDBMEV1+/GQN /1RZOW6cWkd+TQ9RY5fuFFEzk1dR6/UMUdam74pCf6B5yKLms/harp2IebkMi7NlRhSQ yQ2w66G88lX5xAC/2Mh/UqJB3nR5qNRKoiuauBKcJUfwU6dl6fCTRE/baZIHoxApyEC1 nW9xRPQZe+fN1OkAV+Tbfv2DR+McA30Tnvjdvhpip6/iRF8uxF3DNqpLh21LuNNaEeP0 gurJzkZbufiMGFYgp/DJew7ZkTRI9aMj8HoZMjXVfg8n7i66eAB5iS4f5QdUb8Ryv3b6 Zg3A== Sender: isar-users@googlegroups.com X-Forwarded-Encrypted: i=2; AKwUvByOlo354COVNHHKa1VWjjKPwbehUiNtKyvWdZ6Cr5FehW1dzw3ymLqZk9gq5ChGWSXfLUZZ@ilbers.de X-Gm-Message-State: AFq9FYJ8vkBt+JrGiG+Wt20hD6LlL66iLfELLLlNqhc+WpwxHCbyOIME 8srR0+UAzUqNEQDHZLUbOkN/E2Wxv0d6cd9J2rJjJQpdqul3id4AOqb1 X-Received: by 2002:a05:651c:1b84:b0:3a6:629e:447c with SMTP id 38308e7fff4ca-3a8827de31amr3189791fa.1.1790924706865; Fri, 02 Oct 2026 00:05:06 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h="ATskLdfS9remxdMpfolQ+SsUihCTw8FH9BcfXVL9+KngO/qb6w==" Received: by 2002:a2e:9dd7:0:b0:3a6:4926:b36c with SMTP id 38308e7fff4ca-3a8a31cfb9fls1276041fa.0.-pod-prod-09-eu; Fri, 02 Oct 2026 00:05:04 -0700 (PDT) X-Received: by 2002:a2e:b88b:0:b0:3a7:69bd:80ad with SMTP id 38308e7fff4ca-3a8877e829fmr3863981fa.6.1790924704431; Fri, 02 Oct 2026 00:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790924704; cv=none; d=google.com; s=arc-20260327; b=Udng/A3n+91xN0/wNWFEGQgaPV/Py/SLGDlL0uFwTWRsOVvevQPwJus7KVHKS1j46g GtDyM0Hgk1yRbnNgiUCBgWXBJHVI5G2HLmy66n01NGhDlbiqbjozOLaAmj3qShPww5Jl uy3yA+ArSu7Ucq9NVZViJs3C/WDFuwtrxMtbv4D30jKOpZMu55cj+dI1YxWnqrNWObDU TsdR/zp9DBcKxYjX4b795S6ySKOUtJwdEi5oGTRzF9Rvi1v0lBBxex2AC6B0h+AEhVOW l8EZIIuwDiP72iO46c0WbYwrOUSXtv7yu7Br/FHUs/oD99dRNfnuk6+h3FDzvSCbC9tB 1Wrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=uoNsvHCWo0EqXpjLKWpWuF6AtgPN7r4tHaHy/IoTbAI=; fh=u+3kXEMzY4uVhDBiujW2QUo7NnpMLrGEgMQBYpCTRN4=; b=BhvIZklSe76V/3PqC0f1tKXGdBIwwNrOAFZb9+R7Xw1aMo3OtSg/lX2c0TDts9vciJ 9TWQyqx9aX8aG5E6r3t336xGj4Eg2uoFo4g/1ZsSVGsF3M11sk3HtpAV2dwVivA7n44O MRdZrkK+rn4yBh6WpF8w90zSRdO8V2XFzKwOrt2okiYOiiSYSEnUaUVwUo2ldskyTMuA oLEmSlribOSGZJ5luo9ThGspyD+/PZxV1HQF18ulNqAMHC90dm46zuvHAIq6MVXeHy3i 550GDGsuLnuVFd8YsBcKJo50UEtTMPeb6z1rBCwfrNcokR7y1i5vxO3rTdm6+n5jh3bB FAgw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of akarpovich@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=akarpovich@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id 38308e7fff4ca-3a87e339376si264021fa.8.2026.10.02.00.05.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Oct 2026 00:05:04 -0700 (PDT) Received-SPF: pass (google.com: domain of akarpovich@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from laptop-0xxx (62.122.174.6.serverel.net [62.122.174.6] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 69274a1q003799 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 2 Oct 2026 09:05:03 +0200 From: akarpovich To: isar-users@googlegroups.com Cc: Aliaksei Karpovich Subject: [v11 11/12] debrepo: Add override for reprepro Date: Fri, 2 Oct 2026 09:01:14 +0200 Message-ID: <20261002070335.26526-12-akarpovich@ilbers.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261002070335.26526-1-akarpovich@ilbers.de> References: <20261002070335.26526-1-akarpovich@ilbers.de> MIME-Version: 1.0 X-Spam-Status: No, score=-4.6 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-Original-Sender: akarpovich@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of akarpovich@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=akarpovich@ilbers.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-TUID: EmV0+gmCb3iL From: Aliaksei Karpovich It fixes an issue when bootstrap image in case of offline build is different than online. It happens because some packages has different Priority field because of override. F.e. libtext-wrapi18n-perl in trixie: - inside deb package: 'Priority: required' - inside Packages from deb repo: 'Priority: optional' Solution: download the override file from repo and pass it to reprepro. Signed-off-by: Aliaksei Karpovich --- scripts/deb-repo | 97 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 88 insertions(+), 9 deletions(-) diff --git a/scripts/deb-repo b/scripts/deb-repo index 23de0461..99913fb4 100755 --- a/scripts/deb-repo +++ b/scripts/deb-repo @@ -89,6 +89,8 @@ import shutil import subprocess import pickle import urllib.parse +import urllib.request +import gzip import apt_pkg import apt.progress.base @@ -96,8 +98,38 @@ import apt.progress.base REPREPRO_TIMEOUT = 1200 +def parse_aptsources_list_line(source_list_line): + import re + + s = source_list_line.strip() + + if not s or s.startswith("#"): + return None + + type, s = re.split(r"\s+", s, maxsplit=1) + if type not in ["deb", "deb-src"]: + return None + + options = "" + options_match = re.match(r"\[\s*(\S+=\S+(?=\s))*\s*(\S+=\S+)\s*\]\s+", s) + if options_match: + options = options_match.group(0).strip() + s = s[options_match.end():] + + source, s = re.split(r"\s+", s, maxsplit=1) + + if s.startswith("/"): + suite = "" + else: + suite, s = re.split(r"\s+", s, maxsplit=1) + + components = " ".join(s.split()) + + return [type, options, source, suite, components] class DebRepo(object): + BOOTSTRAP_LIST = "/etc/apt/sources.list.d/bootstrap.list" + class DebRepoCtx(object): def __init__(self, workdir): self.distro = "debian" @@ -181,9 +213,9 @@ class DebRepo(object): with open(f"{self.workdir}/var/lib/dpkg/status", "w"): pass - os.makedirs(f"{self.workdir}/etc/apt/sources.list.d", exist_ok=True) + srcfile = f"{self.workdir}{self.BOOTSTRAP_LIST}" + os.makedirs(os.path.dirname(srcfile), exist_ok=True) - srcfile = f"{self.workdir}/etc/apt/sources.list.d/bootstrap.list" if aptsrcsfile and os.path.exists(aptsrcsfile): shutil.copy(aptsrcsfile, srcfile) else: @@ -201,13 +233,60 @@ class DebRepo(object): def create_repo_dist(self): conf_dir = f"{self.ctx.repodir}/{self.ctx.distro}/conf" os.makedirs(conf_dir, exist_ok=True) - if not os.path.exists(f"{conf_dir}/distributions"): - with open(f"{conf_dir}/distributions", "w") as f: - f.write(f"Codename: {self.ctx.codename}\n") - f.write( - "Architectures: " - "i386 armhf arm64 amd64 mipsel riscv64 source\n") - f.write("Components: main\n") + override_fname = "override" + self.create_override(f"{conf_dir}/{override_fname}") + with open(f"{conf_dir}/distributions", "w") as f: + f.write(f"Codename: {self.ctx.codename}\n") + f.write( + "Architectures: " + "i386 armhf arm64 amd64 mipsel riscv64 source\n") + f.write("Components: main\n") + f.write(f"DebOverride: {override_fname}\n") + + def create_override(self, override_file): + deb_override_name = f"override.{self.ctx.codename}.main" + deb_override_file = f"{self.workdir}/tmp/{deb_override_name}" + if (not os.path.exists(deb_override_file) or + os.path.getsize(deb_override_file) < 1): + # Extract source URL + srcfile = f"{self.workdir}{self.BOOTSTRAP_LIST}" + with open(srcfile, "r") as f: + for line in f: + entry = parse_aptsources_list_line(line) + if entry: + source_url = entry[2] + # Download override file + self.fetch_file(f"{source_url}/indices/{deb_override_name}") + if (os.path.exists(deb_override_file) and + os.path.getsize(deb_override_file) > 1): + break + # Download packet override file + self.fetch_file(f"{source_url}/indices/{deb_override_name}.gz") + # Unpack override file + with gzip.open(f"{deb_override_file}.gz", "r") as f_in, open(deb_override_file, "wb") as f_out: + for line in f_in: + f_out.write(line) + break + + with open(override_file, "w") as f_out: + # Unpack deb override file + with open(deb_override_file, "r") as f: + # Convert deb override to reprepro override + for line in f: + fields = line.strip().split() + + if len(fields) < 3: + continue + + package = fields[0] + priority = fields[1] + section = fields[2] + + f_out.write(f"{package} Priority {priority}\n") + f_out.write(f"{package} Section {section}\n") + + if f_out.tell() < 1: + print("WARNING: override file is empty!") def apt_config(self, init, crossbuild): if not init and self.ctx.compatarch: -- 2.53.0 -- You received this message because you are subscribed to the Google Groups "isar-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/isar-users/20261002070335.26526-12-akarpovich%40ilbers.de.