2015-01-23 02:29:37 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-09-30 19:38:40 +00:00
|
|
|
set -e
|
2015-01-23 02:29:37 +00:00
|
|
|
# Script to list all upgrade scripts in a clear manner
|
|
|
|
# Limitations:
|
2016-07-29 20:30:11 +00:00
|
|
|
# * Does only show scripts of packages whose `files'/`luasrc' directories represent the whole image filesystem (which are all Gluon packages)
|
2015-01-23 02:29:37 +00:00
|
|
|
|
|
|
|
|
2016-07-29 20:30:11 +00:00
|
|
|
SUFFIX1=files/lib/gluon/upgrade
|
|
|
|
SUFFIX2=luasrc/lib/gluon/upgrade
|
2015-01-23 02:29:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
shopt -s nullglob
|
|
|
|
|
|
|
|
|
|
|
|
if tty -s <&1; then
|
|
|
|
RED="$(echo -e '\x1b[01;31m')"
|
|
|
|
GREEN="$(echo -e '\x1b[01;32m')"
|
|
|
|
BLUE="$(echo -e '\x1b[01;34m')"
|
|
|
|
RESET="$(echo -e '\x1b[0m')"
|
|
|
|
else
|
|
|
|
RED=
|
|
|
|
GREEN=
|
|
|
|
BLUE=
|
|
|
|
RESET=
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
pushd "$(dirname "$0")/.." >/dev/null
|
|
|
|
|
2022-01-03 01:41:33 +00:00
|
|
|
find ./package packages -name Makefile | grep -v '^packages/packages/' | while read -r makefile; do
|
2015-01-23 02:29:37 +00:00
|
|
|
dir="$(dirname "$makefile")"
|
|
|
|
|
|
|
|
pushd "$dir" >/dev/null
|
|
|
|
|
|
|
|
repo="$(dirname "$dir" | cut -d/ -f 2)"
|
|
|
|
dirname="$(dirname "$dir" | cut -d/ -f 3-)"
|
|
|
|
package="$(basename "$dir")"
|
|
|
|
|
2022-01-03 01:46:05 +00:00
|
|
|
for file in "${SUFFIX1}"/* "${SUFFIX2}"/*; do
|
|
|
|
basename="$(basename "${file}")"
|
|
|
|
suffix="$(dirname "${file}")"
|
|
|
|
printf "%s\t%s\n" "${basename}" "${BLUE}${repo}${RESET}/${dirname}${dirname:+/}${RED}${package}${RESET}/${suffix}/${GREEN}${basename}${RESET}"
|
2015-01-23 02:29:37 +00:00
|
|
|
done
|
|
|
|
popd >/dev/null
|
2022-01-03 01:46:05 +00:00
|
|
|
done | sort | cut -f2-
|
2015-01-23 02:29:37 +00:00
|
|
|
|
|
|
|
popd >/dev/null
|