Merge lp:~nathwill-deactivatedaccount-deactivatedaccount/ubuntu/quantal/pam/lp110287 into lp:~ubuntu-core-dev/pam/ubuntu

Proposed by Nathan Williams
Status: Merged
Approved by: Steve Langasek
Approved revision: 887
Merged at revision: 887
Proposed branch: lp:~nathwill-deactivatedaccount-deactivatedaccount/ubuntu/quantal/pam/lp110287
Merge into: lp:~ubuntu-core-dev/pam/ubuntu
Diff against target: 18 lines (+4/-2)
1 file modified
debian/libpam-modules.postinst (+4/-2)
To merge this branch: bzr merge lp:~nathwill-deactivatedaccount-deactivatedaccount/ubuntu/quantal/pam/lp110287
Reviewer Review Type Date Requested Status
Steve Langasek Pending
Review via email: mp+112911@code.launchpad.net

Description of the change

add /usr/local/games to PATH

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

Thanks, this patch looks good. Committing and uploading!

FWIW:

-if [ "$1" = "configure" ] && (dpkg --compare-versions 0.79-3ubuntu6 ge "$2" || [ "$2" = "" ]); then
+if [ "$1" = "configure" ] && (dpkg --compare-versions 1.1.3-7ubuntu2 ge "$2" || [ "$2" = "" ]); then

I think the original wasn't very well written here, and I'm going to clean it up as part of the merge to read:

+if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le 1.1.3-7ubuntu2; then

Revision history for this message
Steve Langasek (vorlon) wrote :

In fact, make that...

if [ "$1" = "configure" ] && dpkg --compare-versions "$2" lt 1.1.3-7ubuntu3; then

thus keying on the version that *does* introduce the change, rather than on the last known version that doesn't.

Revision history for this message
Steve Langasek (vorlon) wrote :

Whoops, one more issue, caught on package install test:

- elif ! grep -qs "^PATH.*/usr/local/games"; then
+ elif ! grep -qs "^PATH.*/usr/local/games" /etc/environment; then

postinst hanging forever is not the desired behavior :)

Revision history for this message
Nathan Williams (nathwill-deactivatedaccount-deactivatedaccount) wrote :

ugh. fixed that. thanks for catching. went ahead and flipped the dpkg version comparison as recommended. left the empty string comparison, because i believe that accounts for the new-install scenario?

Revision history for this message
Steve Langasek (vorlon) wrote :

On Tue, Jul 03, 2012 at 07:09:22AM -0000, Nathan Williams wrote:

> ugh. fixed that. thanks for catching. went ahead and flipped the dpkg
> version comparison as recommended. left the empty string comparison,
> because i believe that accounts for the new-install scenario?

dpkg --compare-versions lt knows that an empty string "" is less than any
other version, so it already does the right thing here. (In fact,
--compare-versions has a separate operator, 'lt-nl', to exclude empty
version strings as "not less than".)

Uploaded now, anyway :)

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/libpam-modules.postinst'
2--- debian/libpam-modules.postinst 2011-02-18 00:15:43 +0000
3+++ debian/libpam-modules.postinst 2012-06-30 20:47:18 +0000
4@@ -19,10 +19,12 @@
5
6 # Add PATH to /etc/environment if it's not present there or in
7 # /etc/security/pam_env.conf
8-if [ "$1" = "configure" ] && (dpkg --compare-versions 0.79-3ubuntu6 ge "$2" || [ "$2" = "" ]); then
9+if [ "$1" = "configure" ] && (dpkg --compare-versions 1.1.3-7ubuntu2 ge "$2" || [ "$2" = "" ]); then
10 if ! grep -qs ^PATH /etc/security/pam_env.conf; then
11 if ! grep -qs ^PATH /etc/environment; then
12- echo 'PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"' >> /etc/environment
13+ echo 'PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"' >> /etc/environment
14+ elif ! grep -qs "^PATH.*/usr/local/games"; then
15+ sed -i 's/:\/usr\/games/:\/usr\/games:\/usr\/local\/games/g' /etc/environment
16 fi
17 fi
18 fi

Subscribers

People subscribed via source and target branches