CRUX

Welcome to CRUX bug tracking.
Tasklist

FS#1843 - Please make the output of prt-get --test more common

Attached to Project: CRUX
Opened by Feodor Petrov (teodor) - Saturday, 09 January 2021, 11:02 GMT
Last edited by Feodor Petrov (teodor) - Saturday, 09 January 2021, 11:24 GMT
Task Type Improvement
Category tools → prt-get
Status New
Assigned To No-one
Operating System CRUX
Severity Low
Priority Normal
Reported Version 3.6
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Could you please make the output of prt-get --test to common style for better parsing:

1)
prt-get install <some_installed_port> --test
and
prt-get install <some_installed_port1> <some_installed_port2> --test
these give 2 different styles of output

2)
prt-get update <not_existing_port> --test
and
prt-get update <not_existing_port1> <not_existing_port2> --test
these give 2 different styles of output

3)
prt-get depinst <some_installed_port1> <some_installed_port2> --test
and
prt-get depinst <not_installed_port> <some_installed_port> --test
and
prt-get depinst <not_installed_port>
<not_existing_port> --test
these don't show information about already installed and not existing ports!
This task depends upon

Comment by Steffen Nurpmeso (steffen) - Monday, 11 January 2021, 17:13 GMT
How about using "prt-get printf"?
I use

#!/bin/sh -

if [ $# -eq 0 ]; then
echo New versions available for
news=`prt-get printf '%n %i\n' | grep -E 'diff$' | cut -f 1 -d ' '`
echo '=> '$news
else
news="$@"
fi

echo
echo Upgrading
ups=
for p in $news; do
if prt-get listlocked | grep -Eq "^$p\$"; then
echo Locked, skipping $p
else
[ -n "$ups" ] && ups="$ups "
ups="$ups$p"
fi
done
echo '=> '$ups

echo
deps=`prt-get quickdep $ups`
echo Dependency list
echo '=> '$deps

echo
echo 'Ok to continue (^C or else)'
read i

echo
echo Group installing what is new
prt-get grpinst $deps #|| exit $?

echo
echo Performing upgrade
xups=
for p in $deps $ups; do
if echo "$ups" | grep -Eqe "(^|[[:space:]])$p([[:space:]]|\$)"; then
if prt-get listlocked | grep -Eq "^$p\$"; then
echo Locked, skipping $p
else
if [ -n "$xups" ]; then
if echo "$xups" | grep -Eqe \
"(^|[[:space:]])$p([[:space:]]|\$)"
then
continue
fi
xups="$xups "
fi
xups="$xups$p"
fi
fi
done
prt-get update $xups

echo
echo rejmerge
rejmerge
Comment by Feodor Petrov (teodor) - Tuesday, 12 January 2021, 05:01 GMT
@steffen, I need it to notify me if there is no such port or it is already installed, when I try to install new/update some ports. It would be nice if --test show in following stile:
-- The following ports were not fount/already installed:
...
*** ...
as for 1 and as for several missing ports
But now it shows in two different styles when not found/already installed ports when for SINGLE and for SEVERAL missing ports.
Comment by Feodor Petrov (teodor) - Tuesday, 12 January 2021, 06:58 GMT
I suggest it to make single union style for when showing for one missing port and for several missing/already installed ports in listing whith --test option.
Also need to fix prt-get depinst <several ports> because it doesn't show full information when trying to install more than one already installed/not installed/missing ports.

Loading...