diff options
Diffstat (limited to 'meta/recipes-kernel/lttng/lttng-modules/0012-Improve-the-release-script.patch')
-rw-r--r-- | meta/recipes-kernel/lttng/lttng-modules/0012-Improve-the-release-script.patch | 173 |
1 files changed, 0 insertions, 173 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0012-Improve-the-release-script.patch b/meta/recipes-kernel/lttng/lttng-modules/0012-Improve-the-release-script.patch deleted file mode 100644 index f5e7fb55a2..0000000000 --- a/meta/recipes-kernel/lttng/lttng-modules/0012-Improve-the-release-script.patch +++ /dev/null | |||
@@ -1,173 +0,0 @@ | |||
1 | From a241d30fa82ed0be1026f14e36e8bd2b0e65740d Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
3 | Date: Mon, 23 Nov 2020 12:15:43 -0500 | ||
4 | Subject: [PATCH 12/16] Improve the release script | ||
5 | |||
6 | * Use git-archive, this removes all custom code to cleanup the repo, it | ||
7 | can now be used in an unclean repo as the code will be exported from | ||
8 | a specific tag. | ||
9 | * Add parameters, this will allow using the script on any machine | ||
10 | while keeping the default behavior for the maintainer. | ||
11 | |||
12 | Upstream-Status: Backport | ||
13 | |||
14 | Change-Id: I9f29d0e1afdbf475d0bbaeb9946ca3216f725e86 | ||
15 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
16 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
17 | --- | ||
18 | .gitattributes | 3 + | ||
19 | scripts/maintainer/do-release.sh | 121 +++++++++++++++++++++++++------ | ||
20 | 2 files changed, 100 insertions(+), 24 deletions(-) | ||
21 | create mode 100644 .gitattributes | ||
22 | |||
23 | diff --git a/.gitattributes b/.gitattributes | ||
24 | new file mode 100644 | ||
25 | index 00000000..7839355a | ||
26 | --- /dev/null | ||
27 | +++ b/.gitattributes | ||
28 | @@ -0,0 +1,3 @@ | ||
29 | +.gitattributes export-ignore | ||
30 | +.gitignore export-ignore | ||
31 | +.gitreview export-ignore | ||
32 | diff --git a/scripts/maintainer/do-release.sh b/scripts/maintainer/do-release.sh | ||
33 | index e0cec167..5e94e136 100755 | ||
34 | --- a/scripts/maintainer/do-release.sh | ||
35 | +++ b/scripts/maintainer/do-release.sh | ||
36 | @@ -1,37 +1,110 @@ | ||
37 | -#!/bin/sh | ||
38 | +#!/bin/bash | ||
39 | + | ||
40 | +set -eu | ||
41 | +set -o pipefail | ||
42 | |||
43 | # invoke with do-release 2.N.M, or 2.N.M-rcXX | ||
44 | |||
45 | -REL=$1 | ||
46 | -SRCDIR=~/git/lttng-modules | ||
47 | +# Default maintainer values | ||
48 | +SRCDIR="${HOME}/git/lttng-modules" | ||
49 | # The output files are created in ${HOME}/stable/ | ||
50 | -OUTPUTDIR=${HOME}/stable | ||
51 | +OUTPUTDIR="${HOME}/stable" | ||
52 | +SIGN="yes" | ||
53 | +VERBOSE="" | ||
54 | + | ||
55 | +usage() { | ||
56 | + echo "Usage: do-release.sh [OPTION]... RELEASE" | ||
57 | + echo | ||
58 | + echo "Mandatory arguments to long options are mandatory for short options too." | ||
59 | + echo " -s, --srcdir DIR source directory" | ||
60 | + echo " -o, --outputdir DIR output directory, must exist" | ||
61 | + echo " -n, --no-sign don't GPG sign the output archive" | ||
62 | + echo " -v, --verbose verbose command output" | ||
63 | +} | ||
64 | + | ||
65 | +POS_ARGS=() | ||
66 | +while [[ $# -gt 0 ]] | ||
67 | +do | ||
68 | + arg="$1" | ||
69 | + | ||
70 | + case $arg in | ||
71 | + -n|--no-sign) | ||
72 | + SIGN="no" | ||
73 | + shift 1 | ||
74 | + ;; | ||
75 | + | ||
76 | + -s|--srcdir) | ||
77 | + SRCDIR="$2" | ||
78 | + shift 2 | ||
79 | + ;; | ||
80 | + | ||
81 | + -o|--outputdir) | ||
82 | + OUTPUTDIR="$2" | ||
83 | + shift 2 | ||
84 | + ;; | ||
85 | + | ||
86 | + -v|--verbose) | ||
87 | + VERBOSE="-v" | ||
88 | + shift 1 | ||
89 | + ;; | ||
90 | + | ||
91 | + # Catch unknown arguments | ||
92 | + -*) | ||
93 | + usage | ||
94 | + exit 1 | ||
95 | + ;; | ||
96 | + | ||
97 | + *) | ||
98 | + POS_ARGS+=("$1") | ||
99 | + shift | ||
100 | + ;; | ||
101 | + esac | ||
102 | +done | ||
103 | +set -- "${POS_ARGS[@]}" | ||
104 | |||
105 | -if [ x"$1" = x"" ]; then | ||
106 | - echo "1 arg : VERSION"; | ||
107 | +REL=${1:-} | ||
108 | + | ||
109 | +if [ x"${REL}" = x"" ]; then | ||
110 | + usage | ||
111 | exit 1; | ||
112 | fi | ||
113 | |||
114 | -cd ${OUTPUTDIR} | ||
115 | +echo "Doing LTTng modules release ${REL}" | ||
116 | +echo " Source dir: ${SRCDIR}" | ||
117 | +echo " Output dir: ${OUTPUTDIR}" | ||
118 | +echo " GPG sign: ${SIGN}" | ||
119 | |||
120 | -echo Doing LTTng modules release ${REL} | ||
121 | +# Make sure the output directory exists | ||
122 | +if [ ! -d "${OUTPUTDIR}" ]; then | ||
123 | + echo "Output directory '${OUTPUTDIR}' doesn't exist." | ||
124 | + exit 1 | ||
125 | +fi | ||
126 | |||
127 | -mkdir lttng-modules-${REL} | ||
128 | -cd lttng-modules-${REL} | ||
129 | -cp -ax ${SRCDIR}/. . | ||
130 | +# Make sure the source directory is a git repository | ||
131 | +if [ ! -r "${SRCDIR}/.git/config" ]; then | ||
132 | + echo "Source directory '${SRCDIR}' isn't a git repository." | ||
133 | + exit 1 | ||
134 | +fi | ||
135 | |||
136 | -#cleanup | ||
137 | -make clean | ||
138 | -git clean -xdf | ||
139 | +# Set the git repo directory for all further git commands | ||
140 | +export GIT_DIR="${SRCDIR}/.git/" | ||
141 | |||
142 | -for a in \*.orig \*.rej Module.markers Module.symvers; do | ||
143 | - find . -name "${a}" -exec rm '{}' \;; | ||
144 | -done | ||
145 | -for a in outgoing .tmp_versions .git .pc; do | ||
146 | - find . -name "${a}" -exec rm -rf '{}' \;; | ||
147 | -done | ||
148 | +# Check if the release tag exists | ||
149 | +if ! git rev-parse "refs/tags/v${REL}" >/dev/null 2>&1; then | ||
150 | + echo "Release tag 'v${REL}' doesn't exist." | ||
151 | + exit 1 | ||
152 | +fi | ||
153 | + | ||
154 | +# Generate the compressed tar archive, the git attributes from the tag will be used. | ||
155 | +git archive $VERBOSE --format=tar --prefix="lttng-modules-${REL}/" "v${REL}" | bzip2 > "${OUTPUTDIR}/lttng-modules-${REL}.tar.bz2" | ||
156 | |||
157 | -cd .. | ||
158 | -tar cvfj lttng-modules-${REL}.tar.bz2 lttng-modules-${REL} | ||
159 | -mksums lttng-modules-${REL}.tar.bz2 | ||
160 | -signpkg lttng-modules-${REL}.tar.bz2 | ||
161 | +pushd "${OUTPUTDIR}" >/dev/null | ||
162 | +# Generate the hashes | ||
163 | +md5sum "lttng-modules-${REL}.tar.bz2" > "lttng-modules-${REL}.tar.bz2.md5" | ||
164 | +sha256sum "lttng-modules-${REL}.tar.bz2" > "lttng-modules-${REL}.tar.bz2.sha256" | ||
165 | + | ||
166 | +if [ "x${SIGN}" = "xyes" ]; then | ||
167 | + # Sign with the default key | ||
168 | + gpg --armor -b "lttng-modules-${REL}.tar.bz2" | ||
169 | +fi | ||
170 | +popd >/dev/null | ||
171 | -- | ||
172 | 2.25.1 | ||
173 | |||