From c7a134e1fb5e3a47bf13208b42bd441f9730b42b Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Fri, 19 Jun 2020 09:23:34 +0200 Subject: [PATCH] cue: use sudo when unpacking rtems cross compiler (WA) - not needed on Travis (where target directory is under HOME) --- cue.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cue.py b/cue.py index 758db98..c090ed0 100644 --- a/cue.py +++ b/cue.py @@ -197,7 +197,7 @@ elif 'HOME' in os.environ: homedir = os.getenv('HOME') cachedir = os.path.join(homedir, '.cache') toolsdir = os.path.join(homedir, '.tools') -rtemsdir = os.path.join(homedir, '.rtems') +rtemsdir = r'/home/travis/.rtems' # Preliminary, until the next generation of toolchain if 'CACHEDIR' in os.environ: cachedir = os.environ['CACHEDIR'] @@ -894,7 +894,10 @@ PERL = C:/Strawberry/perl/bin/perl -CSD''' 'https://github.com/mdavidsaver/rsb/releases/download/20171203-{0}/{1}' .format(os.environ['RTEMS'], tar_name)], cwd=toolsdir) - sp.check_call(['tar', '-C', '/', '-xmj', '-f', os.path.join(toolsdir, tar_name)]) + sudo_prefix = [] + if ci['service'] == 'github-actions': + sudo_prefix = ['sudo'] + sp.check_call(sudo_prefix + ['tar', '-C', '/', '-xmj', '-f', os.path.join(toolsdir, tar_name)]) os.remove(os.path.join(toolsdir, tar_name)) setup_for_build(args)