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