Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apt with --root to save OSGEO4W_ROOT in shell environment #57

Open
maphew opened this issue Apr 1, 2017 · 5 comments
Open

Apt with --root to save OSGEO4W_ROOT in shell environment #57

maphew opened this issue Apr 1, 2017 · 5 comments

Comments

@maphew
Copy link
Owner

maphew commented Apr 1, 2017

Would be nice if apt --root={...} --bits=64 setup saved the OSGEO4W_ROOT var in the shell so that we can just carry on with the next steps in the same session. Otherwise we have to keep re-using --root in every invocation which is a pain, leading to using set osgeo... at the beginning of a session, which leads to the --root parameter being not used, which is another way of saying "essentially useless". ;-)

@amr66
Copy link
Contributor

amr66 commented Apr 4, 2017

my way of using apt is either inside a OSGEO-Shell, so the variable is set or i set it by --root. Without that, how do we find the correct directory?

@maphew
Copy link
Owner Author

maphew commented Apr 4, 2017

What I meant is I'd like to allow the following usage:

apt --root=x:\path ... setup
    :: on exit root is saved as OS ENV OSGeo4w_root=...
apt find {...}
apt install {...}
apt list 

Instead of the current:

apt --root=x:\path ... setup
apt --root=x:\path find {...}
apt --root=x:\path install {...}
apt --root=x:\path list 

or more commonly:

set osgeo4w_root=x:\path
apt ... setup
apt find {...}
apt install {...}
apt list 

@maphew
Copy link
Owner Author

maphew commented Apr 4, 2017

Why bother? I ask myself, where does the urge come from? ...and when I really look it it's simply because I don't like typing ...o4w_...! It's an awkward combination of strokes that slows me down and I often make mistakes on.

@amr66
Copy link
Contributor

amr66 commented Apr 5, 2017

So true, but, though i didn't tested it, i think setting a env var in a python script, the variable doen't stay in the calling environment after the python sxcript ended. But may be i'm wrong here...

@amr66
Copy link
Contributor

amr66 commented Apr 5, 2017

checked it like this: Win7-Cmd:

echo import os; os.environ["myvar"] = "myval" > env.py
python env.py
echo %myvar%

this shows, that after scripts end, the environment variable myvar does not exist! May be there are other possibilities...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants