Skip to content

Commit ea8810a

Browse files
committed
BF: -n does not need the an existing image; just report command
1 parent 2d2759f commit ea8810a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

o-saft-docker

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,14 @@
328328
#? docker(1), podman(1), o-saft-docker-dev, o-saft.pl, o-saft.tcl
329329
#?
330330
#? VERSION
331-
#? @(#) o-saft-docker 3.19 24/09/24 12:07:03
331+
#? @(#) o-saft-docker 3.20 25/01/20 18:18:08
332332
#?
333333
#? AUTHOR
334334
#? 17-jul-17 Achim Hoffmann
335335
#?
336336
# -----------------------------------------------------------------------------
337337

338-
SID="3.19"
338+
SID="3.20"
339339
VERSION="${OSAFT_VERSION:-24.09.24}"
340340
ich=${0##*/}
341341
tag=${o_saft_docker_tag}; # tag=${tag:-17.09.17}
@@ -375,7 +375,9 @@ check_image_name () {
375375
# reports the image IDs only, duplicate image IDs may be returned.
376376
# Images which are just tags, return the same image ID. Hence we can
377377
# simply filter them using "sort -u".
378-
#dbx# $docker image ls ${image_name} -q | \sort -u | \wc -w
378+
# -n does not need the image, just report commands.
379+
[ -n "$try" ] && \
380+
echo "$docker image ls ${image_name} -q | sort -u | wc -w" && return
379381
is_id=`$docker image ls ${image_name} -q | \sort -u | \wc -w`
380382
[ "${is_id}" -eq 1 ] && return; # found image, return
381383

0 commit comments

Comments
 (0)