Skip to content
Open
Show file tree
Hide file tree
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
20 changes: 19 additions & 1 deletion tumbleweed
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
VERSION="development"
URL_PRE_MIGRATE="http://download.tumbleweed.boombatower.com"
URL_POST_MIGRATE="http://download.opensuse.org/history"
URL_REVIEWS="https://review.tumbleweed.boombatower.com/data"
CONFIG_DIR="/etc/zypp"
VARS_DIR="$CONFIG_DIR/vars.d"
VAR_NAME="snapshotVersion"
Expand Down Expand Up @@ -291,6 +292,22 @@ tumbleweed_unmigrate()
sudo rm -r "$REPOS_DIR/.migrated"
}

tumbleweed_reviews()
{
local reviews_yml_all=$(curl -s "$URL_REVIEWS/score.yaml")
local reviews_yml=$(echo "$reviews_yml_all" | tail -n 300)
local releases=$(echo "$reviews_yml" | grep -E "^'([0-9]{8})':$" | grep -oE "[0-9]{8}" | sort -r)

echo "Release | Rating | Stability"
echo "-----------------------------"
for r in $releases; do
local data=$(echo "$reviews_yml" | grep -A2 "$r")
local score=$(echo "$data" | awk 'NR==2' | cut -d':' -f2)
local stability=$(echo "$data" | awk 'NR==3' | cut -d':' -f2)
echo "$r | $score | $stability"
done
}

tumbleweed_usage()
{
cat <<_EOF_
Expand All @@ -316,6 +333,7 @@ revert Revert to the previous snapshot or repo state.
uninit Revert back to a snapshotless repository setup.
migrate Migrate from boombatower hosting to download.opensuse.org.
unmigrate Revert migration to official hosting.
reviews Show release reviews and ratings
Copy link
Owner

Choose a reason for hiding this comment

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

super nit: can we make this singular?

_EOF_
}

Expand All @@ -326,7 +344,7 @@ tumbleweed_handle()
--force) force=1 ; ;;
--install) install=1 ; ;;
-h|--help) command="usage" ; ;;
history|init|installed|latest|list|revert|status|target|uninit|update|migrate|unmigrate)
history|init|installed|latest|list|revert|status|target|uninit|update|migrate|unmigrate|reviews)
command="$1" ; ;;
version)
command="installed" ; ;;
Expand Down
2 changes: 1 addition & 1 deletion tumbleweed-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
_tumbleweed_completion()
{
if [ ${#COMP_WORDS[@]} -eq 2 ] ; then
COMPREPLY=($(compgen -W "history init installed latest list migrate revert status switch target uninit unmigrate update upgrade version --version --help" -- "${COMP_WORDS[-1]}"))
COMPREPLY=($(compgen -W "history init installed latest list migrate revert status switch target uninit unmigrate update upgrade reviews version --version --help" -- "${COMP_WORDS[-1]}"))
elif [[ ${#COMP_WORDS[@]} -gt 2 && (
"${COMP_WORDS[1]}" == "init" ||
"${COMP_WORDS[1]}" == "switch" ||
Expand Down