FreeBSD Bugzilla – Attachment 177218 Details for
Bug 214381
ports make install doesn't handle symbolic links correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Cleaned-up version of script
port_install_chk (text/plain), 2.48 KB, created by
david
on 2016-11-20 23:04:06 UTC
(
hide
)
Description:
Cleaned-up version of script
Filename:
MIME Type:
Creator:
david
Created:
2016-11-20 23:04:06 UTC
Size:
2.48 KB
patch
obsolete
>#! /bin/sh ># Script to check a set of installed ports/packages and squawk if ># files that are supposed to be installed are not. > ># David H. Wolfskill Sun Nov 20 08:34:29 PST 2016 > >\unalias -a > >PKG=pkg-static > >me=${0##*/} >status=0 > >detail_level= >default_detail_level=2 > >Usage() { > cat >&2 <<E_o_Usage >Usage: $me [-d detail_level] [-h] pkg_name... >E_o_Usage > fmt -78 >&2 <<E_o_Usage >$me is used to determine if there are ports/packages only partially installed >-- that is, such that one or more of the files that SHOULD be installed are not present. The exit status will reflect a count of the number of files detected as missing, so (e.g.) 0 indicates that no problems were found. >E_o_Usage > cat >&2 <<E_o_Usage > >Command line flags are: > -d detail_level A non-negative integer specifying the level of detail > requested for the output: > 0: No output at all. > 1: Only list the port origins. > 2: List the port origins and each file detected as missing for each port > that is missing at least one file. > 3: In addiiton to the output for level 2, include port origins that are > not detected as missing files. > The default value is 2. > > -h Display this usage message and exit with an exit status of 0. > >E_o_Usage > fmt -78 >&2 <<E_o_Usage >The "pkg_name" arguments are specified just as they are for pkg(8): "*" may be >used as a "wildcard," but you will almost certainly need to escape it (to prevent the shell from expanding it). > >E_o_Usage >} > >while getopts "hd:" arg; do > case ${arg} in > d) detail_level=$( echo $OPTARG | sed -Ene 's/^([0-3])$/\1/p' ); continue;; > h) Usage; exit 0;; > ?) Usage; exit 1;; > esac >done >shift $(($OPTIND - 1)) > >if [ -z "$detail_level" ]; then > detail_level=$default_detail_level >fi > ># First, derive the ports from the provided pattern(s) >ports= >set -f >for pat in $@; do > ports="$ports "$( $PKG info -oq "$pat" ) >done >set +f > ># Then, check the files for each port >for port in $ports; do > port_status=0 > IFS=' \ >' > files=$( $PKG info --list-files $port | sed -Ene 's|^ (.*)$|\1|;s| |\ |gp' ) > missing= > for file in $files; do > if [ ! -e "$file" ]; then > missing="$missing $file" > port_status=$(( $port_status + 1 )) > fi > done > if [ $detail_level -ge 1 ]; then > if [ $port_status -ne 0 -o $detail_level -ge 3 ]; then > echo -n "$me: Identified $port_status missing file(s) for $port:" > if [ $detail_level -ge 2 ]; then > echo "$missing" | sed -e 's| /|\ > /|g' > fi > fi > fi > status=$(( $status + $port_status )) >done > >exit $status
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 214381
:
177213
|
177214
|
177218
|
177544
|
177546
|
177768