[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help with unremoved files after purge



On Tue, Aug 14, 2012 at 06:39:54PM +0200, Sebastian Humenda wrote:
> unopkg has side-effects when removing an extension (it leaves files behind)

This - as Andreas says - is purely by using unopkg in a "unclean" environment.

> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679717). It was suggested that
> I should have a look in the maintainer-scripts of libreoffice-common.

Yeah, libreoffice itself had that problem, too. (see #669271)

> Unfortunately I'm not that familiar with shell scripting so that I cannot sort
> out what exactly helps there to remove files which were left behind after
> uninstalling an LibreOffice extension.
> Can anyone please be so kind and give me a hint / some help on this? Please keep
> me in the CC, I'm not on the list.

Well, the fix is to make HOME point to something bogus (or a tempdir) so that unopkg
doesn't have the chance to write to it. In LO we do:

sync_extensions() {
  INSTDIR=`mktemp -d`
  export PYTHONPATH="/@OODIR@/program"
  if [ -L /usr/lib/libreoffice/basis-link ]; then
        d=/var/lib/libreoffice/`readlink /usr/lib/libreoffice/basis-link`/
  else
        d=/usr/lib/libreoffice
  fi
  if HOME=$INSTDIR /usr/lib/libreoffice/program/unopkg list --bundled >/dev/null 2>/dev/null; then
    if [ -e /usr/lib/libreoffice/share/prereg/bundled ] && readlink /usr/lib/libreoffice/share/prereg/bundled 2>&1 >/dev/null && [ -L $d/ure-link ]; then
      HOME=$INSTDIR \
        /usr/lib/libreoffice/program/unopkg sync -v --bundled \
        "-env:BUNDLED_EXTENSIONS_USER=file:///usr/lib/libreoffice/share/prereg/bundled" \
        "-env:UserInstallation=file://$INSTDIR" \
        "-env:UNO_JAVA_JFW_INSTALL_DATA=file://$d/share/config/javasettingsunopkginstall.xml" \
        "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
    fi
  fi
  rm -rf $INSTDIR
}

Note setting INSTDIR and the HOME=$INSTDIR's....

If you wanted to keep your maintainer scripts you need to do it the same way as above.

BUT better (and this is what almost all extensions INCLUDING voikko do since loooong before you packaged this)
is to unpack the extension into /usr/lib/libreoffice/share/extensions and do nothing (libreoffice-common has triggers
which call the above). This new path and unpacked contents is a feature since OOo 3.3 iirc....

Regards,

Rene


Reply to: