|
Server : LiteSpeed System : Linux srv104790275 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64 User : dewac4139 ( 1077) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/lib/dpkg/info/ |
Upload File : |
#!/bin/bash
set -e
. /usr/share/debconf/confmodule
CONFTEMPLATEPATH="/usr/share/libdebuginfod-common"
# Change a "generic" shell file according to enable/disable
# DEBUGINFOD_URLS according.
#
# - $1 is the shell file name
#
# - $2 is the pattern that we will look for when changing the file.
# This pattern will also be used to perform the substitution.
#
# - $3 is the action we will perform: set the DEBUGINFOD_URLS
# variable, or unset it.
#
# By the end of it, the specified shell file will have an extra line
# which either sets DEBUGINFOD_URLS to have its own value, or sets
# DEBUGINFOD_URLS to be empty (i.e., unsets any value).
change_shell_file ()
{
file="$1"
pattern="$2"
if [ "$3" = "set" ]; then
finalvar='$DEBUGINFOD_URLS'
else
finalvar=""
fi
# Check whether the last line of the file already starts with
# ${pattern}. If it does, then we will perform a sed to replace
# it according to the action specified. Otherwise, we will append
# a last line containing the set/unset.
if tail -n1 "$file" | grep -q "^$pattern"; then
sed -i "\$s@${pattern}.*@${pattern}\"${finalvar}\"@" "${file}"
else
echo "${pattern}\"${finalvar}\"" >> "${file}"
fi
}
# Change the .sh file according to an action specified by $1. It can
# be either "set" (meaning that we will be setting DEBUGINFOD_URLS to
# a valid value), or "unset" (which means that DEBUGINFOD_URLS will be
# empty).
change_sh_file ()
{
shfile="$1"
shaction="$2"
change_shell_file \
"$shfile" \
"export DEBUGINFOD_URLS=" \
"$shaction"
}
# Change the .csh file according to an action specified by $1. The
# explanation for change_sh_file also applies here.
change_csh_file ()
{
cshfile="$1"
cshaction="$2"
change_shell_file \
"$cshfile" \
"setenv DEBUGINFOD_URLS " \
"$cshaction"
}
case "$1" in
configure)
GOT_DEBCONF_ANSWER=0
for ext in sh csh; do
if [ -f "${CONFTEMPLATEPATH}"/debuginfod."${ext}" ]; then
if [ "$GOT_DEBCONF_ANSWER" -eq 0 ]; then
RET="false"
if grep -qFx "ID=debian" /etc/os-release; then
db_get libdebuginfod/usedebiandebuginfod || RET="false"
fi
if [ "$RET" = "true" ]; then
action="set"
else
action="unset"
fi
GOT_DEBCONF_ANSWER=1
fi
tmpfile=$(mktemp)
cat "${CONFTEMPLATEPATH}"/debuginfod."${ext}" > "$tmpfile"
change_"${ext}"_file "$tmpfile" "$action"
ucf --three-way --debconf-ok \
"$tmpfile" \
/etc/profile.d/debuginfod."${ext}"
ucfr libdebuginfod-common /etc/profile.d/debuginfod."${ext}"
rm -f "${tmpfile}"
fi
done
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0