Unbreak creating the toolbox if the toolbox image already exists

Fallout from cc0caef627

https://github.com/debarshiray/fedora-toolbox/issues/19
This commit is contained in:
Milos Vyletel 2018-12-03 12:49:13 +01:00 committed by Debarshi Ray
parent dd4394c32c
commit c713908e8b

View file

@ -38,6 +38,12 @@ create()
tmpfs_size=$((64 * 1024 * 1024)) # 64 MiB
working_container_name="fedora-toolbox-working-container-$(uuidgen --time)"
if [ "$DBUS_SYSTEM_BUS_ADDRESS" != "" ]; then
dbus_system_bus_address=$DBUS_SYSTEM_BUS_ADDRESS
fi
dbus_system_bus_path=$(echo $dbus_system_bus_address | cut --delimiter = --fields 2 2>&42)
dbus_system_bus_path=$(readlink --canonicalize $dbus_system_bus_path 2>&42)
if ! $prefix_sudo buildah inspect --type image $toolbox_image >/dev/null 2>&42; then
if ! $prefix_sudo buildah from \
--name $working_container_name \
@ -86,12 +92,6 @@ create()
exit 1
fi
if [ "$DBUS_SYSTEM_BUS_ADDRESS" != "" ]; then
dbus_system_bus_address=$DBUS_SYSTEM_BUS_ADDRESS
fi
dbus_system_bus_path=$(echo $dbus_system_bus_address | cut --delimiter = --fields 2 2>&42)
dbus_system_bus_path=$(readlink --canonicalize $dbus_system_bus_path 2>&42)
if ! $prefix_sudo buildah config \
--volume $dbus_system_bus_path \
$working_container_name >/dev/null 2>&42; then