openSUSE / zypper

World's most powerful command line package manager
http://en.opensuse.org/Portal:Zypper
Other
405 stars 110 forks source link

[Feature request] Support for "pointer files" for corresponding repo when 'zypper dup' -ing (Leap) #515

Open SpaLox1 opened 10 months ago

SpaLox1 commented 10 months ago

When doing a major upgrade since Leap 15.3, I always have to adapt the address of the SLE Backports repo manually

At the moment it is: https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP5/standard/

it seems (according to the instructions in the wiki) that the %releasever% variable doesn't support adapting the "SLE-15-SPx"-part to the next major release level...?

I wonder if this manual adaption by the user can be avoided by putting some "pointer text file" into the repo directory, telling zypper where the corresponding repo of the next major release can be found.

Example for the SLE-15-SP5 backports repo:

15.6.upgradereppointer.repo currentbaseurl=https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP5/standard/ dupbaseurl=https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP6/standard/

When calling zypper dup, zypper will look if it can find a *upgradepointer.repo file in the repo and it will take the provided %dupbaseurl% repo address for upgrading and replacing %currentbaseurl% in the repo list.

mlandres commented 10 months ago

I don't know which wiki you refer to, but man zypper describes the builtin repo variables:

       $arch
           Use this variable to refer to the system’s CPU architecture.

       $basearch
           Use this variable to refer to the base architecture of the system. For example, iX86 machines have a base
           architecture of i386, while AMD64 and Intel64 have x86_64.

       $releasever, $releasever_major, $releasever_minor
           Use this variable to refer to the version of your openSUSE or SUSE Linux. The value is obtained from the
           /product/version XML-node in /etc/products.d/baseproduct.

So https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15-SP${releasever_minor}/standard/ should work, or SLE-${releasever_major}-SP${releasever_minor}.