You are not logged in.

#1 2017-04-12 20:43:45

triptysd
Member
Registered: 2017-04-08
Posts: 7

Underestanding .install files from PKGBUILD

Hello guys, just a quick question I cannot find the answer anywhere.
In many AUR packages, aside the PKGBUILD file I've got a {PKGNAME}.install file with scripts that are supposed to be run before/after install/remove etc..

The problem is, I dunno if they're effectively running. A lot of them have echo's that are not showing up in the terminal when making or installing the packages.
Is that the correct behavior? is there a way to make pacman or makepkg show me this comments?

Thank you in advance.

Offline

#2 2017-04-12 20:52:36

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Underestanding .install files from PKGBUILD

triptysd wrote:

A lot of them have echo's that are not showing up in the terminal when making or installing the packages.

The .install files are not executed when building a package. Also, they may not necessarily run during installation either (see the possible triggers). But yes, if they echo something, it should show in the pacman output on the console.

Which AUR package in particular you we talking about?


pkgs │ hacks │ cfg │ blag

Offline

#3 2017-04-12 21:09:26

triptysd
Member
Registered: 2017-04-08
Posts: 7

Re: Underestanding .install files from PKGBUILD

No, i know there are different triggers. Like post_install, pre_remove, etc.
At least the post_install should arise, well, after installing the package.

From the top of my head,
The 'nvm' package, which tells you should put the nvm-init in the .bashrc
The 'fisherman' packages which handles the fish shell plugins.
The 'grub2-theme-archlinux' which give indications of how to enable the theme in grub.

Is there an option somewhere, or am I doing sth wrong?

In order to install a package i do:
1. git clone the .git aur url
2. cd into the directory
3. makepkg -si

Thanks!

Last edited by triptysd (2017-04-12 21:10:11)

Offline

#4 2017-04-12 21:21:47

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Underestanding .install files from PKGBUILD

This is my full output for building, installing and uninstalling nvm:

$ makepkg -srci                                                                                         14s
==> Making package: nvm 0.33.1-1 (Wed 12 Apr 23:14:22 CEST 2017)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading v0.33.1.zip...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   120    0   120    0     0    232      0 --:--:-- --:--:-- --:--:--   232
100  147k  100  147k    0     0   107k      0  0:00:01  0:00:01 --:--:-- 5920k
  -> Found init-nvm.sh
  -> Found install-nvm-exec
==> Validating source files with md5sums...
    v0.33.1.zip ... Passed
    init-nvm.sh ... Passed
    install-nvm-exec ... Passed
==> Extracting sources...
  -> Extracting v0.33.1.zip with bsdtar
==> Starting build()...
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issue...
==> Creating package "nvm"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: nvm 0.33.1-1 (Wed 12 Apr 23:14:24 CEST 2017)
==> Installing package nvm with pacman -U...
[sudo] password for ayekat: 
loading packages...
resolving dependencies...
looking for conflicting packages...

Package (1)  New Version  Net Change

nvm          0.33.1-1       0.12 MiB

Total Installed Size:  0.12 MiB

:: Proceed with installation? [Y/n] 
(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 nvm                                                         [-------------------------------------------] 100%

You need to source nvm before you can use it. Do one of the following
or similar depending on your shell (and then restart your shell):

  echo 'source /usr/share/nvm/init-nvm.sh' >> ~/.bashrc
  echo 'source /usr/share/nvm/init-nvm.sh' >> ~/.zshrc

You can now install node.js versions (e.g. nvm install 5.0) and
activate them (e.g. nvm use 5.0). You may want to activate your
preferred node.js version in your .bashrc (or similar) after
sourcing init-nvm.sh.

init-nvm.sh is a convenience script which does the following:

[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"
source /usr/share/nvm/nvm.sh
source /usr/share/nvm/bash_completion
source /usr/share/nvm/install-nvm-exec

You may wish to customize and put these lines directly in your
.bashrc (or similar) if, for example, you would like an NVM_DIR
other than ~/.nvm or you don't want bash completion.

See the nvm readme for more information: https://github.com/creationix/nvm

Optional dependencies for nvm
    bash: bash completion [installed]
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
==> Cleaning up...
$ sudo pacman -Rscn nvm
checking dependencies...

Package (1)  Old Version  Net Change

nvm          0.33.1-1      -0.12 MiB

Total Removed Size:  0.12 MiB

:: Do you want to remove these packages? [Y/n] 
:: Processing package changes...
(1/1) removing nvm                                                           [-------------------------------------------] 100%

Don't forget to clean up any lines added to your shell's startup script!

For example, from your .bashrc (or .zshrc etc.), delete the line:

source /usr/share/nvm/init-nvm.sh

:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

So on my machine™ everything seems fine. Do the messages show up in your pacman.log?
If not, have you done any modifications to your pacman.conf? What's the output of this command?

pacman --verbose

pkgs │ hacks │ cfg │ blag

Offline

#5 2017-04-13 01:41:47

triptysd
Member
Registered: 2017-04-08
Posts: 7

Re: Underestanding .install files from PKGBUILD

They are on the pacman.log!! But I cannot see them on the terminal.

This is the output of

pacman --verbose
Root      : /
Conf File : /etc/pacman.conf
DB Path   : /var/lib/pacman/
Cache Dirs: /var/cache/pacman/pkg/
Hook Dirs : /usr/share/libalpm/hooks/  /etc/pacman.d/hooks/
Lock File : /var/lib/pacman/db.lck
Log File  : /var/log/pacman.log
GPG Dir   : /etc/pacman.d/gnupg/

Something more I can check?

Offline

#6 2017-04-13 03:08:13

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Underestanding .install files from PKGBUILD

Perhaps share the ouput of pacman as you install one of the packages.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#7 2017-04-13 04:55:59

triptysd
Member
Registered: 2017-04-08
Posts: 7

Re: Underestanding .install files from PKGBUILD

Here's the output installing nvm

$ makepkg -fsicr
==> Making package: nvm 0.33.1-1 (Thu Apr 13 01:52:21 -03 2017)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found v0.33.1.zip
  -> Found init-nvm.sh
  -> Found install-nvm-exec
==> Validating source files with md5sums...
    v0.33.1.zip ... Passed
    init-nvm.sh ... Passed
    install-nvm-exec ... Passed
==> Extracting sources...
  -> Extracting v0.33.1.zip with bsdtar
==> Starting build()...
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issue...
==> Creating package "nvm"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: nvm 0.33.1-1 (Thu Apr 13 01:52:22 -03 2017)
==> Installing package nvm with pacman -U...
[sudo] password for blue: 
loading packages...
warning: nvm-0.33.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) nvm-0.33.1-1

Total Installed Size:  0.12 MiB
Net Upgrade Size:      0.00 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) reinstalling nvm                             [######################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
==> Cleaning up...

Offline

#8 2017-04-13 07:06:12

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Underestanding .install files from PKGBUILD

triptysd wrote:
warning: nvm-0.33.1-1 is up to date -- reinstalling

When I reinstall a package, I don't get the output either (neither in the terminal nor in the pacman logs). Try uninstalling first before installing the package.

I'm not sure if this is intended behaviour, though. I can't find anything in the man page. The closest I see is "Note that during an upgrade operation, none of the install or remove functions will be called.", but I don't really consider a reinstall as an upgrade.


pkgs │ hacks │ cfg │ blag

Offline

#9 2017-04-13 10:47:56

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,673
Website

Re: Underestanding .install files from PKGBUILD

Reinstall is an upgrade as far as pacman is concerned.

Offline

#10 2017-04-14 02:26:32

triptysd
Member
Registered: 2017-04-08
Posts: 7

Re: Underestanding .install files from PKGBUILD

Ok, feel like an idiot. It was all because I was 'updating' them and not 'installing'.

Sorry guys, and thank you for all the answers! smile
Dunno how to make the thread as solved!

Offline

#11 2017-04-14 02:53:44

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: Underestanding .install files from PKGBUILD

You can edit the first post and prepend [SOLVED] to the title.

Offline

Board footer

Powered by FluxBB