Message ID | 20241122054816.3371334-4-cedric.hombourger@siemens.com |
---|---|
State | Under Review, archived |
Headers | show
Return-Path: <isar-users+bncBDB6LLF7YUBRBN5WQC5AMGQEGXKTBXQ@googlegroups.com> Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 22 Nov 2024 06:48:47 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-pj1-f58.google.com (mail-pj1-f58.google.com [209.85.216.58]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 4AM5mj6v016376 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <iupwgm@isar-build.org>; Fri, 22 Nov 2024 06:48:46 +0100 Received: by mail-pj1-f58.google.com with SMTP id 98e67ed59e1d1-2ea050e557dsf2067147a91.1 for <iupwgm@isar-build.org>; Thu, 21 Nov 2024 21:48:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732254519; cv=pass; d=google.com; s=arc-20240605; b=OzJ0fBsl2UrRFObBG8NTRBkFTGzZu/dufirbLN/SeJZ8lqHqL9rIYOWfHwmS93zTtV qItaOYehpoVUTLsR6LvAQ/ckiPIj24ikB98v4XxFasWJ7kw3n1abmxvVskWX32b6arHO 2iQWh74KUKcw3cfOF7rBZbJ3eYQkgMx0vUk1KC68WB81JdE9AWtvP1YwtE8LeJEBAH0y oaK8U7rtPjx+m+CfJs7Lu3T/JMe9+nUna8Gvqw2rIl8KLDQOBPE2r0mjeRztpDKHCPB3 xQRxzbGMwaUn82p9X1Mqp58gm7yy4NxvzTgBacNTzdUbGrlg4k7I4GRxZHazSUnObSbM rR1A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=B86dtcdM78NLgnQ8ggNDD/IGsOD5jRewG0olTFWXHj8=; fh=XqL4o4vj+V5Wh0ApTM3Us4H+U3slMTY4C8LqBztB/Ag=; b=XlatjLDldPRv4aC6HIReYq/KGxFDqO7YMLYnxZgBwGY/ZwLgkFpNemAw/Ml5XgbZwI dwflyPmoNr6BJ2LDqqByBt2f4bVQFHisefkBNCa5UE6oLpf5TQeAvseAAQnN91ANbQuC zlRzWerfhlVfGORu2MXq2s5x7h6Fs5Cb3wFEL1l/QgxKc8By0r4cmjXI1haAgKW/M+YD Vfj/2eDdYdsSjj/TdlG/jjGw1bNCwPscbqb98717toopBGnvxHzgPOXMWM2M9oFXf+tw HCN5yj4VXMzfBkHJbBXa7IJZR9MZHk5ZcfmxqAWePdRx+JGHymgOx4fL9Gl87WcU7804 a/YQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=X+Y05Y7f; spf=pass (google.com: domain of fm-1212295-202411220548353e145e0537c4339d70-vwqxhf@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1212295-202411220548353e145e0537c4339d70-VWqXhf@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1732254519; x=1732859319; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=B86dtcdM78NLgnQ8ggNDD/IGsOD5jRewG0olTFWXHj8=; b=J3cq+ocof5BDJetAhyaix8mi7FpsMBlmdkHDoCJvj/IptqZY07kB1/Pbu8jrxiCelG dqUt+oGk/JMm0ApLEKkrJ+Ogl2jCbs0G92a3XiYnnkapFUGJMJF1qHWzHB0NzqrFoq6u Qw4GdkWk+ZpXdO7NIdKcl0KAbNNAFQLP8eoSRZtHwpwUjglvDO5lFJwt0XsV7X0hpNy6 vI+W0LdVdZdALggpXIRYA6v8fmohj9vdcXp0wg7dVq7ud6qPpYTaEIiVYlxoV1HAZZuO Uw7U8yV3YxCxUw59qIGf0BaTBmrayXcBRgSLYAhWtyvYumaWMPWqgZ3X8QuPqCGaFLVq fP2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732254519; x=1732859319; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=B86dtcdM78NLgnQ8ggNDD/IGsOD5jRewG0olTFWXHj8=; b=D3H2vwlzXgDWOjlWdZeiOZX3KYL532DViAlApo+P2+TFO3V4Q791Hi/fRApF1Kv9BZ phyqym5s2hO3WBbZ649WQP8cpLYgBzP6x+FAGXVVBvqbUC8U1r59GdGvaU7mxYx7PDVc 3L4QUnoxKTWCtuSUkBZI5F0K9JAbu2wsiHzvoAin25/+hSOTT2vzrLNlaTAtcSMU66oC Fg3FVhBSZYiFl2WJVuht8WoD4MsVUEy2OAkdBvpkOvJBYXb3C6R/dPfEfOmkhYdvjDO1 1h0DEWVFAiwXlSFar6j8yFpSeZl7C98h0wfaVMafxuKDKY7rYM/etm3Aq9Gr9wEeM+3E lRWg== X-Forwarded-Encrypted: i=2; AJvYcCWkiuqjWlPkxqyHgGcxSld9fveIeFZTH0pYSa0RTZffdpbOD1jhzRtITHjjrTe2oF4vXwi9dMw=@isar-build.org X-Gm-Message-State: AOJu0YykVoZF6oZ0178f9n/AHOJ23Jp8WQRpGwvTcy9ORwnAKA49rmvL /2VHbE3HK9QH6xDAMlhHcCa2gHFG55KohpwqBE15LwsVP9oqL1Od X-Google-Smtp-Source: AGHT+IFasmD2+I+AVhuXpIY4p2f/1LfZA5Qvmno+zR6BULfSNKra1cJlxTKau50oKsB1OVfwEN2FwQ== X-Received: by 2002:a17:90b:380e:b0:2ea:bea2:dff3 with SMTP id 98e67ed59e1d1-2eb0e23243amr1767096a91.13.1732254519523; Thu, 21 Nov 2024 21:48:39 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:90b:380d:b0:2ea:377d:5c8e with SMTP id 98e67ed59e1d1-2eaebc20711ls1450474a91.1.-pod-prod-08-us; Thu, 21 Nov 2024 21:48:38 -0800 (PST) X-Received: by 2002:a17:90b:4b4f:b0:2ea:4a6b:79d1 with SMTP id 98e67ed59e1d1-2eb0e2303efmr1895357a91.11.1732254518260; Thu, 21 Nov 2024 21:48:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732254518; cv=none; d=google.com; s=arc-20240605; b=Tn58s1PgSTIQTTcY+QW62zDVKYZy2VrPLivTGkocWPEq79nxzLKUXxF8fu/1GUXJmE qMgt2i1ejvP2NeJUdDQ7BTgCDp8am7eRxG0TwRhZE1iexb8ecyAwNetTSsdhCUvZdnB4 5p4ixRinCmYvAgS6gd4hu6J+EzUwJXijqXQZYm+U86xNYvG4Gl0mPfULgXRm+Jv+GqdX webYkOl+Jx+2L2ZnsB64pupeBPhSxTRwWhTegOpTs/CLfB0nZZ2+QqiXhNHfO6JSNu86 fYrKj4EM8RHvom+++jN+ChMF/gWTIw628iIF8ANj/oKlLtkvXSiJ1qeFfD2QDHTfcRvd 01FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=ZGzOY78SUuXcDSG7C02WWV0H8xbKp08xJLavXwJxxD4=; fh=1z37pEVhqwMLlkT4FDzOga7XBsM6Rzv6sXOq0pipxqo=; b=flWq8i4t4/fNQbQGVGmWmyZjYUfL0ArNbkslpsyC1I5uxK6SiEnySCAwuowYhxmGhe X9N0NrsxYdC1B/5XK6kfTCowmzfBjV/nbow18PLjAMwhx4fF8F7zlK0JYbYqB0izOBV2 pYMkAouI1afluk4N4j/+l859PBxwCO7wFq0QAqmW2oSIlzFVz435JdNelv2R9VW4TNOJ gAad4F49/tBw6bHFXFLC7egIr2jQsf3YZjkUbq8E2VIxCWUEDaVRG2zIWimRWuy1947K LrNJ8QbOHg+FPqeoMTEdckUAn9deUyzMWGAqFx6CrUSTqKmtq56fcuAwdq7kWv2WfEMM dAHg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=X+Y05Y7f; spf=pass (google.com: domain of fm-1212295-202411220548353e145e0537c4339d70-vwqxhf@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1212295-202411220548353e145e0537c4339d70-VWqXhf@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net. [185.136.65.227]) by gmr-mx.google.com with ESMTPS id 98e67ed59e1d1-2eaca706015si559539a91.1.2024.11.21.21.48.38 for <isar-users@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Nov 2024 21:48:38 -0800 (PST) Received-SPF: pass (google.com: domain of fm-1212295-202411220548353e145e0537c4339d70-vwqxhf@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) client-ip=185.136.65.227; Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 202411220548353e145e0537c4339d70 for <isar-users@googlegroups.com>; Fri, 22 Nov 2024 06:48:36 +0100 From: "'Cedric Hombourger' via isar-users" <isar-users@googlegroups.com> To: isar-users@googlegroups.com Cc: Cedric Hombourger <cedric.hombourger@siemens.com> Subject: [PATCH 3/3] repository: make repo_contains_package query the package database Date: Fri, 22 Nov 2024 06:48:16 +0100 Message-Id: <20241122054816.3371334-4-cedric.hombourger@siemens.com> In-Reply-To: <20241122054816.3371334-1-cedric.hombourger@siemens.com> References: <20241122054816.3371334-1-cedric.hombourger@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1212295:519-21489:flowmailer X-Original-Sender: cedric.hombourger@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=X+Y05Y7f; spf=pass (google.com: domain of fm-1212295-202411220548353e145e0537c4339d70-vwqxhf@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1212295-202411220548353e145e0537c4339d70-VWqXhf@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Cedric Hombourger <cedric.hombourger@siemens.com> Reply-To: Cedric Hombourger <cedric.hombourger@siemens.com> Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: <isar-users.googlegroups.com> X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: <https://groups.google.com/group/isar-users/post>, <mailto:isar-users@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:isar-users+help@googlegroups.com> List-Archive: <https://groups.google.com/group/isar-users List-Subscribe: <https://groups.google.com/group/isar-users/subscribe>, <mailto:isar-users+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+914930254986+unsubscribe@googlegroups.com>, <https://groups.google.com/group/isar-users/subscribe> X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= |
Series |
repository: small fixes for repo_{contains,del}_packages
|
expand
|
diff --git a/meta/classes/repository.bbclass b/meta/classes/repository.bbclass index b20ec091..bc5852a5 100644 --- a/meta/classes/repository.bbclass +++ b/meta/classes/repository.bbclass @@ -98,7 +98,28 @@ repo_contains_package() { local file="$4" local package - package=$(find ${dir} -name ${file##*/}) + # Extract meta-data from the provided .deb file + package=$(dpkg-deb -f ${file} Package Version Architecture) + + # Output for each field is "Field: Value" + # odd indexes hold field names, even indexes hold values + set -- ${package} + + # lookup ${file} in the database for the current suite + package=$(reprepro -b ${dir} --dbdir ${dbdir} \ + --list-format '${$fullfilename}\n' \ + listfilter ${codename} ' + Package (= '${2}'), + Version (= '${4}'), + Architecture (= '${6}'), + $PackageType (= deb)') + + # we only need the first match (should there be more). Use shell builtins to avoid + # spawning an additional process (e.g. "head") + set -- ${package} + package="${1}" + + # package found in the database? if [ -n "$package" ]; then # yes cmp --silent "$package" "$file" && return 0
Debian package repositories (created/updated with dak) and reprepro repositories do not have the same file naming convention (e.g. the latter does not use Epoch). A full directory scan may also be expensive for large repositories: use reprepro listfilter to check for matching packages in the database. Signed-off-by: Cedric Hombourger <cedric.hombourger@siemens.com> --- meta/classes/repository.bbclass | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)