Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id BBE08781A42 for <~alpine/apk-tools@lists.alpinelinux.org>; Tue, 4 Feb 2020 09:06:58 +0000 (UTC) Received: by mail-lj1-f170.google.com with SMTP id h23so17734223ljc.8 for <~alpine/apk-tools@lists.alpinelinux.org>; Tue, 04 Feb 2020 01:06:58 -0800 (PST) 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=VH0wzXgbloUTgcjbQZNLQma0HeRSmL0dkMavvQLeHvs=; b=QLYAnw0I+q2OVbcDarB9B2VCP99sNcPCkq63/iTC943ASfZKbBFoItwJkhwW5he0cp A/s74bpAnFe73YvCv2kZqwk2i1WcJNwiOhWYIEJc2aK/toleMumDUuiA1ps3sZcXmxyt 3i21io8T6GLEUUvhv2Q6jkv0QIkezsMhouSmvOheSO8tLEjxpaJx32Hz2AcxXooY5Rk2 xsPhKgeC3vXSmogI7iyD9nwL1qqu6yTIwR7P928Awjl9lyeRUs9Gx8jy7eTAk7xXSjbe QzAZdMfihkYqjFYJQjgiEPK9YgXP18E5epXgm5BEhmBEkB3fvgT0kwE/kHvs5StBPM11 ePjg== X-Gm-Message-State: APjAAAWoJiT3w9yUwKUAxuuU6y8aSztz+qzFWQob8g0keApCFvN0rIDV xq91DuvRLCmoQnt+w1c23hg= X-Google-Smtp-Source: APXvYqzYBoH8z2F1vV6/pt+AhmYZWL9gqwhnqn5vZSUn5RcnTWf170czt3ZoIhjsxl+Qr1F8gRFMLg== X-Received: by 2002:a05:651c:40c:: with SMTP id 12mr9976637lja.147.1580807217591; Tue, 04 Feb 2020 01:06:57 -0800 (PST) Received: from vostro (87-100-234-203.bb.dnainternet.fi. [87.100.234.203]) by smtp.gmail.com with ESMTPSA id z205sm10003420lfa.52.2020.02.04.01.06.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Feb 2020 01:06:57 -0800 (PST) Date: Tue, 4 Feb 2020 11:06:52 +0200 From: Timo Teras To: Clayton Craft Cc: ~alpine/apk-tools@lists.alpinelinux.org Subject: Re: supporting multiple versions of same package in single repo Message-ID: <20200204110646.2d9f80b4@vostro> In-Reply-To: <20200203222821.wty53efr5u2sx3gk@computer.craftyguy.net> References: <20200203222821.wty53efr5u2sx3gk@computer.craftyguy.net> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-alpine-linux-musl) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi On Mon, 3 Feb 2020 14:28:21 -0800 Clayton Craft wrote: > In postmarketOS we are attempting to have 2 versions of mesa: 'mesa' > (from upstream Alpine), and 'mesa-git' (tracks upstream mesa master > branch). The goal is to have both packages + their respective > subpackages provide system mesa for an install. Only one (mesa or > mesa-git) is expected to be installed on a single system at one time. > When a user installs 'mesa-git', and then (for example) installs a > package which depends on 'mesa-dev', the idea is that 'mesa-git-dev' > would be installed instead of 'mesa-dev'. We want 2 versions of mesa > since some devices pmos supports require a newer mesa than what is > currently in the latest mesa stable branch. > > We are having a very hard time coming up with a mesa-git APKBUILD > that can do this. In IRC, it was mentioned that we could use a > virtual package, and rename 'mesa' to something else, and handle > installing either of the 2 packages in the virtual package. This > would probably work (?) but is less than ideal since we'd have to > keep the renamed mesa package in sync with upstream Alpine's mesa > package. > > Arch Linux seems to be able to handle this scenario without issue, > AUR has a mesa-git package which results in mesa-git-* subpackages > being installed at the right time (when something depends on > mesa-dev, etc). Is apk/APKBUILD capable of supporting this, or does > anyone have any advice/suggestions on how this goal could be achieved? Interesting setup. I wonder if in Arch it is a feature where a global substitution rule diverts mesa-dev to mesa-git-dev or similar. Using purely apk dependencies, you could try the following: 1. mesa-git-dev provides="mesa-dev" provider_priority=1 The provides tells it's good for 'mesa-dev'. Since there's no provided version specified it's not good for automatic install; the provider_priority=1 makes that happen. One caveat is at least that if someone depends e.g "mesa-dev>19.0", it would not get satisfied with the mesa-git-dev. OR provides="mesa-dev=19.2" To make the git act as if it was this version. You probably then want a smaller version than what the real mesa is so that the mesa-git-dev does not get preferred always. 2. mesa-git depends="!mesa" To make sure that depending on 'mesa-dev' does not prefer the real package and try to pull in it's dependencies. Interesting to hear if the above works. Timo