Skip to content

Commit 55ea991

Browse files
committed
tue-install-rosdep fully now compatible
1 parent 0b5c260 commit 55ea991

File tree

1 file changed

+49
-2
lines changed

1 file changed

+49
-2
lines changed

installer/tue-install-impl.bash

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,36 @@ function tue-install-rosdep
241241
TUE_INSTALL_CURRENT_TARGET=$target
242242
TUE_INSTALL_CURRENT_TARGET_DIR=$TUE_INSTALL_TARGETS_DIR/$target
243243

244+
local state_file="$TUE_INSTALL_STATE_DIR"/"$target"
245+
local state_file_now="${state_file}-now"
246+
247+
# Determine if this target needs to be executed
248+
local execution_needed="true"
249+
250+
if [ -f "$state_file_now" ]
251+
then
252+
tue-install-debug "File $state_file_now does exist, so installation has already been executed with 'now' option. No execution is needed"
253+
execution_needed="false"
254+
elif [ -f "$state_file" ]
255+
then
256+
if [ "$now" == "true" ]
257+
then
258+
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."
259+
else
260+
tue-install-debug "File $state_file_now does exist. 'now' is not enabled, so no execution needed."
261+
execution_needed="false"
262+
fi
263+
else
264+
if [ "$now" == "true" ]
265+
then
266+
tue-install-debug "Files $state_file_now and $state_file don't exist. Going to execute with 'now' option."
267+
else
268+
tue-install-debug "Files $state_file_now and $state_file don't exist. Going to execute without 'now' option."
269+
fi
270+
fi
271+
244272
# If file exist, target has been resolved correctly in the past.
245-
if [ ! -f "$TUE_INSTALL_STATE_DIR"/"$target" ]
273+
if [ "$execution_needed" == "true" ]
246274
then
247275
tue-install-debug "Target '$target' has not yet been resolved by rosdep, going to installation procedure"
248276

@@ -288,7 +316,12 @@ function tue-install-rosdep
288316

289317
_set_dependencies "$parent_target" "$target"
290318

291-
touch "$TUE_INSTALL_STATE_DIR"/"$target"
319+
if [ "$now" == "true" ]
320+
then
321+
touch "$state_file_now"
322+
else
323+
touch "$state_file"
324+
fi
292325

293326
TUE_INSTALL_CURRENT_TARGET=$parent_target
294327
TUE_INSTALL_CURRENT_TARGET_DIR=$TUE_INSTALL_TARGETS_DIR/$parent_target
@@ -312,6 +345,20 @@ function tue-install-rosdep
312345

313346
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
314347

348+
function tue-install-target-now
349+
{
350+
tue-install-debug "tue-install-target-now $*"
351+
352+
local target
353+
target=$1
354+
355+
tue-install-debug "calling: tue-install-target $target true"
356+
tue-install-target "$target" "true"
357+
return $?
358+
}
359+
360+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
361+
315362
function tue-install-target
316363
{
317364
tue-install-debug "tue-install-target $*"

0 commit comments

Comments
 (0)