[Slackbuilds-users] libreoffice.SlackBuild: request for enhancement

Sebastien BALLET slacker6896 at gmail.com
Wed Oct 17 18:36:17 UTC 2018


Hello,

oh ! I forgot to mention that the patch does not remove the "original"
symlinks found in /usr/share/applications (ie. those with version number).
If you want to get rid of those and have only "unversioned" symlinks, the
patch below (and in attachment) should do the trick:

8<-------------------------------------------------------------------
--- libreoffice.SlackBuild.orig    2018-10-17 20:26:30.628052769 +0200
+++ libreoffice.SlackBuild    2018-10-17 20:26:30.628052769 +0200
@@ -130,6 +130,24 @@
 ln -sf ../../opt/libreoffice$SRCSHORT/program/swriter  lowriter

 cd -
+
+# the .desktop files installed in /opt/libreoffice<VER>/share/xdg and
+# symlinks to that files in /usr/share/applications have version number
+# in their name (ex libreoffice6.1-writer.desktop) which force user to
+# re-create/update any link/reference (ex: on KDE/XFCE desktop, in fluxbox
+# menu file, in wmalauncher configuration file,...) to that files on each
+# libreoffice version number increment.
+#
+# To avoid that, the code below deletes the "versioned" symlinks
+# and creates news without version number in their names.
+#
+cd $PKG/usr/share/applications
+  for APP in base calc draw impress math startcenter writer xsltfilter ; do
+    rm -f $PRGNAM$SRCSHORT-$APP.desktop
+    ln -sf ../../../opt/libreoffice$SRCSHORT/share/xdg/$APP.desktop
$PRGNAM-$APP.desktop
+  done
+cd -
+
 # Remove DejaVu and Liberation fonts - these are included in other packages
 rm -f
opt/libreoffice$SRCSHORT/share/fonts/truetype/{DejaVu,Liberation}*.ttf
8<-------------------------------------------------------------------

With that, you'll only find "unversioned" symlinks :

8<-------------------------------------------------------------------
$ ls -ld /usr/share/applications/libreoffice*.desktop
lrwxrwxrwx 1 root root 50 oct.  17 20:22
/usr/share/applications/libreoffice-base.desktop ->
../../../opt/libreoffice6.1/share/xdg/base.desktop
lrwxrwxrwx 1 root root 50 oct.  17 20:22
/usr/share/applications/libreoffice-calc.desktop ->
../../../opt/libreoffice6.1/share/xdg/calc.desktop
lrwxrwxrwx 1 root root 50 oct.  17 20:22
/usr/share/applications/libreoffice-draw.desktop ->
../../../opt/libreoffice6.1/share/xdg/draw.desktop
lrwxrwxrwx 1 root root 53 oct.  17 20:22
/usr/share/applications/libreoffice-impress.desktop ->
../../../opt/libreoffice6.1/share/xdg/impress.desktop
lrwxrwxrwx 1 root root 50 oct.  17 20:22
/usr/share/applications/libreoffice-math.desktop ->
../../../opt/libreoffice6.1/share/xdg/math.desktop
lrwxrwxrwx 1 root root 57 oct.  17 20:22
/usr/share/applications/libreoffice-startcenter.desktop ->
../../../opt/libreoffice6.1/share/xdg/startcenter.desktop
lrwxrwxrwx 1 root root 52 oct.  17 20:22
/usr/share/applications/libreoffice-writer.desktop ->
../../../opt/libreoffice6.1/share/xdg/writer.desktop
lrwxrwxrwx 1 root root 56 oct.  17 20:22
/usr/share/applications/libreoffice-xsltfilter.desktop ->
../../../opt/libreoffice6.1/share/xdg/xsltfilter.desktop
8<-------------------------------------------------------------------

 --
SeB

Le mer. 17 oct. 2018 à 19:13, Willy Sudiarto Raharjo <
willysr at slackbuilds.org> a écrit :

> > The .desktop files installed in /opt/libreoffice<VER>/share/xdg and
> > symlinks to that files in /usr/share/applications have version number
> > in their name (ex libreoffice6.1-writer.desktop) which force user to
> > re-create/update any links/reference (placed on KDE desktop for instance)
> > to that files on each libreoffice version number increment.
> >
> > To avoid that, the patch below (also in attachment) creates symlinks
> > without libreoffice version number in their names in
> > /usr/share/applications.
>
> Hi Sebastien
>
> Thanks for the patch.
> I tested here and it creates a duplicate entries since the old .desktop
> files are still there :)
>
>
> --
> Willy Sudiarto Raharjo
>
> _______________________________________________
> SlackBuilds-users mailing list
> SlackBuilds-users at slackbuilds.org
> https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ - https://slackbuilds.org/faq/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20181017/62408e27/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libreoffice-symlinks-no-version.patch
Type: text/x-patch
Size: 1185 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20181017/62408e27/attachment.bin>


More information about the SlackBuilds-users mailing list