Created
July 3, 2023 14:27
-
-
Save krnowak/a7e8d89e0241e15e7f4cd2f649326186 to your computer and use it in GitHub Desktop.
Package update quick hacks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pkg=${1} | |
version_old=${2} | |
version_new=${3} | |
#category=${pkg%%/*} | |
name=${pkg#*/} | |
fail() { | |
echo "$*" >&2 | |
exit 1 | |
} | |
old_gentoo_path="../main/sdk_container/src/third_party/portage-stable/${pkg}/${name}-${version_old}.ebuild" | |
old_overlay_path="../main/sdk_container/src/third_party/coreos-overlay/${pkg}/${name}-${version_old}.ebuild" | |
new_gentoo_path="./sdk_container/src/third_party/portage-stable/${pkg}/${name}-${version_new}.ebuild" | |
new_overlay_path="./sdk_container/src/third_party/coreos-overlay/${pkg}/${name}-${version_new}.ebuild" | |
if [[ -e "${old_gentoo_path}" ]] && [[ -e "${old_overlay_path}" ]]; then | |
fail "Old ebuild ${version_old} exists in both gentoo and overlay" | |
fi | |
if [[ -e "${new_gentoo_path}" ]] && [[ -e "${new_overlay_path}" ]]; then | |
fail "New ebuild ${version_new} exists in both gentoo and overlay" | |
fi | |
old_path='' | |
new_path='' | |
if [[ -e "${old_gentoo_path}" ]]; then | |
old_path="${old_gentoo_path}" | |
fi | |
if [[ -e "${old_overlay_path}" ]]; then | |
old_path="${old_overlay_path}" | |
fi | |
if [[ -e "${new_gentoo_path}" ]]; then | |
new_path="${new_gentoo_path}" | |
fi | |
if [[ -e "${new_overlay_path}" ]]; then | |
new_path="${new_overlay_path}" | |
fi | |
if [[ -z "${old_path}" ]]; then | |
fail "Old version ${version_old} does not exist neither in overlay nor in gentoo" | |
fi | |
if [[ -z "${new_path}" ]]; then | |
fail "New version ${version_new} does not exist neither in overlay nor in gentoo" | |
fi | |
diff "${old_path}" "${new_path}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
pkg=${1} | |
yell() { | |
echo | |
echo '!!!!!!!!!!!!!!!!!!' | |
echo ' ' "${@}" | |
echo '!!!!!!!!!!!!!!!!!!' | |
echo | |
} | |
cat_entries() { | |
for entry; do | |
echo "BEGIN ENTRY: ${entry}" | |
cat "${entry}" | |
echo "END ENTRY: ${entry}" | |
done | |
} | |
gg() { | |
git --no-pager grep "${@}" || : | |
} | |
yell "${pkg} in overlay profiles" | |
gg "${pkg}" -- sdk_container/src/third_party/coreos-overlay/profiles | |
yell "${pkg} in gentoo profiles" | |
gg "${pkg}" -- sdk_container/src/third_party/portage-stable/profiles | |
shopt -s nullglob | |
yell "${pkg} in env overrides" | |
cat_entries "sdk_container/src/third_party/coreos-overlay/coreos/config/env/${pkg}"* | |
yell "${pkg} in user patches" | |
for dir in "sdk_container/src/third_party/coreos-overlay/coreos/user-patches/${pkg}"*; do | |
echo "BEGIN DIRECTORY: ${dir}" | |
cat_entries "${dir}"/* | |
echo "END DIRECTORY: ${dir}" | |
done | |
yell "${pkg} in gentoo (outside profiles)" | |
gg "${pkg}" -- 'sdk_container/src/third_party/portage-stable' ':(exclude)sdk_container/src/third_party/portage-stable/profiles' | |
yell "${pkg} in overlay (outside profiles)" | |
gg "${pkg}" -- 'sdk_container/src/third_party/coreos-overlay' ':(exclude)sdk_container/src/third_party/coreos-overlay/profiles' | |
yell "${pkg} in scripts" | |
gg "${pkg}" -- ':(exclude)sdk_container/src/third_party/portage-stable' ':(exclude)sdk_container/src/third_party/coreos-overlay' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment