contrib: lsupgrade: optimize output
- Use printf instead of echo for better portability - Print whole path without reordering components - Deduplicate code
This commit is contained in:
parent
c0afb9cc39
commit
c7e38fdc2c
@ -37,13 +37,12 @@ find ./package packages -name Makefile | grep -v '^packages/packages/' | while r
|
|||||||
dirname="$(dirname "$dir" | cut -d/ -f 3-)"
|
dirname="$(dirname "$dir" | cut -d/ -f 3-)"
|
||||||
package="$(basename "$dir")"
|
package="$(basename "$dir")"
|
||||||
|
|
||||||
for file in "${SUFFIX1}"/*; do
|
for file in "${SUFFIX1}"/* "${SUFFIX2}"/*; do
|
||||||
echo "${GREEN}$(basename "${file}")${RESET}" "(${BLUE}${repo}${RESET}/${dirname}${dirname:+/}${RED}${package}${RESET}/${SUFFIX1})"
|
basename="$(basename "${file}")"
|
||||||
done
|
suffix="$(dirname "${file}")"
|
||||||
for file in "${SUFFIX2}"/*; do
|
printf "%s\t%s\n" "${basename}" "${BLUE}${repo}${RESET}/${dirname}${dirname:+/}${RED}${package}${RESET}/${suffix}/${GREEN}${basename}${RESET}"
|
||||||
echo "${GREEN}$(basename "${file}")${RESET}" "(${BLUE}${repo}${RESET}/${dirname}${dirname:+/}${RED}${package}${RESET}/${SUFFIX2})"
|
|
||||||
done
|
done
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
done | sort
|
done | sort | cut -f2-
|
||||||
|
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user