Commit 918eb3a3 authored by ssrq's avatar ssrq

backup

parent 10ca1c12
Pipeline #3378 passed with stage
in 58 seconds
#!/bin/sh -e
update-alternatives --display "$__object_id" 2>/dev/null \
| awk -F ' - ' '/priority [0-9]+$/ { print $1 }'
LC_ALL=C update-alternatives --display "${__object_id:?}" 2>/dev/null \
| awk -F ' - ' '/priority [0-9]+$/ { print $1 }'
......@@ -18,23 +18,19 @@ for altdir in \
/var/lib/dpkg/alternatives \
/var/lib/alternatives
do
if [ ! -f "$altdir/$__object_id" ]
then
continue
fi
test -f "${altdir}/${__object_id:?}" || continue
link="$( awk 'NR==2' "$altdir/$__object_id" )"
link=$(awk 'NR==2' "${altdir}/${__object_id:?}")
if [ -n "$link" ]
if test -n "${link}"
then
break
fi
done
if [ -z "$link" ]
then
echo "unable to get link for $__object_id" >&2
test -n "${link}" || {
echo "unable to get link for ${__object_id:?}" >&2
exit 1
fi
}
echo "$link"
#!/bin/sh -e
path_is="$( update-alternatives --display "$__object_id" 2>/dev/null \
| awk '/link currently points to/ {print $5}' )"
path_is=$(LC_ALL=C update-alternatives --display "${__object_id?}" 2>/dev/null \
| awk '/link currently points to/ { print $5 }')
if [ -z "$path_is" ]
if test -n "${path_is}"
then
echo "unable to get current path for $__object_id" >&2
echo "${path_is}"
else
echo "unable to get current path for ${__object_id:?}" >&2
exit 1
fi
echo "$path_is"
#!/bin/sh -e
if [ -f "$( cat "$__object/parameter/path" )" ]
if test -f "$(cat "${__object:?}/parameter/path")"
then
echo 'present'
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment