Skip to content

Commit 0486302

Browse files
MatthijsBurghar13pit
authored andcommitted
tue-install-rosdep fully now compatible
1 parent 15f5e4e commit 0486302

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

installer/tue-install-impl.bash

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,36 @@ function tue-install-rosdep
159159
TUE_INSTALL_CURRENT_TARGET=$target
160160
TUE_INSTALL_CURRENT_TARGET_DIR=$TUE_INSTALL_TARGETS_DIR/$target
161161

162+
local state_file="$TUE_INSTALL_STATE_DIR"/"$target"
163+
local state_file_now="${state_file}-now"
164+
165+
# Determine if this target needs to be executed
166+
local execution_needed="true"
167+
168+
if [ -f "$state_file_now" ]
169+
then
170+
tue-install-debug "File $state_file_now does exist, so installation has already been executed with 'now' option. No execution is needed"
171+
execution_needed="false"
172+
elif [ -f "$state_file" ]
173+
then
174+
if [ "$now" == "true" ]
175+
then
176+
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."
177+
else
178+
tue-install-debug "File $state_file_now does exist. 'now' is not enabled, so no execution needed."
179+
execution_needed="false"
180+
fi
181+
else
182+
if [ "$now" == "true" ]
183+
then
184+
tue-install-debug "Files $state_file_now and $state_file don't exist. Going to execute with 'now' option."
185+
else
186+
tue-install-debug "Files $state_file_now and $state_file don't exist. Going to execute without 'now' option."
187+
fi
188+
fi
189+
162190
# If file exist, target has been resolved correctly in the past.
163-
if [ ! -f "$TUE_INSTALL_STATE_DIR"/"$target" ]
191+
if [ "$execution_needed" == "true" ]
164192
then
165193
tue-install-debug "Target '$target' has not yet been resolved by rosdep, going to installation procedure"
166194

@@ -206,7 +234,12 @@ function tue-install-rosdep
206234

207235
_set_dependencies "$parent_target" "$target"
208236

209-
touch "$TUE_INSTALL_STATE_DIR"/"$target"
237+
if [ "$now" == "true" ]
238+
then
239+
touch "$state_file_now"
240+
else
241+
touch "$state_file"
242+
fi
210243

211244
TUE_INSTALL_CURRENT_TARGET=$parent_target
212245
TUE_INSTALL_CURRENT_TARGET_DIR=$TUE_INSTALL_TARGETS_DIR/$parent_target

0 commit comments

Comments
 (0)