summaryrefslogtreecommitdiff
path: root/make-archive
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2021-03-23 23:49:46 +0000
committerSteve McIntyre <steve@einval.com>2021-03-23 23:49:46 +0000
commit1251a7ba86fc40a6aad8b4fecdbca2b61808d9fa (patch)
tree2125fda549aaca55cb49a48d54be77dec7fbf3df /make-archive
parent85b409232ce89b34626df9d72abedf5d4f5ccef6 (diff)
parent031e5cce385d3f96b1caa1d53495332a7eb03749 (diff)
downloadefi-boot-shim-debian/15.3-1.tar.gz
efi-boot-shim-debian/15.3-1.zip
Update upstream source from tag 'upstream/15.3'debian/15.3-1
Update to upstream version '15.3' with Debian dir 1b484f1c1ac270604a5a1451b34de4b0865c6211
Diffstat (limited to 'make-archive')
-rwxr-xr-xmake-archive102
1 files changed, 102 insertions, 0 deletions
diff --git a/make-archive b/make-archive
new file mode 100755
index 00000000..d4f095f0
--- /dev/null
+++ b/make-archive
@@ -0,0 +1,102 @@
+#!/bin/sh
+set -e
+
+usage() {
+ status="${1}"
+ if [ "${status}" -eq 0 ] ; then
+ out=/dev/stdout
+ else
+ out=/dev/stderr
+ fi
+ {
+ echo "usage: make-archive [--origin ORIGIN] \\"
+ echo " [--test VERSION [GNUEFI_GIT_TAG]"
+ echo " |--release VERSION SHIM_GIT_TAG GNUEFI_GIT_TAG]"
+ } >>"${out}"
+ exit "${status}"
+}
+
+main() {
+ VERSION=""
+ SHIM_GIT_TAG=""
+ GNUEFI_GIT_TAG=""
+ ORIGIN="origin"
+ while [ $# -ne 0 ] ; do
+ case "$1" in
+ --help|--usage|-h|"-?")
+ usage 0
+ ;;
+ --origin)
+ if [ $# -lt 2 ] ; then
+ echo "error: missing origin" >>/dev/stderr
+ usage 1
+ fi
+ ORIGIN="${2}"
+ shift
+ ;;
+ --test)
+ if [ $# -lt 2 ] ; then
+ echo "error: missing version" >>/dev/stderr
+ usage 1
+ fi
+ VERSION="${2}"
+ if [ $# -gt 2 ] ; then
+ GNUEFI_GIT_TAG="${3}"
+ shift
+ fi
+ shift
+ ;;
+ --release)
+ if [ $# -lt 2 ] ; then
+ echo "error: missing version" >>/dev/stderr
+ usage 1
+ fi
+ if [ $# -lt 3 ] ; then
+ echo "error: missing shim git tag" >>/dev/stderr
+ usage 1
+ fi
+ if [ $# -lt 4 ] ; then
+ echo "error: missing gnuefi git tag" >>/dev/stderr
+ usage 1
+ fi
+ VERSION="${2}"
+ SHIM_GIT_TAG="${3}"
+ GNUEFI_GIT_TAG="${4}"
+ shift
+ shift
+ shift
+ ;;
+ *)
+ echo unknown argument "\"$1\"" >>/dev/stderr
+ usage 1
+ ;;
+ esac
+ shift
+ done
+
+ ARCHIVE_DIR="$(mktemp -d)"
+ rm -rf "${ARCHIVE_DIR}/shim-${VERSION}" "${ARCHIVE_DIR}/shim-${VERSION}"
+ mkdir -p "${ARCHIVE_DIR}/shim-${VERSION}/gnu-efi"
+ cd gnu-efi || exit 1
+ if [ "x" = "x${GNUEFI_GIT_TAG}" ] ; then
+ git archive --format=tar "$(git log -1 --pretty=format:%h)" | ( cd "${ARCHIVE_DIR}/shim-${VERSION}/gnu-efi" ; tar x )
+ else
+ git archive --format=tar "${ORIGIN}/${GNUEFI_GIT_TAG}" | ( cd "${ARCHIVE_DIR}/shim-${VERSION}/gnu-efi" ; tar x )
+ fi
+ cd ..
+ if [ "x" = "x${SHIM_GIT_TAG}" ] ; then
+ git archive --format=tar "$(git log -1 --pretty=format:%h)" | ( cd "${ARCHIVE_DIR}/shim-${VERSION}" ; tar x )
+ else
+ # ORIGIN doesn't yet have this tag
+ git archive --format=tar "${SHIM_GIT_TAG}" | ( cd "${ARCHIVE_DIR}/shim-${VERSION}" ; tar x )
+ fi
+ git log -1 --pretty=format:%H > "${ARCHIVE_DIR}/shim-${VERSION}/commit"
+ DIR="$PWD"
+ cd "${ARCHIVE_DIR}"
+ tar -c --bzip2 -f "${DIR}/shim-${VERSION}.tar.bz2" "shim-${VERSION}"
+ rm -rf "${ARCHIVE_DIR}"
+ echo "The archive is in shim-${VERSION}.tar.bz2"
+ exit 0
+}
+
+main "${@}"