From 498489c570c4d430a09c472a944f0dc3ff1c46e5 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 21 Jun 2016 10:39:41 +0200 Subject: [PATCH] load bash profile using --login when running builds on server This will make `vagrant ssh` and `fdroid build --server` be the same env, so troubleshooting should be easier. !135 Here's what `man bash` says: When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior. When a login shell exits, bash reads and executes commands from the file ~/.bash_logout, if it exists. --- fdroidserver/build.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index bad025a6..818f6c1f 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -388,8 +388,7 @@ def build_server(app, build, vcs, build_dir, output_dir, force): if options.verbose: cmdline += ' --verbose' cmdline += " %s:%s" % (app.id, build.vercode) - cmdline = '. /etc/profile && ' + cmdline - chan.exec_command('bash -c "' + cmdline + '"') + chan.exec_command('bash --login -c "' + cmdline + '"') output = bytes() while not chan.exit_status_ready(): while chan.recv_ready(): -- 2.30.2