Commit b3f1531b2abf53b8e2676054fb3d7007c3d94d12

Authored by Sergio Oliveira
1 parent adcb6728

Make script work on Linux and Darwin

Showing 1 changed file with 8 additions and 2 deletions   Show diff stats
update_obs.sh
1 1 #!/bin/bash
2 2  
3   -which -s osc || { echo "osc must be installed"; exit 1; }
  3 +which osc || { echo "osc must be installed"; exit 1; }
4 4  
5 5 VERSION=`python setup.py --version`
  6 +PLATFORM=`uname`
6 7  
7 8 pull_obs () {
8 9 if [ -d .obs ]
... ... @@ -31,7 +32,12 @@ add_to_obs () {
31 32  
32 33  
33 34 update_spec_versions () {
34   - sed -i '' -E "s/(\%define (unmangled_)?version).*/\1 $VERSION/;" colab.spec
  35 + regex="s/(\%define (unmangled_)?version).*/\1 $VERSION/;"
  36 + if [[ "$PLATFORM" == 'Darwin' ]]; then
  37 + sed -i '' -E "$regex" colab.spec
  38 + else
  39 + sed -i -E "$regex" colab.spec
  40 + fi
35 41 }
36 42  
37 43  
... ...