You are not logged in.

#1 2017-12-14 15:39:52

stewbond
Member
Registered: 2015-05-12
Posts: 32

Swapping between versions

My company develops embedded software that we install under /opt.  Currently, we just copy files manually, but I'd like to deploy it using a proper package manager.

Our customer has the requirement to be able to swap software versions.  This is so they can install a new version, do some testing and possibly revert before putting it into real operation.  Being able to swap revisions is something that I find very difficult in ABS and so I'd like to understand better before I can recommend this toolchain.  I can't imagine that this is an uncommon use-case and so I must just not understand ABS well enough.

Here I've thought of three solutions:

  1. On the repository side, just repo-add multiple versions of the same package.  The client can specify which version to install using

    pacman -S "<package>=1.1"

      But if I downgrade <package>, will dependencies with specific revision requirements also downgrade?  I ask because I also envision splitting my software into several packages representing optional components.  Then I'd have one master package for each configuration which specifies the revisions of each component as dependencies.  However not every version of every module will be compatible with every other version of every other module.  If pacman won't downgrade dependencies, then I'll need to have my customers explicitly sync each package's version.

  2. On the PKGBUILD side, you could manage your versions as different packages.  You would name the package as "<package>_<version>" and set DESTDIR to /opt/<package>_<version>.  That would allow us to install multiple versions simultaneously.  Then we can make a symbolic link to the selected version and allow the software to decide which version of itself is going to run.  This seems like the most intuitive way for this to work, but seems to conflict with the intended version philosophy of the ABS so perhaps there is a problem with this that I am not thinking of.

  3. The client could install different versions of the software to different locations using

    pacman -r /opt/<package>_<version> -S <package>=<version>

    .  However, the man pages explicitly say that we shouldn't do this, though I'm not sure why.

Is there a better solution I haven't thought of?  Are there problems with the solutions presented?

Thanks!

Last edited by stewbond (2017-12-14 16:07:44)

Offline

#2 2017-12-15 05:08:45

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: Swapping between versions

I am not sure I understand what your specific requirement is, but you might want to look into epoch: https://www.archlinux.org/pacman/PKGBUILD.5.html

Offline

#3 2017-12-15 13:42:36

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Swapping between versions

Option 2 is indeed the way to go, Arch Linux does this also when software depends on outdated versions of some dependency. This is similar to Gentoo slots, except we have no native support for that -- but it is trivial to reimplement using the package name.

Option 3 is what you would use if you were installing a program into a different location when that different location is going to be a full chroot.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2017-12-15 15:04:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Swapping between versions

Agreed on option 2 being the best (in fact the only one of the three that even sounds reasonable).

But I have a question/concern about a premise of this issue: you are delivering software to customers with specific needs, and you think using a package manager will help meet those needs.  That all makes sense.  But then you are trying to use a package manager from a distro that is counter to the goals.  Are you customers already using archlinux and you want to be able to deliver packages they are familiar with, or are you encouraging/requiring them to use an arch linux system?  If its the former, that's awesome, keep it up.  If it's the latter, please reconsider, there are other distros that would likely be better suited to this and would be much better for everyone in the long run.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2017-12-15 15:28:14

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: Swapping between versions

Trilby makes a good point. In addition, if your customers use different operating systems and your software is self-contained, then maybe flatpak or a docker container may be worth a look.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2017-12-19 12:22:41

stewbond
Member
Registered: 2015-05-12
Posts: 32

Re: Swapping between versions

Thanks for the responses.  Option 2 is the way I'll go.

The software isn't self-contained.  We deliver racks of servers with the software pre-installed.  After delivery we need to make upgrades available to the customer for testing before they put it into operation.  We get to choose the OS and since pacman is cheaper than developing an in-house solution, Arch seems reasonable. 

Thanks for the suggestion about flatpak,  I'm doing some research on it now.

Offline

#7 2017-12-19 13:22:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Swapping between versions

Arch isn't the only distro with a package manager.  Arch is also not particularly designed for use on servers, there are distros that are.  Many archers would strongly discourage anyone from using arch on a server.  I'm not one of them as I run arch on several servers, but I (generally) know what I am doing and I am fully responsible for those machines.

What is pretty much unanimous though is that everyone would say putting arch linux on a machine for someone else and giving it to them is a horrible disservice and is a recipe for disaster.

Putting these two together, I'm beyond shocked that you run a business delivering arch-linux only servers to customers/victims.  It's really not a matter of if, but when this will come back to bite you, badly.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB