garmin / pyrex

Seamless container setup for developing with OpenEmbedded/Yocto Project
Apache License 2.0
38 stars 30 forks source link

Capture and use the dir where the init command is sourced #35

Closed kergoth closed 4 years ago

kergoth commented 5 years ago

This fixes issues with relative build dir paths by ensuring we source the init command from the same place both outside of docker and inside of docker.

Close #32

kergoth commented 4 years ago

Updated with the 3 requested fixes. Interdiff with the changes (git tbdiff origin/master kergoth/issue-32 issue-32):

@@ -19,7 +19,6 @@

 -if [ -n "$PYREX_OEROOT" ] && [ -n "$PYREX_INIT_COMMAND" ]; then
 -    pushd "$PYREX_OEROOT" > /dev/null
-+PYREX_INIT_DIR="${PYREX_INIT_DIR:-$PYREX_OEROOT}"
 +if [ -n "$PYREX_INIT_DIR" ] && [ -n "$PYREX_INIT_COMMAND" ]; then
 +    pushd "$PYREX_INIT_DIR" > /dev/null
      source $PYREX_INIT_COMMAND > /dev/null
@@ -77,15 +76,17 @@
                             '-e', 'PYREX_GID=%d' % gid,
                             '-e', 'PYREX_HOME=%s' % os.environ['HOME'],
                             '-e', 'PYREX_INIT_COMMAND=%s' % init_command,
+-                           '-e', 'PYREX_OEROOT=%s' % config['build']['oeroot'],
 +                           '-e', 'PYREX_INIT_DIR=%s' % init_dir,
-                            '-e', 'PYREX_OEROOT=%s' % config['build']['oeroot'],
                             '-e', 'PYREX_CLEANUP_EXIT_WAIT',
                             '-e', 'PYREX_CLEANUP_LOG_FILE',
+                            '-e', 'PYREX_CLEANUP_LOG_LEVEL',
 @@

              env = os.environ.copy()
              env['PYREX_INIT_COMMAND'] = config['build']['initcommand']
+-            env['PYREX_OEROOT'] = config['build']['oeroot']
 +            env['PYREX_INIT_DIR'] = config['build']['initdir']
-             env['PYREX_OEROOT'] = config['build']['oeroot']

              stop_coverage()
+ 
kergoth commented 4 years ago

Thanks for the quick response on these.