Skip to content

Instantly share code, notes, and snippets.

@TheNetAdmin
Created August 16, 2022 09:57
Show Gist options
  • Save TheNetAdmin/bca05257d03ffbab941436b384a7aafb to your computer and use it in GitHub Desktop.
Save TheNetAdmin/bca05257d03ffbab941436b384a7aafb to your computer and use it in GitHub Desktop.
kvm-unit-tests dev scripts
#!/bin/bash
source "$(realpath $(dirname $0))/../patch/version.sh"
patch_dir="patches/${PATCH_VERSION}-public"
if [ ! -d "${patch_dir}" ]; then
echo "Cannot find ${patch_dir}"
exit 1
fi
echo "All patches"
ls -1 "${patch_dir}"
send_email() {
git send-email \
--to "[email protected]" \
--suppress-cc=all \
--cover-letter \
--validate \
$* \
"${patch_dir}"
}
echo "Dry-run (quiet):"
send_email --dry-run --quiet
echo ""
read -p "Dry-run (quiet) looks good? Ctrl-C to cancel"
echo "Dry-run (verbose):"
send_email --dry-run
echo ""
read -p "Dry-run looks good? Ctrl-C to cancel"
echo ""
read -p "Ready to really send it? Ctrl-C to cancel"
echo "Sending email:"
send_email
#!/bin/bash
set -x
set -e
source "$(realpath $(dirname $0))/../patch/version.sh"
patch_path="patches/${PATCH_VERSION}-public"
if (($# != 0)); then
echo "Error: do not provide any argument!"
exit 1
fi
if [ ! -d "${patch_path}" ]; then
echo "Cannot find ${patch_path}"
exit 1
fi
echo "All patches"
ls -1 "${patch_path}"
echo "Patch dir: ${patch_path}"
# echo "You are not ready for PUBLIC emailing, trust me!"
# exit 2
echo "Are you serious to send it publically (Ctrl-C to cancel)?"
read
# echo "Check patch version, is it correct?"
# exit 2
## Emails suggested by Marc
## KVM:
## - [email protected]
## - [email protected]
## - [email protected]
#
## Google
## - [email protected]
## - [email protected]
## - [email protected]
## - [email protected]
## - [email protected]
## - [email protected]
#
## AMD
## - [email protected]
## - [email protected]
#
## cc's on Varad's email thread (out of politeness):
## - [email protected]
## - [email protected]
## - [email protected]
send_email() {
git send-email \
--to "[email protected]" \
--to "[email protected]" \
--to "[email protected]" \
--cc "[email protected]" \
--cc "[email protected]" \
--cc "[email protected]" \
--cc "[email protected]" \
--cc "[email protected]" \
--cc "[email protected]" \
--cc "[email protected]" \
--cc "[email protected]" \
--cc "[email protected]" \
--cover-letter \
--suppress-cc=all \
--validate \
$* \
"${patch_path}"
}
echo "Dry-run (verbose):"
send_email --dry-run
echo ""
read -p "Dry-run looks good? Ctrl-C to cancel"
echo ""
read -p "Ready to really send it? Ctrl-C to cancel"
echo ""
read -p "One more check, send it? Ctrl-C to cancel"
echo "Sending email:"
send_email
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment