You are not logged in.

#1 2018-09-14 00:30:32

barmadrid
Member
Registered: 2016-07-26
Posts: 21

Set "Skip up-to-date packages" option permanently?

Instead of adding the --needed to pacman -S, can we set the option in pacman config file to set it permanently?

I need this as to skip the reinstallation of some packages when building a custom Arch ISO.

TIA

Last edited by barmadrid (2018-09-14 00:44:10)

Offline

#2 2018-09-14 03:37:48

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,441

Re: Set "Skip up-to-date packages" option permanently?

It's a script and scripts are easy to do things automatically in. Add --needed to the script.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2018-09-14 14:22:27

barmadrid
Member
Registered: 2016-07-26
Posts: 21

Re: Set "Skip up-to-date packages" option permanently?

Eschwartz wrote:

It's a script and scripts are easy to do things automatically in. Add --needed to the script.

That is the question, where?

I have set to install base and base-devel groups in packages.x86_64, but some packages would get reinstalled as they are installed by mkarchiso in early process!

Offline

#4 2018-09-14 15:26:37

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,441

Re: Set "Skip up-to-date packages" option permanently?

Why are you setting the base group like this, since the base group is implicitly installed by mkarchiso? It is *always* extraneous. Moreover, the intent of packages.x86_64 is to install *additional* packages.

As for where to patch it -- submit a patch to the archiso project, which adds the --needed flag to the pacstrap invocation in mkarchiso's "_pacman" function. This will prevent reinstalling *base-devel* when it duplicates base.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2018-09-14 16:47:13

NuSkool
Member
Registered: 2015-03-23
Posts: 75

Re: Set "Skip up-to-date packages" option permanently?

I've done the following for testing in the past to avoid re-downloading current packages. Would be nice to have an option to set it.

Quote from an old test script:

# NOTE: Edit /usr/bin/pacstrap line 339 to add
# "--needed" option to pacman to expedite testing

Edit:

It would be line 336 in the current version of pacstrap provided by arch-install-scripts

line 336:

pacman_args+=(--noconfirm)

Edit:
Upon further thinking ... this was for testing a custom install script. I don't think archiso uses pacstrap so this is unrelated.



Edit:
Woops... yes archiso does in fact use arch-install-scripts so this may work for you after all.

$ aurt -pi archiso
  
:: archiso Is INSTALLED, official repo package  
:: Want additional info?                yes/no (5 sec timeout to no)

Repository      : extra
Name            : archiso
Version         : 39-1
Description     : Tools for creating Arch Linux live and install iso images
Architecture    : any
URL             : https://projects.archlinux.org/archiso.git/
Licenses        : GPL
Groups          : None
Provides        : None
Depends On      : make  arch-install-scripts  squashfs-tools  libisoburn  dosfstools  lynx
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Download Size   : 71.02 KiB
Installed Size  : 244.00 KiB
Packager        : Gerardo Exequiel Pozzi <djgera@archlinux.org>
Build Date      : Sun 26 Aug 2018 02:08:01 PM PDT
MD5 Sum         : 0fb5932f3664173e438efebd0e9ffa63
SHA-256 Sum     : 0806d48a6601a49fbc917436e43d0cd0a6e3c8423792b68b6f1b892c705285e2
Signatures      : 5ED514A45BD5C938

Last edited by NuSkool (2018-09-14 17:33:01)

Offline

#6 2018-09-14 22:07:47

barmadrid
Member
Registered: 2016-07-26
Posts: 21

Re: Set "Skip up-to-date packages" option permanently?

NuSkool wrote:

I've done the following for testing in the past to avoid re-downloading current packages. Would be nice to have an option to set it.

Quote from an old test script:

It would be line 336 in the current version of pacstrap provided by arch-install-scripts

line 336:

pacman_args+=(--noconfirm)

added that beside the --noconfirm yet it still gave warning of reinstall. Not sure if I should add something to mkarchso as well!

Offline

#7 2018-09-14 22:18:04

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,441

Re: Set "Skip up-to-date packages" option permanently?

It should tell you "warning: foo-2.0-1 is up to date -- skipping" but without knowing exactly what you changed we cannot know what you need to fix.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#8 2018-09-14 22:31:19

barmadrid
Member
Registered: 2016-07-26
Posts: 21

Re: Set "Skip up-to-date packages" option permanently?

Eschwartz wrote:

It should tell you "warning: foo-2.0-1 is up to date -- skipping" but without knowing exactly what you changed we cannot know what you need to fix.

I added --needed to line 336 of /usr/bin/pacstrap as NuSkool suggested so it becomes:

pacman_args+=(--noconfirm --needed)

And when running ./build.sh -v with base-devel in packages.x86_64  it says this:

warning: file-5.34-1 is up to date -- reinstalling
warning: findutils-4.6.0-2 is up to date -- reinstalling
warning: gawk-4.2.1-1 is up to date -- reinstalling
warning: gettext-0.19.8.1-2 is up to date -- reinstalling
warning: grep-3.1-1 is up to date -- reinstalling
warning: groff-1.22.3-7 is up to date -- reinstalling
warning: gzip-1.9-1 is up to date -- reinstalling
warning: pacman-5.1.1-1 is up to date -- reinstalling
warning: sed-4.5-1 is up to date -- reinstalling
warning: skipping target: sudo
warning: systemd-239.2-1 is up to date -- reinstalling
warning: texinfo-6.5-1 is up to date -- reinstalling
warning: util-linux-2.32.1-2 is up to date -- reinstalling
warning: which-2.21-2 is up to date -- reinstalling

Offline

#9 2018-09-14 22:37:42

NuSkool
Member
Registered: 2015-03-23
Posts: 75

Re: Set "Skip up-to-date packages" option permanently?

@ op: Eschwartz is light years beyond me regarding this stuff, so follow his advice first and formost.

Shouldn't add anything except the "--needed" to the existing line 336 in /usr/bin/pacstrap per below. Lines 335, 336, 337 shown.
If you don't see this, something is different or wrong... This has worked for me in the past so just trying to help.

Eschwartz, would this still work as intended as a "quick hack" with the newer version of pacstrap as it did for me in the past?

if (( ! interactive )); then
  pacman_args+=(--noconfirm)
fi

Edit line 336 per below:

  pacman_args+=(--noconfirm --needed)

Edit:
Looks like we cross posted barmadrid. Sounds like you're OK with the editing.

Edit:

Those are the base-devel packages barmadrid. So it should be downloading them of you've added them to the package list. I don't think archiso uses pacstrap for those. So you'd have to add --needed to something in the archiso scripts. Sorry for wasting your time....

$ pacman -Qg base-devel | awk '{print $2}'
autoconf
automake
binutils
bison
fakeroot
file
findutils
flex
gawk
gcc
gettext
grep
groff
gzip
libtool
m4
make
pacman
patch
pkgconf
sed
sudo
systemd
texinfo
util-linux
which

Last edited by NuSkool (2018-09-14 23:03:03)

Offline

#10 2018-09-14 23:16:02

barmadrid
Member
Registered: 2016-07-26
Posts: 21

Re: Set "Skip up-to-date packages" option permanently?

NuSkool wrote:

Edit:

Those are the base-devel packages barmadrid. So it should be downloading them of you've added them to the package list. I don't think archiso uses pacstrap for those. So you'd have to add --needed to something in the archiso scripts. Sorry for wasting your time....

Don't worry, thank you!

I would assume the same.

Offline

#11 2018-09-15 02:13:24

NuSkool
Member
Registered: 2015-03-23
Posts: 75

Re: Set "Skip up-to-date packages" option permanently?

Since I have some time to kill today and this made me curious.

Based on below, you could try removing pacstrap's -c option (lower case) from the _pacman function in the mkarchiso script combined with the edit to pacstrap. This may also explain whats going on if I'm understanding things right.

Lines 151 - 163 of /usr/bin/mkarchiso

# Install desired packages to airootfs
_pacman ()
{
    _msg_info "Installing packages to '${work_dir}/airootfs/'..."

    if [[ "${quiet}" = "y" ]]; then
        pacstrap -C "${pacman_conf}" -c -G -M "${work_dir}/airootfs" $* &> /dev/null
    else
        pacstrap -C "${pacman_conf}" -c -G -M "${work_dir}/airootfs" $*
    fi

    _msg_info "Packages installed successfully!"
}
$ pacstrap --help
usage: pacstrap [options] root [packages...]

  Options:
    -C config      Use an alternate config file for pacman
    -c             Use the package cache on the host, rather than the target
    -G             Avoid copying the host's pacman keyring to the target
    -i             Avoid auto-confirmation of package selections
    -M             Avoid copying the host's mirrorlist to the target

    -h             Print this help message

pacstrap installs packages to the specified new root directory. If no packages
are given, pacstrap defaults to the "base" group.



Edit:
On second thought, no, removing -c would have the opposite effect of what you want. Now I'm back to lost why the edit to pacstrap seems to not be working. Archiso creates the work directory directory when ran. Are you reusing work, except the per wiki files to delete when you rerun archiso?



Edit:
More clues from an old archiso build directory I didn't delete.

~/archiso-5-26-17/releng/work/x86_64/airootfs/var/log/pacman.log

The first line:

[2017-06-03 02:59] [PACMAN] Running 'pacman -r work/x86_64/airootfs -Sy --noconfirm --config=work/pacman.conf base syslinux'

Last edited by NuSkool (2018-09-15 02:59:18)

Offline

Board footer

Powered by FluxBB