Skip to content

replace critical error into warning when package is not available in repositories #2604

@vermaden

Description

@vermaden

I got pkg prime-list from one host and wanted to install these packages on other host.

HOSTA % pkg prime-list > ASD
HOSTA % scp ASD HOSTB:
HOSTB % doas pkg install $( cat ASD )
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
All repositories are up to date.
New version of pkg detected; it needs to be installed first.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
        pkg: 2.4.2 -> 2.5.1 [FreeBSD-ports]

Number of packages to be upgraded: 1

The operation will free 24 MiB.

Proceed with this action? [y/N]: y
[1/1] Upgrading pkg from 2.4.2 to 2.5.1...
[1/1] Extracting pkg-2.5.1: 100%
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'clusterssh' have been found in the repositories
pkg: No packages available to install matching 'darling-dmg' have been found in the repositories
pkg: No packages available to install matching 'deltachat-desktop' have been found in the repositories
pkg: No packages available to install matching 'dialog4ports' have been found in the repositories
pkg: No packages available to install matching 'kf5-extra-cmake-modules' have been found in the repositories
pkg: No packages available to install matching 'linux-widevine-cdm' have been found in the repositories
pkg: No packages available to install matching 'sgrep' have been found in the repositories

... and I was critically 'exited' with information that SOME of the packages are missing in the repos.

Now this is the way to IGNORE them:

HOSTB % doas pkg install $( cat ASD | grep -v -e clusterssh -e darling-dmg -e deltachat-desktop -e dialog4ports -e kf5-extra-cmake-modules -e linux-widevine-cdm -e sgrep )

Which is ... a real PITA to be honest.

Please replace EXIT 1 behaviour when SOME packages are not available in the repos into WARNING list that SOME packages that are not available will not be installed.

Thanks,
vermaden

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions