X-Original-To: alpine-devel@lists.alpinelinux.org Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by lists.alpinelinux.org (Postfix) with ESMTP id C1293F84E15 for ; Wed, 1 May 2019 15:57:27 +0000 (UTC) Received: by mail-lf1-f68.google.com with SMTP id t11so13267147lfl.12 for ; Wed, 01 May 2019 08:57:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FgVxL2l0FmJ+v2SnecdqZLq4VIrgzRrPgD/En1cJ3EA=; b=QGoYW0jA+qPLN8+4e8rejwC3kRRa3t2qE4Uo4ORbaBmHBuTtwm1TaIFk8qn2m65Bnn jx4aVSqcB2gPMPswNykzqDhoAevi4fk3XOsvwN3KSaItcN18IUFBWsw8V+QptPAyl1eP 4SMBvkpf6nAjiodtMvQvrb6t/gmtOOpauxnvUlrmh0rqCxqc8o0Hx1lxR3iBgyAQns5D SFbvoEL/Lp3gPpfgP/HcBOGbhUthutzLM3hR26yjRS/X5T1+TJUQt7jDG5jl1wh5z5zO PTAR9cU7podtWFtxOs/fQ/x6tXYH63WjuX1PBg6UGDNxtOHxpJuqlpjPMylE1Et13WzT GSsA== X-Gm-Message-State: APjAAAVDm1mEPwwshaFH1QlkJ4LFFUMmDRomNK+Faz5uZP30C261o/Fc ia5h9xK1tcw+4+JkBj51nvY= X-Google-Smtp-Source: APXvYqzs2fBComf0m5YW3hhDA02/202A6PwmithmF9kwQbZP0w2ysBL3Sp+f6Snk9FxeB4nL19SmyA== X-Received: by 2002:a19:5f51:: with SMTP id a17mr8809132lfj.131.1556726246709; Wed, 01 May 2019 08:57:26 -0700 (PDT) Received: from vostro ([83.145.235.201]) by smtp.gmail.com with ESMTPSA id 28sm1346381ljw.82.2019.05.01.08.57.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 01 May 2019 08:57:26 -0700 (PDT) Date: Wed, 1 May 2019 18:57:23 +0300 From: Timo Teras To: "A. Wilcox" Cc: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] [PATCH v3] list: Detect orphaned packages correctly Message-ID: <20190501185723.7fb230dd@vostro> In-Reply-To: <20190501135916.33879-1-AWilcox@Wilcox-Tech.com> References: <20190323172952.43760ffa@vostro> <20190501135916.33879-1-AWilcox@Wilcox-Tech.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-alpine-linux-musl) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, Applied. Thanks! On Wed, 1 May 2019 08:59:16 -0500 "A. Wilcox" wrote: > BIT(1) corresponds with decimal 2, which is the first available > repository. >=20 > Before this fix, `apk list -O` would list every package installed > from the first available repository, which is the 'system' repository > on most Ad=C3=A9lie Linux computers. >=20 > After this fix, `apk list -O` correctly lists only the packages which > are no longer available. > --- > src/list.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/src/list.c b/src/list.c > index e285e3f..202dab2 100644 > --- a/src/list.c > +++ b/src/list.c > @@ -61,7 +61,7 @@ static int is_orphaned(const struct apk_name *name) > /* repo 1 is always installed-db, so if other bits are set > it means the package is available somewhere > * (either cache or in a proper repo) > */ > - return (repos & ~BIT(1)) =3D=3D 0; > + return (repos & ~BIT(APK_REPOSITORY_CACHED)) =3D=3D 0; > } > =20 > /* returns the currently installed package if there is a newer > package that satisfies `name` */ @@ -144,7 +144,7 @@ static void > filter_package(const struct apk_package *pkg, const struct list_ctx > if (ctx->orphaned && !is_orphaned(pkg->name)) return; > =20 > - if (ctx->available && pkg->repos =3D=3D BIT(1)) > + if (ctx->available && pkg->repos =3D=3D > BIT(APK_REPOSITORY_CACHED)) return; > =20 > if (ctx->upgradable && !is_upgradable(pkg->name, pkg)) --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---