Change in osmo-ci[master]: nightly-packages: Move some code and rename some vars to look similar...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Sun Apr 14 22:01:16 UTC 2019


Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/13604 )

Change subject: nightly-packages: Move some code and rename some vars to look similar to latest-packages
......................................................................

nightly-packages: Move some code and rename some vars to look similar to latest-packages

Change-Id: I177bb7fb75e293ef665e95363a38c6b4f8e49c13
---
M scripts/osmocom-latest-packages.sh
M scripts/osmocom-nightly-packages.sh
2 files changed, 28 insertions(+), 25 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve; Verified
  Harald Welte: Looks good to me, approved



diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh
index d647d32..e70dd92 100755
--- a/scripts/osmocom-latest-packages.sh
+++ b/scripts/osmocom-latest-packages.sh
@@ -18,6 +18,7 @@
   exit 1
 fi
 
+### OBS build
 prepare() {
   # start with a checkout of the project
   if [ -d $PROJ ]; then
diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh
index 26b8bc9..e9cc778 100755
--- a/scripts/osmocom-nightly-packages.sh
+++ b/scripts/osmocom-nightly-packages.sh
@@ -1,33 +1,21 @@
 #!/bin/bash
+
 # requirements
 # apt install devscripts git-buildpackage osc git
 
 set -e
 set -x
 
+# OBS project name
+PROJ=network:osmocom:nightly
+
+DT=$(date +%Y%m%d)
+TOP=$(pwd)/$(mktemp -d nightly-3g_XXXXXX)
+
 if ! which osc >/dev/null 2>/dev/null ; then
   echo "osc binary not found"
   exit 1
 fi
-DT=$(date +%Y%m%d)
-PROJ=network:osmocom:nightly
-
-### common
-checkout() {
-  local name=$1
-  local branch=$2
-  local url="https://git.osmocom.org"
-
-  cd "$REPO"
-
-  if [ -n "$branch" ] ; then
-    git clone "$url/$name" -b "$branch"
-  else
-    git clone "$url/$name"
-  fi
-
-  cd -
-}
 
 ### OBS build
 prepare() {
@@ -56,6 +44,23 @@
   echo -n "$version"
 }
 
+### common
+checkout() {
+  local name=$1
+  local branch=$2
+  local url="https://git.osmocom.org"
+
+  cd "$REPO"
+
+  if [ -n "$branch" ] ; then
+    git clone "$url/$name" -b "$branch"
+  else
+    git clone "$url/$name"
+  fi
+
+  cd -
+}
+
 build() {
   local name=$1
   local changelog=$2
@@ -144,12 +149,11 @@
 }
 
 build_osmocom() {
-  BASE=$PWD
-  DATA=$BASE/data
-  REPO=$BASE/repo
+  DATA=$TOP/data
+  REPO=$TOP/repo
 
   # rather than including a dangerous 'rm -rf *' here, lets delegate to the user:
-  if [ -n "$(ls)" ]; then
+  if [ -n "$(ls $TOP)" ]; then
     echo "ERROR: I need to run in an empty directory."
     exit 1
   fi
@@ -224,6 +228,4 @@
   post
 }
 
-TMPDIR=$(mktemp -d nightly-3g_XXXXXX)
-cd "$TMPDIR"
 build_osmocom

-- 
To view, visit https://gerrit.osmocom.org/13604
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I177bb7fb75e293ef665e95363a38c6b4f8e49c13
Gerrit-Change-Number: 13604
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190414/e5737d94/attachment.htm>


More information about the gerrit-log mailing list