You are not logged in.

#1 2022-02-04 18:39:11

menteith
Member
Registered: 2022-01-18
Posts: 39

[SOLVED] Pacman tries to install one file to the wrong location

Hi guys,

**EDIT**

The error was coming from update-mime-database /usr/share/mime/packages. The correct command is: update-mime-database /usr/share/mime/packages.

Btw, I cannot count the times when I asked a question only to come up with the solution a few minutes later!



I created my first PKGBUILD with makepkg. It didn't show any error when building the package but pacman tries to install one file to the wrong location (/usr/share/mime/packages/packages) despite the fact I have the correct one  (without duplicated packages) in my PKGBUILD.

Here's the full log:

sudo pacman -U scantailor-advanced-bin-2019.8.16-1-x86_64.pkg.tar.zst
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) scantailor-advanced-bin-2019.8.16-1

Total Installed Size:  7.03 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                                                                                         [#######################################################################] 100%
(1/1) checking package integrity                                                                                       [#######################################################################] 100%
(1/1) loading package files                                                                                            [#######################################################################] 100%
(1/1) checking for file conflicts                                                                                      [#######################################################################] 100%
(1/1) checking available disk space                                                                                    [#######################################################################] 100%
:: Processing package changes...
(1/1) installing scantailor-advanced-bin                                                                               [#######################################################################] 100%
Directory '/usr/share/mime/packages/packages' does not exist!
error: command failed to execute correctly
:: Running post-transaction hooks...
(1/6) Arming ConditionNeedsUpdate...
(2/6) Updating the MIME type database...
(3/6) Refreshing PackageKit...
(4/6) Updating icon theme caches...
(5/6) Searching for orphaned packages...
(6/6) Updating the desktop file MIME type cache...

Here's my PKGBUILD:

pkgname=scantailor-advanced-bin
pkgver=2019.8.16
pkgrel=1
pkgdesc="Interactive post-processing tool for scanned pages that merges the features of the ScanTailor Featured and ScanTailor Enhanced versions, brings new ones and fixes"
arch=("x86_64")
url="https://github.com/4lex4/scantailor-advanced"
license=("GPL3")
depends=(
    "boost-libs"
    "libjpeg"
    "libpng"
    "libtiff"
    "qt5-base"
    "zlib"
    )
makedepends=()
provides=("scantailor-advanced")
conflicts=("scantailor-advanced-git")
source=("scantailor::scantailor", "scantailor.desktop::scantailor.desktop", "scantailor_es.qm::scantailor_es.qm", "scantailor-project.xml::scantailor-project.xml", "scantailor_pt.qm::scantailor_pt.qm", "scantailor_ru.qm::scantailor_ru.qm", "ScanTailor.svg::ScanTailor.svg")
sha256sums=('60273e8519e3c407d51c65aa8b06ef25131b31d83dd143a152e0be279b47403c'
            'ea101b1351a8874f80bdadbf6c8af8475744427cc378cc861afcde4118a51a1f'
            'f2238e3860ca7ede5338c761fb69b75aa7fe397124481de80dfa6613b19cf1bc'
            'e9947449c1f566d69c955e15a07ce64d96c72c7d6edebaf1ad8497f132bc775c'
            '93a5c05e2a119f3dcd5aad3c2cfa4ad1c016280bcefcc9e9804040ef089a6942'
            'ca35aec8ecc5b83f28ee07d3306d1dc74d5eca43e61a56aea044def04b3adb1b'
            '4b1f7d14fadc2e435c940c936f359c76d0e91358cf1314fb9d01bce64379260d')
install="pkg.install"

package() {
  install -D -m755 "${srcdir}/scantailor" "${pkgdir}/usr/bin/scantailor"
  install -D -m644 "${srcdir}/scantailor.desktop" "${pkgdir}/usr/share/applications/scantailor.desktop"
  install -D -m644 "${srcdir}/ScanTailor.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/ScanTailor.svg"
  install -D -m644 "${srcdir}/scantailor-project.xml" "${pkgdir}/usr/share/mime/packages/scantailor-project.xml"
  install -D -m644 "${srcdir}/scantailor_es.qm" "${pkgdir}/usr/share/scantailor-advanced/translations/scantailor_es.qm"
  install -D -m644 "${srcdir}/scantailor_pt.qm" "${pkgdir}/usr/share/scantailor-advanced/translations/scantailor_pt.qm"
  install -D -m644 "${srcdir}/scantailor_ru.qm" "${pkgdir}/usr/share/scantailor-advanced/translations/scantailor_ru.qm"
}

Here's the content of the install script:

post_install() {
	update-mime-database /usr/share/mime/packages
}

post_remove() {
	update-mime-database /usr/share/mime/packages
}

Last edited by menteith (2022-02-04 18:42:17)


Long time Debian user who switched to Arch.

Offline

#2 2022-02-04 18:42:00

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] Pacman tries to install one file to the wrong location

According to the man page, it looks like `update-mime-database` will append "/packages" to the MIME-DIR that you specify.  So as you already included "packages" in the path, it gets duplicated.  Replace that with `update-mime-database /usr/share/mime`.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2022-02-04 18:42:56

menteith
Member
Registered: 2022-01-18
Posts: 39

Re: [SOLVED] Pacman tries to install one file to the wrong location

Thanks! That's it.


Long time Debian user who switched to Arch.

Offline

#4 2022-02-04 19:01:11

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] Pacman tries to install one file to the wrong location

Doesn't this pacman hook already take care of that stuff?

menteith wrote:
:: Running post-transaction hooks...
[...]
(2/6) Updating the MIME type database...
[...]

Offline

#5 2022-02-04 19:12:37

menteith
Member
Registered: 2022-01-18
Posts: 39

Re: [SOLVED] Pacman tries to install one file to the wrong location

Well, it does. My install script in not needed then.


Long time Debian user who switched to Arch.

Offline

Board footer

Powered by FluxBB