Re: installing two versions of a user application

2021-04-25 Thread Ángel
On 2021-04-23 at 17:26 +0100, Morgan Read wrote:
> Is there any method to allow v4 and v5 to be both installed together?

Both packages have the same name, so the package manager treats them as
the same. Rename the package name of the old version (e.g. to master-
pdf-editor-4) and you should be fine.

There are probably better ways, but just listing one of them, assuming
the old file is named master-pdf-editor-4.deb for this you could do:

ar x master-pdf-editor-4.deb control.tar.gz
gzip -d control.tar.gz
tar xf control.tar ./control
sed -i '1,1 { /^Package:/{ s/$/-4/} }' control
gzip control.tar
ar r master-pdf-editor-5.7.53-qt5.x86_64.deb control.tar.gz

(this works on their v5 .deb, watch out if on your .deb, names are
slightly different, such as using xz rather than gz)
> 
> 



Re: installing two versions of a user application

2021-04-23 Thread Morgan Read
On 23/04/2021 6:20 pm, Stefan Monnier wrote:
> I suggest you look inside those .deb files: they seem to both name the
> package they install `master-pdf-editor` but dpkg does not allow
> installing different versions of a given package at the same time.
> So you'll need to edit those `.deb` to change the package name from
> `master-pdf-editor` to (say) `master-pdf-editor4` and
> `master-pdf-editor5`, for example.

Thanks Stefan, I was wondering about something along those lines, but...
Inside master-pdf-editor-4.3.89_qt5.x86_64.deb I find:
data.tar.xz > /./opt/master-pdf-editor-4/masterpdfeditor4
  /./usr/share/icons/hicolor/128x128/apps/masterpdfeditor4.png
  /./usr/share/applications/masterpdfeditor4.desktop

And, inside master-pdf-editor-5.7.08-qt5_included.x86_64.deb I find:
data.tar.xz > /./opt/master-pdf-editor-5/masterpdfeditor5.sh
  /./opt/master-pdf-editor-5/masterpdfeditor5.png
  /./opt/master-pdf-editor-5/masterpdfeditor5
  /./usr/share/applications/masterpdfeditor5.desktop
  /./usr/share/icons/hicolor/256x256/apps/masterpdfeditor5.png

So, everything looks fairly well distinguished - but, I know *nothing*
about packaging...

Thanks

<>

signature.asc
Description: OpenPGP digital signature


Re: installing two versions of a user application

2021-04-23 Thread Stefan Monnier
> You probably want to look inside the control archives rather than the
> data archives:
>
> https://en.wikipedia.org/wiki/Deb_%28file_format%29
>
> If both control archive files are using a package name of
> "master-pdf-editor", you can try Stefan's suggestion of renaming one
> and seeing if they'll then coinstall.

Exactly: the immediate problem you're encountering is that the package
names themselves (regardless of the files they contain) collide.
This info is the `control` part of the .deb archive.

The way I do it is to use Emacs to open the `foo.deb` file.
This should show you something like:

MMode  Size  Date   Filename
- --  --    
  -rw-r--r--   4  2021-03-01 12:23  debian-binary
  -rw-r--r--1128  2021-03-01 12:23  control.tar.xz
  -rw-r--r--  615380  2021-03-01 12:23  data.tar.xz
- --  --    
  616512 3 files

where the `data.tar.xz` part contains the actual files and
`control.tar.xz` is the part you want to modify.
So you select the `control.tar.xz` which itself will look somewhat
similar and will contain a `control` which you can open and in which
you'll find presumably something like:

Package: master-pdf-editor
[...]

followed by other kinds of metainfo about the package.  Just edit that
first line (e.g. by adding a `4` or `5`), then do `C-x C-s` to save this
`control` back into `control.tar.xz`, then kill this buffer with `C-x
k RET`, then save the new `control.tar.xz` back into the actual foo.deb
file with `C-x C-s`.

Then retry to install those debs with:

dpkg --install foo.deb

I recommend you do those modifications on a copy of the file, just so
its easier to recover from mistakes.


Stefan



Re: installing two versions of a user application

2021-04-23 Thread Celejar
On Fri, 23 Apr 2021 18:48:13 +0100
Morgan Read  wrote:

> On 23/04/2021 6:20 pm, Stefan Monnier wrote:
> > I suggest you look inside those .deb files: they seem to both name the
> > package they install `master-pdf-editor` but dpkg does not allow
> > installing different versions of a given package at the same time.
> > So you'll need to edit those `.deb` to change the package name from
> > `master-pdf-editor` to (say) `master-pdf-editor4` and
> > `master-pdf-editor5`, for example.
> 
> Thanks Stefan, I was wondering about something along those lines, but...
> Inside master-pdf-editor-4.3.89_qt5.x86_64.deb I find:
> data.tar.xz > /./opt/master-pdf-editor-4/masterpdfeditor4
>   /./usr/share/icons/hicolor/128x128/apps/masterpdfeditor4.png
>   /./usr/share/applications/masterpdfeditor4.desktop
> 
> And, inside master-pdf-editor-5.7.08-qt5_included.x86_64.deb I find:
> data.tar.xz > /./opt/master-pdf-editor-5/masterpdfeditor5.sh
>   /./opt/master-pdf-editor-5/masterpdfeditor5.png
>   /./opt/master-pdf-editor-5/masterpdfeditor5
>   /./usr/share/applications/masterpdfeditor5.desktop
>   /./usr/share/icons/hicolor/256x256/apps/masterpdfeditor5.png
> 
> So, everything looks fairly well distinguished - but, I know *nothing*
> about packaging...

You probably want to look inside the control archives rather than the
data archives:

https://en.wikipedia.org/wiki/Deb_%28file_format%29

If both control archive files are using a package name of
"master-pdf-editor", you can try Stefan's suggestion of renaming one
and seeing if they'll then coinstall.

Celejar



Re: installing two versions of a user application

2021-04-23 Thread Celejar
On Fri, 23 Apr 2021 18:07:02 +0100
Morgan Read  wrote:

> On 23/04/2021 5:40 pm, Celejar wrote:
> > I'll defer to those with a better understanding of the debian packaging
> > system internals, and it may depend on the details of the package, but
> > I'm pretty sure that there's no general way to direct dpkg to install a
> > package to a location other than the one specified by the package. If
> > the original packages were installable to separate directories, then it
> > should be possible to modify the debian packages to work that way as
> > well, but that's well above my pay grade.
> 
> Thanks Celejar, Just to be clear:
> v4 continues to install to /opt/master-pdf-editor-4;
> v5 continues to install to /opt/master-pdf-editor-5.
> But:
> When v4 is installed, /opt/master-pdf-editor-5 is deleted;
> When v5 is installed, /opt/master-pdf-editor-4 is deleted.
> Under the rpm based system, both /opt/master-pdf-editor-5 and
> /opt/master-pdf-editor-4 coexisted.  My memory is fading...  But, iirc,
> it may have been the case that whenever I upgraded v5 I had to reinstall
> v4 as the v5 install removed it.
> 
> The packages that Code Industry provides are clearly designed to get rid
> of v4, obviously because they now want people to buy those features.
> However, installing v4 over v5 never used to remove v5...
> 
> So, I wonder if alien might have done something in the transliteration
> of the v4 rpm to cause the v4 deb to remove other versions when it
> didn't as an rpm - or, is this just the mechanics of the apt system?
> 
> Many thanks.

See Stefan's answer - that's what I meant by modifying the debian
packages.

Celejar



Re: installing two versions of a user application

2021-04-23 Thread Stefan Monnier
> $ sudo apt install ./master-pdf-editor-4.3.89_qt5.x86_64.deb
> ./master-pdf-editor-5.7.08-qt5_included.x86_64.deb
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> Note, selecting 'master-pdf-editor' instead of
> './master-pdf-editor-4.3.89_qt5.x86_64.deb'
> Note, selecting 'master-pdf-editor' instead of
> './master-pdf-editor-5.7.08-qt5_included.x86_64.deb'
> master-pdf-editor is already the newest version (4.3.89-2).
> The following packages will be upgraded:
>   master-pdf-editor

I suggest you look inside those .deb files: they seem to both name the
package they install `master-pdf-editor` but dpkg does not allow
installing different versions of a given package at the same time.
So you'll need to edit those `.deb` to change the package name from
`master-pdf-editor` to (say) `master-pdf-editor4` and
`master-pdf-editor5`, for example.


Stefan "who does that kind of thing in order to install emacs25,
emacs26, and emacs27 at the same time"



Re: installing two versions of a user application

2021-04-23 Thread Celejar
On Fri, 23 Apr 2021 17:22:48 +0100
Morgan Read  wrote:

> Hello Folks,
> 
> Some little time ago I made a jump from another distro into Debian.
> 
> When I made that jump I took with me a few proprietary applications that
> I make a lot of use of.  One in particular is causing me a bit of a
> headache - Master PDF Editor by Code Industry:
> https://code-industry.net/free-pdf-editor/
> 
> Master PDF Editor is now well into version 5, but when it transitioned
> from v4 to v5 it left a lot of its functionality (in the no cost
> version) behind.  So, I'd always kept a copy of the old v4 rpm to hand
> and installed alongside v5 in my old distro.  Version 4 has long since
> become unavailable, but I was able to make good use of alien to magic my
> v4 rpm into a v4 deb.
> 
> BUT, now I can not install both v4 and v5 alongside one another.  When I
> install v4, v5 is removed; when I install v5, v4 is removed.  This
> wasn't a problem under the old distro.  Each version is installed into
> its own directory, either: /opt/master-pdf-editor-4 or
> /opt/master-pdf-editor-5.
> 
> I tried to force it with the following, but...
> $ sudo apt install ./master-pdf-editor-4.3.89_qt5.x86_64.deb
> ./master-pdf-editor-5.7.08-qt5_included.x86_64.deb
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> Note, selecting 'master-pdf-editor' instead of
> './master-pdf-editor-4.3.89_qt5.x86_64.deb'
> Note, selecting 'master-pdf-editor' instead of
> './master-pdf-editor-5.7.08-qt5_included.x86_64.deb'
> master-pdf-editor is already the newest version (4.3.89-2).
> The following packages will be upgraded:
>   master-pdf-editor
> 1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
> Need to get 0 B/28.4 MB of archives.
> After this operation, 64.8 MB of additional disk space will be used.
> Do you want to continue? [Y/n] n
> Abort.
> 
> Is there any method to allow v4 and v5 to be both installed together?

I'll defer to those with a better understanding of the debian packaging
system internals, and it may depend on the details of the package, but
I'm pretty sure that there's no general way to direct dpkg to install a
package to a location other than the one specified by the package. If
the original packages were installable to separate directories, then it
should be possible to modify the debian packages to work that way as
well, but that's well above my pay grade.

This does seem like a pretty good use case for containerization or
virtualization. LXC (or some sort of chroot solution) in particular
might be a good fit here - you get a separate filesystem, without the
overhead of a full VM, which shouldn't be necessary in this case.

Celejar