Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install-port add --test option #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion mpbb-install-port
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@ Options:
--source
Build the port from source, ignoring binary archives.

--test
Test the port by running \`port test <port>'.

Run \`$prog help' for global options and a list of other subcommands.
EOF
}

install-port() {
local args
parseopt source "$@" || return
parseopt source,test "$@" || return
# $option_source is set by parseopt
# shellcheck disable=SC2154
: "${option_source=0}"
: "${option_test=0}"
set -- ${args+"${args[@]}"}
local source_flag
[[ "${option_source}" -eq 1 ]] && source_flag=s
Expand Down Expand Up @@ -108,6 +112,18 @@ install-port() {
fi
return 1
fi

if [[ "${option_test}" -eq 1 ]]; then
if "${option_prefix}/bin/port" "-d" test "$@"; then
echo "Testing '$port' ... [OK]" >> "$log_subports_progress"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current base release, this will fail for any port that doesn't set test.run yes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmroot may I assume that the next release which will happen relatively soon changes that behaviour?

else
echo "Testing of '$port' failed."
# log: summary for the portwatcher
echo "Testing '$port' ... [ERROR] maintainers: $(get-maintainers "$port")." >> "$log_subports_progress"
return 1
fi
fi

time_stop=$(date +%s)

# log: summary for the portwatcher
Expand Down