Giter Site home page Giter Site logo

Ignore missing packages about pkg HOT 4 OPEN

vermaden avatar vermaden commented on July 17, 2024
Ignore missing packages

from pkg.

Comments (4)

bapt avatar bapt commented on July 17, 2024 2

I agree having a flag for this will be interesting...

from pkg.

emaste avatar emaste commented on July 17, 2024 2

Or what about something like:

pkg: No packages available to install matching 'CATEGORY1/PORT1' have been found in the repositories
Install other requested packages [Y/n]?

The flag could support yes/no/ask, with default to ask?

from pkg.

vermaden avatar vermaden commented on July 17, 2024 1

@emaste

Default can be ask like with Your proposal above.

I would just suggest if user added -y flag - then yes is assumed and no questions asked.

Regards,
vermaden

from pkg.

vermaden avatar vermaden commented on July 17, 2024

I currently overcome that with sed(1) removing the packages that are missing - but that requires 2 pkg(8) runs instead of just 1. One 'dry' run to get missing packages. One 'real' run with only packages that are available.

Solution below.

CHROOT=/var/tmp/14.0-RC2
PACKAGES="
sysutils/automount                                                      
sysutils/beadm
www/asdasdasd
www/bsdbsdbsd"

while read EXCLUDE
do
  [ "${EXCLUDE}" = "" ] && break
  PACKAGES=$( echo ${PACKAGES} | sed s.${EXCLUDE}..g )
done << EOF
$(
  chroot "${CHROOT}" \
    /usr/bin/env ASSUME_ALWAYS_YES=yes pkg install -y --ignore-missing ${PACKAGES} 2>&1 \
      | grep "No packages available to install matching" \
      | awk -F\' '{print $2}'
)
EOF

chroot "${CHROOT}" \
  /usr/bin/env ASSUME_ALWAYS_YES=yes pkg install -y --ignore-missing ${PACKAGES}

Regards,
vermaden

EDIT: Added [ "${EXCLUDE}" = "" ] && break if there are not EXCLUDES (all packages available).

from pkg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.