* [Buildroot] [PATCH 0/2 v2 autobuilders] buildroot-test: misc enhancenments (branch yem/reproduce)
@ 2015-04-12 12:42 Yann E. MORIN
2015-04-12 12:42 ` [Buildroot] [PATCH 1/2 v2 autobuilders] br-reproduce-build: quote variables Yann E. MORIN
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Yann E. MORIN @ 2015-04-12 12:42 UTC (permalink / raw)
To: buildroot
Hello All!
This small series fixes the br-reproduce script wrt. the URLs accepted
by the server.
Changes v1 -> v2:
- fix ugly POSIX shell syntax in favour of readable bashism (Thomas)
- fix quoting (Thomas)
Regards,
Yann E. MORIN.
The following changes since commit a7226db951d7e542b8a6b9b13e94a29a22879aff:
autbuild-run: fix legal-info (2015-04-06 23:17:13 +0200)
are available in the git repository at:
git://git.busybox.net/~ymorin/git/buildroot-test yem/reproduce
for you to fetch changes up to 4ec90d83a1df3ac770250375cbd7617dc2b6fe63:
br-reproduce-build: fix URL of gitid (2015-04-12 14:40:24 +0200)
----------------------------------------------------------------
Yann E. MORIN (2):
br-reproduce-build: quote variables
br-reproduce-build: fix URL of gitid
utils/br-reproduce-build | 39 +++++++++++++++++++++++++++------------
1 file changed, 27 insertions(+), 12 deletions(-)
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 1/2 v2 autobuilders] br-reproduce-build: quote variables
2015-04-12 12:42 [Buildroot] [PATCH 0/2 v2 autobuilders] buildroot-test: misc enhancenments (branch yem/reproduce) Yann E. MORIN
@ 2015-04-12 12:42 ` Yann E. MORIN
2015-04-12 12:42 ` [Buildroot] [PATCH 2/2 v2 autobuilders] br-reproduce-build: fix URL of gitid Yann E. MORIN
2015-04-12 17:29 ` [Buildroot] [PATCH 0/2 v2 autobuilders] buildroot-test: misc enhancenments (branch yem/reproduce) Thomas Petazzoni
2 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2015-04-12 12:42 UTC (permalink / raw)
To: buildroot
Even though we do not really support building in a path that
contains spaces (or other weird characters), it's still better
to quote variables.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
utils/br-reproduce-build | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/utils/br-reproduce-build b/utils/br-reproduce-build
index 01d1b7a..0ecfb54 100755
--- a/utils/br-reproduce-build
+++ b/utils/br-reproduce-build
@@ -16,30 +16,30 @@ if [ $# -ne 1 ] ; then
exit 1 ;
fi
-BUILD_ID=$1
+BUILD_ID="$1"
-BUILD_DIR=${OUTPUT_DIR}/${BUILD_ID}
+BUILD_DIR="${OUTPUT_DIR}/${BUILD_ID}"
-mkdir -p ${BUILD_DIR}
+mkdir -p "${BUILD_DIR}"
if [ $? -ne 0 ] ; then
echo "Cannot create output directory"
exit 1
fi
-wget -O ${BUILD_DIR}/config http://autobuild.buildroot.org/results/${BUILD_ID}/config
+wget -O "${BUILD_DIR}/config" "http://autobuild.buildroot.org/results/${BUILD_ID}/config"
if [ $? -ne 0 ] ; then
echo "Cannot get configuration for build ${BUILD_ID}"
- rm -f ${BUILD_DIR}
+ rm -f "${BUILD_DIR}"
exit 1
fi
-wget -O ${BUILD_DIR}/gitid http://autobuild.buildroot.org/results/${BUILD_ID}/gitid
+wget -O "${BUILD_DIR}/gitid" "http://autobuild.buildroot.org/results/${BUILD_ID}/gitid"
-cd ${BUILD_DIR}
-git clone ${BASE_GIT} buildroot
+cd "${BUILD_DIR}"
+git clone "${BASE_GIT}" buildroot
if [ $? -ne 0 ] ; then
echo "Cannot clone Buildroot Git repository"
- rm -rf ${BUILD_DIR}
+ rm -rf "${BUILD_DIR}"
exit 1
fi
@@ -50,17 +50,17 @@ git remote set-url origin git://git.busybox.net/buildroot
git fetch
if [ $? -ne 0 ] ; then
echo "Cannot fetch Buildroot official Git repository"
- rm -rf ${BUILD_DIR}
+ rm -rf "${BUILD_DIR}"
exit 1
fi
git checkout $(cat ../gitid)
if [ $? -ne 0 ] ; then
echo "Cannot checkout commit " $(cat ../gitid)
- rm -rf ${BUILD_DIR}
+ rm -rf "${BUILD_DIR}"
exit 1
fi
mkdir ../output
-cp ${BUILD_DIR}/config ../output/.config
+cp "${BUILD_DIR}/config" ../output/.config
make 2>&1 O=../output | tee logfile
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 2/2 v2 autobuilders] br-reproduce-build: fix URL of gitid
2015-04-12 12:42 [Buildroot] [PATCH 0/2 v2 autobuilders] buildroot-test: misc enhancenments (branch yem/reproduce) Yann E. MORIN
2015-04-12 12:42 ` [Buildroot] [PATCH 1/2 v2 autobuilders] br-reproduce-build: quote variables Yann E. MORIN
@ 2015-04-12 12:42 ` Yann E. MORIN
2015-04-12 17:29 ` [Buildroot] [PATCH 0/2 v2 autobuilders] buildroot-test: misc enhancenments (branch yem/reproduce) Thomas Petazzoni
2 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2015-04-12 12:42 UTC (permalink / raw)
To: buildroot
The canonical URL to the results on the autobuilder server wants the
sha1 to be prefixed with the first three letters of the sha1, like so:
b52/b52c54eafc2ea8814bb49850823e55d8e034d33d
Currently, this is done by a redirect on the server, but it is broken,
so that requests that do not conform to that scheme return empty
results. See for example the difference between those two calls:
wget -O OK 'http://autobuild.buildroot.org/results/b2c/b2cefd7d362c12ed99b708d11b988704778d450c/defconfig'
wget -O KO 'http://autobuild.buildroot.org/results/b2cefd7d362c12ed99b708d11b988704778d450c/defconfig'
So, currently, passing only the sah1 on the command line of br-reproduce
would not work, because the sha1 is used as-is to construct the URL. To
make it work, a user had to pass the sha1 prefixed with the first three
chars.
However, this is not very convenient.
Fix that:
- internally reconstruct the canonical URL;
- still accept a prefix-sha1 on the command line (for users that got
used to that behaviour).
Reported-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Changes v1 -> v2:
- use bashism to extract the first three chars, instead of the more
complex but POSIX-compliant construct (Thomas)
---
utils/br-reproduce-build | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/utils/br-reproduce-build b/utils/br-reproduce-build
index 0ecfb54..17d61f5 100755
--- a/utils/br-reproduce-build
+++ b/utils/br-reproduce-build
@@ -16,10 +16,25 @@ if [ $# -ne 1 ] ; then
exit 1 ;
fi
-BUILD_ID="$1"
+# The location where the results are stored on the server is
+# of the form 'xxx/xxxyyyyyyyy', where 'xxx' are the first
+# three chars of the sha1, and 'xxxyyyyyyyy' is the full sha1.
+#
+# We accept the user to pass either the full sha1, or the full
+# sha1 prefixed with the 'xxx' part. So we just extract the sha1
+# from the value passed by the user
+BUILD_ID="${1#*/}"
+# The build directory is only made of the full sha1, without the
+# leading 'xxx/' part
BUILD_DIR="${OUTPUT_DIR}/${BUILD_ID}"
+# Now, we construct the BUILD-ID as it is expected to be on the server:
+# - extract the first three chars of the sha1: use some shell triclery:
+# - prepend those three chars and a '/' to the full sha1
+BUILD_ID_SHORT="${BUILD_ID:0:3}"
+BUILD_ID="${BUILD_ID_SHORT}/${BUILD_ID}"
+
mkdir -p "${BUILD_DIR}"
if [ $? -ne 0 ] ; then
echo "Cannot create output directory"
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 0/2 v2 autobuilders] buildroot-test: misc enhancenments (branch yem/reproduce)
2015-04-12 12:42 [Buildroot] [PATCH 0/2 v2 autobuilders] buildroot-test: misc enhancenments (branch yem/reproduce) Yann E. MORIN
2015-04-12 12:42 ` [Buildroot] [PATCH 1/2 v2 autobuilders] br-reproduce-build: quote variables Yann E. MORIN
2015-04-12 12:42 ` [Buildroot] [PATCH 2/2 v2 autobuilders] br-reproduce-build: fix URL of gitid Yann E. MORIN
@ 2015-04-12 17:29 ` Thomas Petazzoni
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2015-04-12 17:29 UTC (permalink / raw)
To: buildroot
Dear Yann E. MORIN,
On Sun, 12 Apr 2015 14:42:09 +0200, Yann E. MORIN wrote:
> Yann E. MORIN (2):
> br-reproduce-build: quote variables
> br-reproduce-build: fix URL of gitid
Both applied, thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-12 17:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-12 12:42 [Buildroot] [PATCH 0/2 v2 autobuilders] buildroot-test: misc enhancenments (branch yem/reproduce) Yann E. MORIN
2015-04-12 12:42 ` [Buildroot] [PATCH 1/2 v2 autobuilders] br-reproduce-build: quote variables Yann E. MORIN
2015-04-12 12:42 ` [Buildroot] [PATCH 2/2 v2 autobuilders] br-reproduce-build: fix URL of gitid Yann E. MORIN
2015-04-12 17:29 ` [Buildroot] [PATCH 0/2 v2 autobuilders] buildroot-test: misc enhancenments (branch yem/reproduce) Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox