1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#!/bin/bash
REPORTBUG_VERSION=$(dpkg-query -f '${source:Version}' -W reportbug)
HAVE_ATTACHMENTS=$(dpkg --compare-versions "$REPORTBUG_VERSION" ge "6.5.0" && echo yes || echo no)
function include_file() {
while [ -n "$1" ] ; do
if [ ! -f "$1" ] ; then
# file doesn't exist, just note that fact
echo "File '$1' does not exist" >&3
echo >&3
elif [ $HAVE_ATTACHMENTS = yes ] ; then
echo "-- BEGIN ATTACHMENTS --" >&3
echo $1 >&3
echo "-- END ATTACHMENTS --" >&3
else
echo "${1}:" >&3
cat "$1" >&3
echo >&3
fi
shift
done
}
function include_command() {
desc=$(echo "$@" | sed -e 's/[^[:alnum:]:_-]\+/_/g')
tmp=$(mktemp --tmpdir bug-pulseaudio-${desc}.XXXXXX)
"$@" &>$tmp
include_file $tmp
# delete cruft if possible
# for attachments we can't because it is not known when reportbug exits
if [ $HAVE_ATTACHMENTS = no ] ; then
rm $tmp
fi
}
# to see if we have a systemwide pulseaudio
include_file /etc/default/pulseaudio
# pulseaudio configuration
include_file /etc/pulse/client.conf /etc/pulse/daemon.conf /etc/pulse/default.pa /etc/pulse/system.pa
# Get alsa devices if possible
if which aplay &>/dev/null ; then
include_command aplay -L
fi
include_command pactl list
include_command pactl info
|