Skip to content

Commit b1cb027

Browse files
committed
tue-install-rosdep fully now compatible
1 parent 2d41c2c commit b1cb027

File tree

1 file changed

+49
-16
lines changed

1 file changed

+49
-16
lines changed

installer/tue-install-impl.bash

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,6 @@ function tue-install-pipe
113113

114114
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
115115

116-
function tue-install-target-now
117-
{
118-
tue-install-debug "tue-install-target-now $*"
119-
120-
local target
121-
target=$1
122-
123-
tue-install-debug "calling: tue-install-target $target true"
124-
tue-install-target "$target" "true"
125-
return $?
126-
}
127-
128-
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
129-
130116
function _set_dependencies
131117
{
132118
local parent_target=$1
@@ -161,8 +147,36 @@ function tue-install-rosdep
161147
TUE_INSTALL_CURRENT_TARGET=$target
162148
TUE_INSTALL_CURRENT_TARGET_DIR=$TUE_INSTALL_TARGETS_DIR/$target
163149

150+
local state_file="$TUE_INSTALL_STATE_DIR"/"$target"
151+
local state_file_now="${state_file}-now"
152+
153+
# Determine if this target needs to be executed
154+
local execution_needed="true"
155+
156+
if [ -f "$state_file_now" ]
157+
then
158+
tue-install-debug "File $state_file_now does exist, so installation has already been executed with 'now' option. No execution is needed"
159+
execution_needed="false"
160+
elif [ -f "$state_file" ]
161+
then
162+
if [ "$now" == "true" ]
163+
then
164+
tue-install-debug "File $state_file_now doesn't exist, but file $state_file does. So installation has been executed yet, but not with the 'now' option. Going to execute it with 'now' option."
165+
else
166+
tue-install-debug "File $state_file_now does exist. 'now' is not enabled, so no execution needed."
167+
execution_needed="false"
168+
fi
169+
else
170+
if [ "$now" == "true" ]
171+
then
172+
tue-install-debug "Files $state_file_now and $state_file don't exist. Going to execute with 'now' option."
173+
else
174+
tue-install-debug "Files $state_file_now and $state_file don't exist. Going to execute without 'now' option."
175+
fi
176+
fi
177+
164178
# If file exist, target has been resolved correctly in the past.
165-
if [ ! -f "$TUE_INSTALL_STATE_DIR"/"$target" ]
179+
if [ "$execution_needed" == "true" ]
166180
then
167181
tue-install-debug "Target '$target' has not yet been resolved by rosdep, going to installation procedure"
168182

@@ -208,7 +222,12 @@ function tue-install-rosdep
208222

209223
_set_dependencies "$parent_target" "$target"
210224

211-
touch "$TUE_INSTALL_STATE_DIR"/"$target"
225+
if [ "$now" == "true" ]
226+
then
227+
touch "$state_file_now"
228+
else
229+
touch "$state_file"
230+
fi
212231

213232
TUE_INSTALL_CURRENT_TARGET=$parent_target
214233
TUE_INSTALL_CURRENT_TARGET_DIR=$TUE_INSTALL_TARGETS_DIR/$parent_target
@@ -232,6 +251,20 @@ function tue-install-rosdep
232251

233252
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
234253

254+
function tue-install-target-now
255+
{
256+
tue-install-debug "tue-install-target-now $*"
257+
258+
local target
259+
target=$1
260+
261+
tue-install-debug "calling: tue-install-target $target true"
262+
tue-install-target "$target" "true"
263+
return $?
264+
}
265+
266+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
267+
235268
function tue-install-target
236269
{
237270
tue-install-debug "tue-install-target $*"

0 commit comments

Comments
 (0)