[SOLVED] Installed two LibreOffice helppacks. Now slackpkg thinks I have a broken /var/log/packages.
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Now, ‘slackpkg’ complains about a broken ‘/var/log/packages’ because it believes that the help packs are two versions of the same package:
Code:
# slackpkg upgrade-all
Checking local integrity... DONE
You have a broken /var/log/packages - with two versions of the same package.
The list of packages duplicated in your machine are shown below, but don't
worry about this list - when you select your action, slackpkg will show a
better list:
libreoffice-helppack-6.1.4_en_GB-x86_64-1_SBo
libreoffice-helppack-6.1.4_en_US-x86_64-1_SBo
You can (B)lacklist, (R)emove, or (I)gnore these packages.
Select your action (B/R/I): I
Okay - slackpkg won't do anything now, but please, do something to fix it.
Is there any way I can leave the two help packs installed, without getting this error?
You will notice that the localized packages like "libreoffice-dict-en-6.1.3-x86_64-2alien.txz" have the language keyword encoded in name, not in version. That permits installing multiple localization packages on parallel.
What happened? Like Hollywood told us, even in a far away galaxy the single language used is American English, so is understandable that our SlackBuilds.org developers have hard time to figure out that someone may will want to install multiple helppacks for LibreOffice.
My suggestion is just to rename those offending packages records by hand, like "libreoffice-helppack-en_GB-6.1.4-x86_64-1_SBo" and "libreoffice-helppack-en_US-6.1.4-x86_64-1_SBo", then to have some discussions with their developers. Just in case.
TBH, I will not bother with compiling the LibreOffice from SBO, but rather I will install it from Alien Bob's repository.
Last edited by ZhaoLin1457; 01-05-2019 at 02:35 PM.
I think that this results of a misnaming of the packages.
The template is $PKGNAME-$PKGVERSION-$PKGARCH-$BUILD$TAG and hyphens are counted from right to left to find what's what by the package management tools, knowing that only $PKGNAME may include hyphens.
In this case we find:
$BUILD$TAG=1_SBo
$PKGARCH=x86_64
$VERSION=helppack-6.1.4_en_GB or helppack-6.1.4_en_US
$PKGNAME=libreoffice-helppack
So slackpkg finds two package with the same name but different versions.
I think that the package should be named instead:
libreoffice-helppack-en_GB-6.1.4-x86_64-1_SBo
libreoffice-helppack-en_US-6.1.4-x86_64-1_SBo
I email the maintainer about that.
EDIT: ZhaoLin1457 was faster.
Last edited by Didier Spaier; 01-05-2019 at 02:50 PM.
My suggestion is just to rename those offending packages records by hand, like "libreoffice-helppack-en_GB-6.1.4-x86_64-1_SBo" and "libreoffice-helppack-en_US-6.1.4-x86_64-1_SBo"
Quote:
Originally Posted by Didier Spaier
I think that the package should be named instead:
libreoffice-helppack-en_GB-6.1.4-x86_64-1_SBo
libreoffice-helppack-en_US-6.1.4-x86_64-1_SBo
Will the underscores in what then becomes the package name cause any issues, or are they allowed there?
Also, does the package name, as recorded by the package management tools, get constructed directly from the file name, or is it recorded anywhere else within the packaged archive?
Quote:
Originally Posted by Didier Spaier
The template is $PKGNAME-$PKGVERSION-$PKGARCH-$BUILD$TAG and hyphens are counted from right to left to find what's what by the package management tools, knowing that only $PKGNAME may include hyphens.
Well, thanks for that info—I didn’t know that. I haven’t looked too deeply into Slackware packaging so far.
I guess I could simply edit the SlackBuild script and append the locale to the name, instead of whatever it is that the script currently does.
Quote:
Originally Posted by ZhaoLin1457
TBH, I will not bother with compiling the LibreOffice from SBO, but rather I will install it from Alien Bob's repository.
Well, yes, I considered that option, too—and likely will revisit it later on. I was just curious to see how the SlackBuild would do.
By the way, the SlackBuild doesn’t actually compile LibreOffice from source. Instead, it extracts the binaries from the RPM distribution as found on the LibreOffice download area.
In any case, thanks to both of you for your replies!
In the $PKGNAME you can use a whatever number of underscores and hyphens. The hyphens are not allowed on $VERSION and so on.
Regarding adjusting yourself the SlackBuild, I think you have a good idea about adjusting the naming. And if you want to customize "a la carte" the build, you may want to adjust the "slack-desc" like this
Code:
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
libreoffice-helppack-@LANG@: libreoffice-helppack (for LibreOffice Productivity Suite)
libreoffice-helppack-@LANG@:
libreoffice-helppack-@LANG@: Built-in Help Pack for LibreOffice productivity suite.
libreoffice-helppack-@LANG@:
libreoffice-helppack-@LANG@: Homepage: https://www.libreoffice.org
libreoffice-helppack-@LANG@:
libreoffice-helppack-@LANG@:
libreoffice-helppack-@LANG@:
libreoffice-helppack-@LANG@:
libreoffice-helppack-@LANG@:
libreoffice-helppack-@LANG@:
Then, with a "sed" command to generate the proper slack-desc at build time, replacing @LANG@ with the current language.
For example using in SlackBuild
Code:
sed 's/@LANG@/${PKG_LANG}/' $CWD/slack-desc > $PKG/install/slack-desc
Last edited by ZhaoLin1457; 01-05-2019 at 05:19 PM.
Also, does the package name, as recorded by the package management tools, get constructed directly from the file name, or is it recorded anywhere else within the packaged archive?
It is set in the SlackBuild often but not always from the source archive name.
Last edited by Didier Spaier; 01-06-2019 at 07:57 AM.
Reason: s/are names/have names/
The original idea was to make a single script to handle multiple languages, but it's assumed that most people will just install one language and not a mixed one.
The original idea was to make a single script to handle multiple languages, but it's assumed that most people will just install one language and not a mixed one.
Or, the root cause of that could be a limitation of the SlackBuilds.org design, where the package name should be identical with the one of SlackBuild?
Up to and including Slackware version 8.0, the packages were just named <softwarename>.tgz
The (then) new naming scheme was introduced in Slackware 8.1. Quoting UPGRADE.TXT for it:
Code:
4. Remove the old packages. Since we're using a longer package naming
scheme now, we know any package with a name shorter than 10
characters must be an old package. Remove them with this command:
cd /var/log/packages
removepkg ? ?? ??? ???? ????? ?????? ??????? ????????
This will remove all packages with names from 1 to 8 characters long.
This was dealt with in removepkg, updated before the release of 8.1:
Quote:
# Revision 1.8 Thu Nov 22 14:00:13 PST 2001 volkerding Rel $
# - Move $TMP underneath $ROOT
# - Understand the idea of a base package name, so that packages
# can be removed with any of these notations:
# removepkg foo-1.0-i386-1.tgz
# removepkg foo-1.0-i386-1
# removepkg foo.tgz
# removepkg foo
However, installpkg is still lenient enough to accept the old naming scheme:
Code:
if [ "$( grep '^\./' $TMP/$shortname | wc -l | tr -d ' ')" = "1" ]; then
# Good. We have a package that meets the Slackware spec.
cat $TMP/$shortname >> $ADM_DIR/packages/$shortname
else
# Some dumb bunny built a package with something other than makepkg. Bad!
# Oh well. Bound to happen. Par for the course. Fix it and move on...
gettext "WARNING: Package has not been created with 'makepkg'"
echo
echo './' >> $ADM_DIR/packages/$shortname
cat $TMP/$shortname >> $ADM_DIR/packages/$shortname
fi
removepkg follows suite:
Code:
# If we don't have a package match here, then we will attempt to find
# a package using the long name format (name-version-arch-build) for
# which the base package name was given. On a properly-managed machine,
# there should only be one package installed with a given basename, but
# we don't enforce this policy. If there's more than one, only one will
# be removed. If you want to remove them all, you'll need to run
# removepkg again until it removes all the same-named packages.
Problem solved! Reordered the output package name in the SlackBuild script.
Thank you all for the historical notes!
I was wondering whether I could remove what ‘slackpkg’ considers “two versions of the same package”, without ill effect. My question was answered when I read the following:
Quote:
Originally Posted by Didier Spaier
Code:
# If we don't have a package match here, then we will attempt to find
# a package using the long name format (name-version-arch-build) for
# which the base package name was given. On a properly-managed machine,
# there should only be one package installed with a given basename, but
# we don't enforce this policy. If there's more than one, only one will
# be removed. If you want to remove them all, you'll need to run
# removepkg again until it removes all the same-named packages.
So, I removed the two packages that made ‘slackpkg’ complain.
Oh, and about the underscores in packages names:
Quote:
Originally Posted by Didier Spaier
No issue, they are allowed. In my system packages there have names are like that
Of course! There are quite a few such packages. I could easily have answered that question myself.
Anyway, my issue is solved now. All it took was a small edit of the ‘libreoffice-helppack.SlackBuild’ script, since the only spot where the full package name gets produced, is at the very end, when the ‘makepkg’ command gets run. I created a patch file to make the modification, and it has the following contents:
While I was at it, I made the same modification to the ‘libreoffice-langpack.SlackBuild’ script, so I can install more than one language pack, too, without making ‘slackpkg’ unhappy:
Code:
--- libreoffice-langpack.SlackBuild.ORIG 2018-12-22 02:49:30.000000000 +0100
+++ libreoffice-langpack.SlackBuild 2019-01-06 16:26:02.523063817 +0100
@@ -116,4 +116,4 @@
cd $PKG
fi
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-${VERSION}_${PKG_LANG}-$PKGARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/${PRGNAM}_${PKG_LANG}-${VERSION}-$PKGARCH-$BUILD$TAG.${PKGTYPE:-tgz}
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.