<p>osmith has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ci/+/18391">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">OBS: check required programs before start<br><br>osmocom-*-packages.sh take some time to execute and has quite a few<br>programs that are not commonly installed. Check the required<br>dependencies first, so it doesn't abort in the middle of the scripts if<br>these are missing. I just ran into this with the new meson dependency.<br><br>Change-Id: I46cf1aeedd61dbd4fc8fa3f24c60e29033339ead<br>---<br>M scripts/common-obs.sh<br>M scripts/common.sh<br>M scripts/osmocom-latest-packages.sh<br>M scripts/osmocom-nightly-packages.sh<br>4 files changed, 28 insertions(+), 10 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/91/18391/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/scripts/common-obs.sh b/scripts/common-obs.sh</span><br><span>index 5e21574..c07fbaa 100644</span><br><span>--- a/scripts/common-obs.sh</span><br><span>+++ b/scripts/common-obs.sh</span><br><span>@@ -1,6 +1,19 @@</span><br><span> #!/bin/sh</span><br><span> # Various common code used in the OBS (opensuse build service) related osmo-ci shell scripts</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+osmo_cmd_require \</span><br><span style="color: hsl(120, 100%, 40%);">+      dch \</span><br><span style="color: hsl(120, 100%, 40%);">+ dh \</span><br><span style="color: hsl(120, 100%, 40%);">+  dpkg-buildpackage \</span><br><span style="color: hsl(120, 100%, 40%);">+   gbp \</span><br><span style="color: hsl(120, 100%, 40%);">+ git \</span><br><span style="color: hsl(120, 100%, 40%);">+ meson \</span><br><span style="color: hsl(120, 100%, 40%);">+       mktemp \</span><br><span style="color: hsl(120, 100%, 40%);">+      osc \</span><br><span style="color: hsl(120, 100%, 40%);">+ patch \</span><br><span style="color: hsl(120, 100%, 40%);">+       sed \</span><br><span style="color: hsl(120, 100%, 40%);">+ wget</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> # Create the source for a dummy package, that conflicts with another dummy package in the current directory. Example</span><br><span> # of the structure that will be generated:</span><br><span> # osmocom-nightly</span><br><span>diff --git a/scripts/common.sh b/scripts/common.sh</span><br><span>index af7c354..917962e 100644</span><br><span>--- a/scripts/common.sh</span><br><span>+++ b/scripts/common.sh</span><br><span>@@ -157,3 +157,18 @@</span><br><span>    cd "$oldpwd"</span><br><span>       return $ret</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Abort the script if required programs are missing</span><br><span style="color: hsl(120, 100%, 40%);">+# $1...$n: program name</span><br><span style="color: hsl(120, 100%, 40%);">+osmo_cmd_require() {</span><br><span style="color: hsl(120, 100%, 40%);">+        local fail=0</span><br><span style="color: hsl(120, 100%, 40%);">+  for i in "$@"; do</span><br><span style="color: hsl(120, 100%, 40%);">+           if ! command -v "$i" >/dev/null 2>&1; then</span><br><span style="color: hsl(120, 100%, 40%);">+                        echo "Required program not found: $i"</span><br><span style="color: hsl(120, 100%, 40%);">+                       fail=1</span><br><span style="color: hsl(120, 100%, 40%);">+                fi</span><br><span style="color: hsl(120, 100%, 40%);">+    done</span><br><span style="color: hsl(120, 100%, 40%);">+  if [ "$fail" = 1 ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+            exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+        fi</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh</span><br><span>index 88c5094..ddf5359 100755</span><br><span>--- a/scripts/osmocom-latest-packages.sh</span><br><span>+++ b/scripts/osmocom-latest-packages.sh</span><br><span>@@ -15,11 +15,6 @@</span><br><span> TOP=$(pwd)</span><br><span> DEBSRCDIR="$TOP/debsrc"</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-if ! which osc >/dev/null 2>/dev/null ; then</span><br><span style="color: hsl(0, 100%, 40%);">-  echo "osc binary not found"</span><br><span style="color: hsl(0, 100%, 40%);">-  exit 1</span><br><span style="color: hsl(0, 100%, 40%);">-fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> ### OBS build</span><br><span> prepare() {</span><br><span>   # start with a checkout of the project</span><br><span>diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh</span><br><span>index b3f0461..8f36377 100755</span><br><span>--- a/scripts/osmocom-nightly-packages.sh</span><br><span>+++ b/scripts/osmocom-nightly-packages.sh</span><br><span>@@ -14,11 +14,6 @@</span><br><span> DT=$(date +%Y%m%d)</span><br><span> TOP=$(pwd)/$(mktemp -d nightly-3g_XXXXXX)</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-if ! which osc >/dev/null 2>/dev/null ; then</span><br><span style="color: hsl(0, 100%, 40%);">-  echo "osc binary not found"</span><br><span style="color: hsl(0, 100%, 40%);">-  exit 1</span><br><span style="color: hsl(0, 100%, 40%);">-fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> ### OBS build</span><br><span> prepare() {</span><br><span>   # clean up the whole space</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ci/+/18391">change 18391</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ci/+/18391"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ci </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I46cf1aeedd61dbd4fc8fa3f24c60e29033339ead </div>
<div style="display:none"> Gerrit-Change-Number: 18391 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>