Commit b209a4e2 authored by Steve Plimpton's avatar Steve Plimpton Committed by GitHub
Browse files

Merge pull request #614 from akohlmey/fixes-for-stable

Fixes for stable
parents 52bec0f3 27553283
Loading
Loading
Loading
Loading
+21 −5
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@
from __future__ import print_function
import sys,os,re,subprocess

# help message

help = """
Syntax from src dir: make lib-kim args="-b -v version  -a kim-name"
                 or: make lib-kim args="-b -a everything"
@@ -78,13 +80,27 @@ def which(program):
  return None

def geturl(url,fname):
  success = False

  if which('curl') != None:
    cmd = 'curl -L -o "%s" %s' % (fname,url)
  elif which('wget') != None:
    try:
      subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
      success = True
    except subprocess.CalledProcessError as e:
      print("Calling curl failed with: %s" % e.output.decode('UTF-8'))

  if not success and which('wget') != None:
    cmd = 'wget -O "%s" %s' % (fname,url)
  else: error("cannot find 'wget' or 'curl' to download source code")
  txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
  return txt
    try:
      subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
      success = True
    except subprocess.CalledProcessError as e:
      print("Calling wget failed with: %s" % e.output.decode('UTF-8'))

  if not success:
    error("Failed to download source code with 'curl' or 'wget'")
  return

# parse args

+18 −4
Original line number Diff line number Diff line
@@ -65,13 +65,27 @@ def which(program):
  return None

def geturl(url,fname):
  success = False

  if which('curl') != None:
    cmd = 'curl -L -o "%s" %s' % (fname,url)
  elif which('wget') != None:
    try:
      subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
      success = True
    except subprocess.CalledProcessError as e:
      print("Calling curl failed with: %s" % e.output.decode('UTF-8'))

  if not success and which('wget') != None:
    cmd = 'wget -O "%s" %s' % (fname,url)
  else: error("cannot find 'wget' or 'curl' to download source code")
  txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
  return txt
    try:
      subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
      success = True
    except subprocess.CalledProcessError as e:
      print("Calling wget failed with: %s" % e.output.decode('UTF-8'))

  if not success:
    error("Failed to download source code with 'curl' or 'wget'")
  return

# parse args

+18 −4
Original line number Diff line number Diff line
@@ -65,13 +65,27 @@ def which(program):
  return None

def geturl(url,fname):
  success = False

  if which('curl') != None:
    cmd = 'curl -L -o "%s" %s' % (fname,url)
  elif which('wget') != None:
    try:
      subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
      success = True
    except subprocess.CalledProcessError as e:
      print("Calling curl failed with: %s" % e.output.decode('UTF-8'))

  if not success and which('wget') != None:
    cmd = 'wget -O "%s" %s' % (fname,url)
  else: error("cannot find 'wget' or 'curl' to download source code")
  txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
  return txt
    try:
      subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
      success = True
    except subprocess.CalledProcessError as e:
      print("Calling wget failed with: %s" % e.output.decode('UTF-8'))

  if not success:
    error("Failed to download source code with 'curl' or 'wget'")
  return

# parse args

+18 −4
Original line number Diff line number Diff line
@@ -64,13 +64,27 @@ def which(program):
  return None

def geturl(url,fname):
  success = False

  if which('curl') != None:
    cmd = 'curl -L -o "%s" %s' % (fname,url)
  elif which('wget') != None:
    try:
      subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
      success = True
    except subprocess.CalledProcessError as e:
      print("Calling curl failed with: %s" % e.output.decode('UTF-8'))

  if not success and which('wget') != None:
    cmd = 'wget -O "%s" %s' % (fname,url)
  else: error("cannot find 'wget' or 'curl' to download source code")
  txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
  return txt
    try:
      subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
      success = True
    except subprocess.CalledProcessError as e:
      print("Calling wget failed with: %s" % e.output.decode('UTF-8'))

  if not success:
    error("Failed to download source code with 'curl' or 'wget'")
  return

# parse args

+4 −3
Original line number Diff line number Diff line
@@ -339,17 +339,18 @@ no-%:
        fi;

# download/build/install a package library
# update the timestamp on main.cpp to trigger a relink with "make machine"

lib-%:
	@if [ -e ../lib/$(LIBDIR)/Install.py ]; then \
	  echo "Installing lib $(@:lib-%=%)"; \
	  cd ../lib/$(LIBDIR); $(PYTHON) Install.py $(args); \
	  ( cd ../lib/$(LIBDIR); $(PYTHON) Install.py $(args) ); \
	elif [ -e ../lib/$(LIBUSERDIR)/Install.py ]; then \
	  echo "Installing lib $(@:lib-user-%=%)"; \
	  cd ../lib/$(LIBUSERDIR); $(PYTHON) Install.py $(args); \
	  ( cd ../lib/$(LIBUSERDIR); $(PYTHON) Install.py $(args) ); \
	else \
	  echo "Install script for lib $(@:lib-%=%) does not exist"; \
	fi;
	fi; touch main.cpp

# status = list src files that differ from package files
# update = replace src files with newer package files
Loading