repo environment variables not set

998 views
Skip to first unread message

Naveen K

unread,
Jun 3, 2009, 7:24:03 PM6/3/09
to Repo and Gerrit Discussion
My repo environment variables are not being set when I try to run
"repo forall" commands. Any idea whats the problem.

I am trying to run the following command

repo forall -p -c 'echo $REPO_PATH' and it gives me the following
output
...
...
project build/
$REPO_PATH

project dalvik/
$REPO_PATH

project development/
$REPO_PATH


I am expecting it to print

repo forall -p -c 'echo $REPO_PATH' and it gives me the following
output
...
...
project build/
build

project dalvik/
dalvik

project development/
development

Shawn Pearce

unread,
Jun 3, 2009, 7:30:03 PM6/3/09
to repo-d...@googlegroups.com
On Wed, Jun 3, 2009 at 16:24, Naveen K <nave...@gmail.com> wrote:

My repo environment variables are not being set when I try to run
"repo forall" commands. Any idea whats the problem.

I am trying to run the following command

repo forall -p -c 'echo $REPO_PATH' and it gives me the following
output
...
...
project build/
$REPO_PATH

project dalvik/
$REPO_PATH

project development/
$REPO_PATH

What shell?

It works fine here with /bin/bash...

Naveen K

unread,
Jun 3, 2009, 8:12:05 PM6/3/09
to Repo and Gerrit Discussion


On Jun 3, 4:30 pm, Shawn Pearce <s...@google.com> wrote:
/bin/bash

Shawn Pearce

unread,
Jun 3, 2009, 8:16:14 PM6/3/09
to repo-d...@googlegroups.com
"repo version" ?  I wonder if your python is something else...

$ repo version
repo version v1.6.8
       (from git://android.git.kernel.org/tools/repo.git)
git version 1.6.3.1.333.g3ebba7
Python 2.5.2 (r252:60911, Jul 31 2008, 17:31:22)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)]

Naveen K

unread,
Jun 3, 2009, 8:20:49 PM6/3/09
to Repo and Gerrit Discussion
repo version v1.6.8
(from git://android.git.kernel.org/tools/repo.git)
: git --version 1>|
git version 1.5.4.4
Python 2.4.5 (#1, Nov 13 2008, 17:58:50)
[GCC 3.3.3]


On Jun 3, 5:16 pm, Shawn Pearce <s...@google.com> wrote:

Shawn Pearce

unread,
Jun 3, 2009, 8:25:37 PM6/3/09
to repo-d...@googlegroups.com
I blame your Python subprocess module.

Even with Python 2.4 it works on my system:


$ repo version
repo version v1.6.8
       (from git://android.git.kernel.org/tools/repo.git)
git version 1.6.3.1.333.g3ebba7
Python 2.4.5 (#2, Jul 31 2008, 19:04:55)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)]

$ repo forall -pc 'echo $REPO_PATH'
project android-issuetrackerredirect/
android-issuetrackerredirect
...

Naveen K

unread,
Jun 3, 2009, 8:34:07 PM6/3/09
to Repo and Gerrit Discussion
What is "Python subprocess module"? How can I fix it ?

Thanks a Bunch for looking into it

On Jun 3, 5:25 pm, Shawn Pearce <s...@google.com> wrote:
> I blame your Python subprocess module.
>
> Even with Python 2.4 it works on my system:
>
> $ repo version
> repo version v1.6.8
>        (from git://android.git.kernel.org/tools/repo.git)
> git version 1.6.3.1.333.g3ebba7
> Python 2.4.5 (#2, Jul 31 2008, 19:04:55)
> [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)]
>
> $ repo forall -pc 'echo $REPO_PATH'
> project android-issuetrackerredirect/
> android-issuetrackerredirect
> ...
>

Shawn Pearce

unread,
Jun 3, 2009, 8:47:39 PM6/3/09
to repo-d...@googlegroups.com
On Wed, Jun 3, 2009 at 17:34, Naveen K <nave...@gmail.com> wrote:

What is "Python subprocess module"? How can I fix it ?

Its the thing repo forall is using.

Does your OS have a newer python you can install?  It might be easier to try that than to try to debug .repo/repo/subcmds/forall.py and come up with a workaround for your operating system.  I don't know why python is escaping the '$' on you and preventing the shell from interpreting it.  "security patch" someone slapped onto python?

Does your echo command work if you put it into a shell script and then call the script instead instead of the echo command directly?  it should.

Naveen K

unread,
Jun 3, 2009, 9:04:48 PM6/3/09
to Repo and Gerrit Discussion
My shell seems to interpret environment vars fine even in shell
scripts.

I created a file 'test_script' with the following line

echo "Hello $USER"

and the shell seems to substitute my user name in place of $USER

I can try installing a different python. Let me try that and get back
to you.


On Jun 3, 5:47 pm, Shawn Pearce <s...@google.com> wrote:

Naveen K

unread,
Jun 3, 2009, 9:11:54 PM6/3/09
to Repo and Gerrit Discussion
I got a new version of python and it seems to work now.

Thank you very much for your help.

My repo version now looks like this

repo version v1.6.8
(from git://android.git.kernel.org/tools/repo.git)
git version 1.5.4.4
Python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17)
[GCC 4.3.2]


On Jun 3, 5:47 pm, Shawn Pearce <s...@google.com> wrote:

Naveen K

unread,
Jun 3, 2009, 9:34:43 PM6/3/09
to Repo and Gerrit Discussion
I got a new version of python and it seems to work now.

Thank you very much for your help.

My repo version now looks like this

repo version v1.6.8
(from git://android.git.kernel.org/tools/repo.git)
git version 1.5.4.4
Python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17)
[GCC 4.3.2]


On Jun 3, 5:47 pm, Shawn Pearce <s...@google.com> wrote:
Reply all
Reply to author
Forward
0 new messages