Package: zoidberg Version: 0.95-1 Severity: wishlist Tags: patch Hi,
in order to fix bug #344030 for users of zoidberg I need to execute some code in /etc/zoidrc (there unfortunately doesn't seem to be a non-shell-specific way to deal with the corner case in that bug). Attached are patches with 2 competing solutions to do so: 1) modularized_zoidrc.patch: this adds looking for a /etc/zoidrc.d directory and sourcing all scripts in that directory when present -> IMO this is the preferred solution as: - it can be used by other packages also (e.g. the user-es, and user-de configuration packages could use this to configure things for zsh users) - doesn't clutter the system unnecessarely (though minimally) when desktop-profiles isn't installed . 2) with_bugfix_zoidrc.patch: this just adds the shell-snippet needed to fix bug #344030 directly into /etc/zoidrc -- Cheers, cobaco /"\ ASCII Ribbon Campaign \ / No proprietary formats in attachments without request X i.e. *NO* WORD, POWERPOINT or EXCEL documents / \ Respect Open Standards http://www.fsf.org/philosophy/no-word-attachments.html http://www.goldmark.org/netrants/no-word/attach.html
--- default_zoidrc 2006-02-10 14:57:34.000000000 +0100 +++ modularized_zoidrc 2006-02-10 14:36:11.000000000 +0100 @@ -91,3 +91,10 @@ grep => 'grep --color=auto', } ); } + +# allow modularized additions to customize the shell environment +if ( -d '/etc/zoidrc.d') { + for (`ls /etc/zoidrc.d/*`) { + s/\n//; source "$_"; + } +}
--- default_zoidrc 2006-02-10 14:57:34.000000000 +0100 +++ with_bugfix_zoidrc 2006-02-10 14:39:03.000000000 +0100 @@ -91,3 +91,29 @@ grep => 'grep --color=auto', } ); } + +### fixes for bug #34403 of desktop-profiles for users of zoidberg +# This fixes the desktop-profiles corner-case where a graphical client is +# started through an ssh -X session (in which the Xsession.d scripts aren't +# run, so we need to make sure the profiles are activated according to the +# specified settings at login). +$DESKTOP_PROFILES_SNIPPET = '/usr/share/desktop-profiles/get_desktop-profiles_variables'; + +if ( -e $DESKTOP_PROFILES_SNIPPET ) { + $TEMP_FILE = `tempfile`; + + # use bash to write the required environment settings to a tempfile + # this file has a 'VARIABLE=VALUE' format + `bash $DESKTOP_PROFILES_SNIPPET $TEMP_FILE`; + + # source to set the required environment variables + open(input, $TEMP_FILE); + while($env_var = <input>) { + # needs to become: $ENV{'VARIABLE'} = 'VALUE'; + $env_var =~ s/^(.*)=(.*)$/\$ENV{'\1'} = '\2'/; + eval $env_var; + } + + # cleanup + `rm $TEMP_FILE`; +}
pgph6FzLAUirr.pgp
Description: PGP signature