Merge lp:~hyperair/pulseaudio/fix-01Pulseaudio-quoting into lp:~ubuntu-core-dev/pulseaudio/ubuntu

Proposed by Chow Loong Jin
Status: Merged
Merge reported by: Daniel T Chen
Merged at revision: not available
Proposed branch: lp:~hyperair/pulseaudio/fix-01Pulseaudio-quoting
Merge into: lp:~ubuntu-core-dev/pulseaudio/ubuntu
Diff against target: 67 lines (+11/-11)
1 file modified
debian/01PulseAudio (+11/-11)
To merge this branch: bzr merge lp:~hyperair/pulseaudio/fix-01Pulseaudio-quoting
Reviewer Review Type Date Requested Status
Daniel T Chen Approve
Review via email: mp+24505@code.launchpad.net

Description of the change

Multiple fixes for 01Pulseaudio

* Drop -l from all su invocations, they cause su to do nothing.
* Fix su quoting issues:
  + Some shell functions were called within su's environment and didn't
    work.
  + Some variables were not substituted properly due to use of ' instead
    of ".

To post a comment you must log in.
Revision history for this message
Daniel T Chen (crimsun) wrote :

Works fine, thanks!

review: Approve
Revision history for this message
Daniel T Chen (crimsun) wrote :

I just noticed that this branch can't be merged against Lucid's release due to branch skew. I updated the bzr branch a couple uploads ago to use lp:~ubuntu-core-dev/pulseaudio/ubuntu.2a. Please rebase against that branch.

Revision history for this message
Chow Loong Jin (hyperair) wrote :

On Monday 03,May,2010 07:47 AM, Daniel T Chen wrote:
> I just noticed that this branch can't be merged against Lucid's release due to branch skew. I updated the bzr branch a couple uploads ago to use lp:~ubuntu-core-dev/pulseaudio/ubuntu.2a. Please rebase against that branch.

Done. Please try again.

--
Kind regards,
Chow Loong Jin

Revision history for this message
Daniel T Chen (crimsun) wrote :

Done, thanks!

For tracking, this merge was done into maverick's ubuntu.2a.maverick branch and will be pushed into lucid's ubuntu.2a branch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/01PulseAudio'
2--- debian/01PulseAudio 2010-01-31 18:46:06 +0000
3+++ debian/01PulseAudio 2010-04-30 15:16:20 +0000
4@@ -18,7 +18,7 @@
5 # $1 = sink|source
6 # $2 = username
7 save_pulse_state_and_mute() {
8- su "${2}" -l -c -- 'pacmd list-${1}s | \
9+ su "${2}" -c -- "pacmd list-${1}s" | \
10 sed -n "s/^[[:space:]*]*//; /\(index\|mute\)/p" | \
11 (index="";
12 while read field value; do
13@@ -26,33 +26,33 @@
14 index=${value}
15 else
16 savestate pulse:"${2}":${1}${index} ${value}
17- pacmd set-${1}-mute ${index} yes
18+ su "${2}" -c -- "pacmd set-${1}-mute ${index} yes"
19 fi
20- done)'
21+ done)
22 }
23
24 # $1 = sink|source
25 # $2 = username
26 restore_pulse_state() {
27- su "${2}" -l -c -- 'pacmd list-${1}s | \
28+ su "${2}" -c -- "pacmd list-${1}s" | \
29 sed -n "s/^[[:space:]*]*index: //p" | \
30 while read index; do
31 if state_exists pulse:"${2}":${1}${index}; then
32- pacmd \
33+ su "${2}" -c -- "pacmd \
34 set-${1}-mute \
35 ${index} \
36- $(restorestate pulse:"${2}":${1}${index})
37+ $(restorestate pulse:"${2}":${1}${index})"
38 fi
39- done'
40+ done
41 }
42
43 suspend_pulse() {
44 for i in $(get_pulse_users); do
45 THIS_USER="$(getent passwd ${i} | cut -f1 -d:)"
46- if su "${THIS_USER}" -l -c -- 'ck-list-sessions | grep "active = TRUE"' > /dev/null 2>&1; then
47+ if su "${THIS_USER}" -c -- 'ck-list-sessions' | grep "active = TRUE" > /dev/null 2>&1; then
48 save_pulse_state_and_mute sink "${THIS_USER}"
49 save_pulse_state_and_mute source "${THIS_USER}"
50- su "${THIS_USER}" -l -c -- 'pacmd suspend true' > /dev/null 2>&1
51+ su "${THIS_USER}" -c -- 'pacmd suspend true' > /dev/null 2>&1
52 break
53 fi
54 done
55@@ -61,10 +61,10 @@
56 resume_pulse() {
57 for i in $(get_pulse_users); do
58 THIS_USER="$(getent passwd ${i} | cut -f1 -d:)"
59- if su "${THIS_USER}" -l -c -- 'ck-list-sessions | grep "active = TRUE"' > /dev/null 2>&1; then
60+ if su "${THIS_USER}" -c -- 'ck-list-sessions' | grep "active = TRUE" > /dev/null 2>&1; then
61 restore_pulse_state sink "${THIS_USER}"
62 restore_pulse_state source "${THIS_USER}"
63- su "${THIS_USER}" -l -c -- 'pacmd suspend false' > /dev/null 2>&1
64+ su "${THIS_USER}" -c -- 'pacmd suspend false' > /dev/null 2>&1
65 break
66 fi
67 done

Subscribers

People subscribed via source and target branches

to all changes: