slackpkg icon indicating copy to clipboard operation
slackpkg copied to clipboard

Install exact package names

Open mid-kid opened this issue 1 year ago • 9 comments

I'm trying to script around slackware, and one of the problems I'm trying to solve is being able to install and reinstall arbitrary packages with exact package names, rather than having to glob in a dir full of tarballs. Slackpkg is a very suitable solution for that, but what I'm finding is that it is utterly impossible to specify exact package names with it.

For example:

# slackpkg -batch=on install gcc

Looking for gcc in package list. Please wait... DONE

gcc-11.2.0-x86_64-2.txz
gcc-brig-11.2.0-x86_64-2.txz
gcc-g++-11.2.0-x86_64-2.txz
gcc-gdc-11.2.0-x86_64-2.txz
gcc-gfortran-11.2.0-x86_64-2.txz
gcc-gnat-11.2.0-x86_64-2.txz
gcc-go-11.2.0-x86_64-2.txz
gcc-objc-11.2.0-x86_64-2.txz

Total package(s): 8

Do you wish to install selected packages (Y/n)? n

Is there a way to make it install only the gcc package?

mid-kid avatar Aug 08 '23 22:08 mid-kid

AFAIK it should be enough to specify the package name after the slackpkg command.

saxa avatar Aug 09 '23 10:08 saxa

@saxa what do you mean? I'm specifying gcc in the command and it's pulling all of these gcc subpackages I don't need.

mid-kid avatar Aug 09 '23 11:08 mid-kid

I mean slackpkg install gcc-11.2.0-x86_64-2.txz I am not sure if it works but IMHO it should.

saxa avatar Aug 09 '23 23:08 saxa

Oh, sure, but I want to avoid having to specify the exact version.

mid-kid avatar Aug 13 '23 10:08 mid-kid

Oh ok, I read it again, sorry. I think you could try to specify a bit more of the name in your scritp then.

saxa avatar Aug 13 '23 14:08 saxa

What is "a bit more" when gcc is the full name?

mid-kid avatar Aug 14 '23 10:08 mid-kid

You tried gcc-11 ?

saxa avatar Aug 14 '23 11:08 saxa

I guess that works for now, I'd like to avoid hardcoding the version though...

mid-kid avatar Aug 15 '23 09:08 mid-kid

Ok, glad you sorted it out. Probably on some of the package names you would need to hardcode them, at the end they do not change names so often. Another solution maybe would be to do it like pkgtools do it, by reversing the name and cut off the last 3 fields and then search for it. But to suggest better probably would be good to see some piece of code of what are you trying to achieve.

saxa avatar Aug 15 '23 16:08 saxa