Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Cabieces
otb
Commits
aeea0d4f
Commit
aeea0d4f
authored
5 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
PKG: detect if env variables are empty or not
parent
59524864
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Packaging/Files/otbenv.bash
+19
-3
19 additions, 3 deletions
Packaging/Files/otbenv.bash
Packaging/Files/otbenv.bat
+15
-3
15 additions, 3 deletions
Packaging/Files/otbenv.bat
Packaging/Files/otbenv.profile
+19
-7
19 additions, 7 deletions
Packaging/Files/otbenv.profile
with
53 additions
and
13 deletions
Packaging/Files/otbenv.bash
+
19
−
3
View file @
aeea0d4f
...
@@ -18,6 +18,22 @@
...
@@ -18,6 +18,22 @@
# limitations under the License.
# limitations under the License.
#
#
cat_path
()
{
if
[
$#
-eq
0
]
;
then
exit
0
;
fi
if
[
$#
-eq
1
]
;
then
echo
"
$1
"
;
exit
0
;
fi
cur
=
"
$1
"
shift
1
next
=
"
$(
cat_path
$@
)
"
if
[
-z
"
$cur
"
]
;
then
echo
"
$next
"
elif
[
-z
"
$next
"
]
;
then
echo
"
$cur
"
else
echo
"
$cur
:
$next
"
fi
}
# The below environment variables only affect current shell
# The below environment variables only affect current shell
# So if you run again from a terminal. you need to run the script again
# So if you run again from a terminal. you need to run the script again
# see how this is sourced in monteverdi.sh and mapla.sh
# see how this is sourced in monteverdi.sh and mapla.sh
...
@@ -26,11 +42,11 @@ CURRENT_DIR=$(cd -P -- "$(dirname -- "$BASH_SOURCE")" && printf '%s\n' "$(pwd -P
...
@@ -26,11 +42,11 @@ CURRENT_DIR=$(cd -P -- "$(dirname -- "$BASH_SOURCE")" && printf '%s\n' "$(pwd -P
unset
LD_LIBRARY_PATH
unset
LD_LIBRARY_PATH
PATH
=
$CURRENT_DIR
/bin
:
$PATH
PATH
=
$
(
cat_path
"
$
CURRENT_DIR
/bin
"
"
$PATH
"
)
GDAL_DATA
=
$CURRENT_DIR
/share/data
GDAL_DATA
=
$CURRENT_DIR
/share/data
GEOTIFF_CSV
=
$CURRENT_DIR
/share/epsg_csv
GEOTIFF_CSV
=
$CURRENT_DIR
/share/epsg_csv
PYTHONPATH
=
$CURRENT_DIR
/lib/python
:
$PYTHONPATH
PYTHONPATH
=
$
(
cat_path
"
$
CURRENT_DIR
/lib/python
"
"
$PYTHONPATH
"
)
OTB_APPLICATION_PATH
=
$CURRENT_DIR
/lib/otb/applications
OTB_APPLICATION_PATH
=
$
(
cat_path
"
$
CURRENT_DIR
/lib/otb/applications
"
"
$OTB_APPLICATION_PATH
"
)
GDAL_DRIVER_PATH
=
"disable"
GDAL_DRIVER_PATH
=
"disable"
LC_NUMERIC
=
C
LC_NUMERIC
=
C
...
...
This diff is collapsed.
Click to expand it.
Packaging/Files/otbenv.bat
+
15
−
3
View file @
aeea0d4f
...
@@ -20,11 +20,23 @@
...
@@ -20,11 +20,23 @@
:: Setup environment for OTB package
:: Setup environment for OTB package
set
CURRENT_SCRIPT_DIR
=
%~dp0
set
CURRENT_SCRIPT_DIR
=
%~dp0
set
PATH
=
%CURRENT_SCRIPT_DIR%
bin
;
%PATH%
call
:prefix
_path
PATH
"
%CURRENT_SCRIPT_DIR%
bin"
call
:prefix
_path
PYTHONPATH
"
%CURRENT_SCRIPT_DIR%
lib\python"
call
:prefix
_path
OTB_APPLICATION_PATH
"
%CURRENT_SCRIPT_DIR%
lib\otb\applications"
set
GDAL_DATA
=
%CURRENT_SCRIPT_DIR%
share
\data
set
GDAL_DATA
=
%CURRENT_SCRIPT_DIR%
share
\data
set
GEOTIFF_CSV
=
%CURRENT_SCRIPT_DIR%
share
\epsg_csv
set
GEOTIFF_CSV
=
%CURRENT_SCRIPT_DIR%
share
\epsg_csv
set
PYTHONPATH
=
%CURRENT_SCRIPT_DIR%
lib
\python
;
%PYTHONPATH%
set
OTB_APPLICATION_PATH
=
%CURRENT_SCRIPT_DIR%
lib
\otb\applications
set
GDAL_DRIVER_PATH
=
disable
set
GDAL_DRIVER_PATH
=
disable
:: Set numeric locale to C
:: Set numeric locale to C
set
LC_NUMERIC
=
C
set
LC_NUMERIC
=
C
goto
:eof
:prefix
_path
setlocal
enabledelayedexpansion
set
output
=
%
~
2
set
var
=
%
1
set
content
=
if
defined
%var%
(
set
content
=
!%var%!
)
if
not
"
%content%
"
==
""
(
set
output
=
%output%
;
%content%
)
endlocal
&
set
%
1
=
%output%
goto
:eof
This diff is collapsed.
Click to expand it.
Packaging/Files/otbenv.profile
+
19
−
7
View file @
aeea0d4f
...
@@ -19,6 +19,22 @@
...
@@ -19,6 +19,22 @@
# limitations under the License.
# limitations under the License.
#
#
cat_path
()
{
if
[
$
# -eq 0 ]; then exit 0; fi
if
[
$
# -eq 1 ]; then echo "$1"; exit 0; fi
cur
=
"$1"
shift
1
next
=
"$(cat_path $@)"
if
[
-
z
"
$cur
"
];
then
echo
"
$next
"
elif
[
-
z
"
$next
"
];
then
echo
"
$cur
"
else
echo
"
$cur
:
$next
"
fi
}
# The below environment variables only affect current shell
# The below environment variables only affect current shell
# So if you run again from a terminal. you need to run the script again
# So if you run again from a terminal. you need to run the script again
# see how this is sourced in monteverdi.sh and mapla.sh
# see how this is sourced in monteverdi.sh and mapla.sh
...
@@ -27,17 +43,13 @@ CMAKE_PREFIX_PATH=OUT_DIR
...
@@ -27,17 +43,13 @@ CMAKE_PREFIX_PATH=OUT_DIR
export
CMAKE_PREFIX_PATH
export
CMAKE_PREFIX_PATH
# check and set OTB_APPLICATION_PATH
# check and set OTB_APPLICATION_PATH
if
[
-
z
"
$OTB_APPLICATION_PATH
"
]
||
[
"
$OTB_APPLICATION_PATH
"
=
""
];
then
OTB_APPLICATION_PATH
=
$
(
cat_path
"OUT_DIR/lib/otb/applications"
"
$OTB_APPLICATION_PATH
"
)
OTB_APPLICATION_PATH
=
OUT_DIR
/
lib
/
otb
/
applications
else
OTB_APPLICATION_PATH
=
OUT_DIR
/
lib
/
otb
/
applications
:
$OTB_APPLICATION_PATH
fi
# Add bin direcotory to system PATH
# Add bin direcotory to system PATH
PATH
=
OUT_DIR
/
bin
:
$PATH
PATH
=
$
(
cat_path
"
OUT_DIR/bin
"
"
$PATH
"
)
# export PYTHONPATH to import otbApplication.py
# export PYTHONPATH to import otbApplication.py
PYTHONPATH
=
OUT_DIR
/
lib
/
python
:
$PYTHONPATH
PYTHONPATH
=
$
(
cat_path
"
OUT_DIR/lib/python
"
"
$PYTHONPATH
"
)
# set numeric locale to C
# set numeric locale to C
LC_NUMERIC
=
C
LC_NUMERIC
=
C
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment