summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/opkg-utils/opkg-utils/pipefail.patch
blob: 55ddcc1fd20d8067d4221b8d4e8a45265b7a27f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
We need opkg-build to fail if for example the tar command is passed invalid 
options. Without this, we see silently created empty packaged where data.tar
is zero bytes in size. This creates hard to debug problems.

An example is when reproducible builds are enabled and run on old hosts like
centos7 which has tar < 1.28:

Subprocess output:tar: unrecognized option '--clamp-mtime'
Try `tar --help' or `tar --usage' for more information.

Upstream-Status: Pending
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Index: opkg-utils-0.4.1/opkg-build
===================================================================
--- opkg-utils-0.4.1.orig/opkg-build
+++ opkg-utils-0.4.1/opkg-build
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 : <<=cut
 =head1 NAME
@@ -12,6 +12,7 @@ opkg-build - construct an .opk from a di
 #   Updated to work on Familiar Pre0.7rc1, with busybox tar.
 #   Note it Requires: binutils-ar (since the busybox ar can't create)
 set -e
+set -o pipefail
 
 version=1.0