Re: base-files 4.0-9: LANG is set to the system default, why not the user selection?
On 16 February 2012 20:05, David Sastre Medina wrote: For the first, I apologize. WRT the second, here's a new attempt: 'locale' is set system-wide in /etc/profile.d/tzset.* to provide a new functionality, that, IIRC, was included in the announcement of the base-files' release. Also, 'locale' _can_ be set at a user-defined level, to provide the user the ability to set 'locale' despite system-wide setting, wich could be needed in multi-user environments, for instance. What's the reason for setting LANG to the system language in /etc/profile though? /etc/profile may be a system-wide file, but it is always sourced in a particular user context. There are several problems with relying on ~/.bash_profile to set it to the user's language: 1. It incurs an extra fork. 2. As Peter pointed out, it only works for new users. Existing users can't reasonably be expected to merge /etc/skel/.bash_profile changes into their own file. 3. The override in ~/.bash_profile is unconditional, which means that LANG settings in mintty's options, in cygwin.bat, or the user's Windows environment are ignored. Therefore, please consider changing /etc/profile.d/lang.[c]sh to use `locale -uU` and dropping the LANG setting from /etc/skel/.bash_profile. Regards, Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: base-files 4.0-9: LANG is set to the system default, why not the user selection?
Peter Rosin skrev 2012-02-16 06:52: David Sastre Medina skrev 2012-02-15 23:14: The files under /etc/profile.d are sourced by /etc/profile, which sets system wide settings. For user-defined values, the place to override a system-wide setting depends on the shell you're using. E.g., for bash, it would be ~/.bash_profile. Check /etc/skel/.bash_profile. It should include these lines: # Set user-defined locale export LANG=$(locale -uU) Probably you have a customized ~/.bash_profile, so updating to base-files-4.0-9 didn't replace it. Hmmm, ok, that doesn't completely match what I'm seeing in my $HOME, my .bash_profile *looks* (who am I to tell, it's attached) unmodified from 4.0-6, so just a quick question, what postinstall script is responsible for moving the updated skel files into $HOME? I couldn't find any, but admittedly didn't spend much time looking... I located base-files-4.0-6.tar.bz2 and my copy in $HOME is indeed not modified. So, your assertion that customization was preventing the update seems wrong (the date of my .bash_profile is consistent with my original Cygwin installation date). I question whether the skel files are automatically copied to the home directory at any other time than at home directory creation. Are they? Cheers, Peter PS. I have modified ~/.bashrc and ~/.inputrc, if that is relevant. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: base-files 4.0-9: LANG is set to the system default, why not the user selection?
16.02.2012 21:11, Peter Rosin пишет: Peter Rosin skrev 2012-02-16 06:52: David Sastre Medina skrev 2012-02-15 23:14: The files under /etc/profile.d are sourced by /etc/profile, which sets system wide settings. For user-defined values, the place to override a system-wide setting depends on the shell you're using. E.g., for bash, it would be ~/.bash_profile. Check /etc/skel/.bash_profile. It should include these lines: # Set user-defined locale export LANG=$(locale -uU) Probably you have a customized ~/.bash_profile, so updating to base-files-4.0-9 didn't replace it. Hmmm, ok, that doesn't completely match what I'm seeing in my $HOME, my .bash_profile *looks* (who am I to tell, it's attached) unmodified from 4.0-6, so just a quick question, what postinstall script is responsible for moving the updated skel files into $HOME? I couldn't find any, but admittedly didn't spend much time looking... I located base-files-4.0-6.tar.bz2 and my copy in $HOME is indeed not modified. So, your assertion that customization was preventing the update seems wrong (the date of my .bash_profile is consistent with my original Cygwin installation date). I question whether the skel files are automatically copied to the home directory at any other time than at home directory creation. Are they? Cheers, Peter PS. I have modified ~/.bashrc and ~/.inputrc, if that is relevant. /etc/defaults/etc/profile is what creates home directory. When executed for the first time for a user, it outputs to the console: Copying skeleton files. These files are for the users to personalise their cygwin experience. They will never be overwritten nor automatically updated. Just pay attention to what is told :) -- Best regards, Mike. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: base-files 4.0-9: LANG is set to the system default, why not the user selection?
Mike Kaganski skrev 2012-02-16 12:14: 16.02.2012 21:11, Peter Rosin пишет: Peter Rosin skrev 2012-02-16 06:52: David Sastre Medina skrev 2012-02-15 23:14: The files under /etc/profile.d are sourced by /etc/profile, which sets system wide settings. For user-defined values, the place to override a system-wide setting depends on the shell you're using. E.g., for bash, it would be ~/.bash_profile. Check /etc/skel/.bash_profile. It should include these lines: # Set user-defined locale export LANG=$(locale -uU) Probably you have a customized ~/.bash_profile, so updating to base-files-4.0-9 didn't replace it. Hmmm, ok, that doesn't completely match what I'm seeing in my $HOME, my .bash_profile *looks* (who am I to tell, it's attached) unmodified from 4.0-6, so just a quick question, what postinstall script is responsible for moving the updated skel files into $HOME? I couldn't find any, but admittedly didn't spend much time looking... I located base-files-4.0-6.tar.bz2 and my copy in $HOME is indeed not modified. So, your assertion that customization was preventing the update seems wrong (the date of my .bash_profile is consistent with my original Cygwin installation date). I question whether the skel files are automatically copied to the home directory at any other time than at home directory creation. Are they? PS. I have modified ~/.bashrc and ~/.inputrc, if that is relevant. /etc/defaults/etc/profile is what creates home directory. When executed for the first time for a user, it outputs to the console: I believe it's /etc/profile that is populating the home directory for new users. /etc/defaults/etc/profile is the latest version as provided by the base-files package and will have the same content unless you have poisoned /etc/profile with local edits. If you are pedantic. Copying skeleton files. These files are for the users to personalise their cygwin experience. They will never be overwritten nor automatically updated. Just pay attention to what is told :) Yes, but when the *maintainer* of that file states otherwise, who should I pay attention to? If you read between the lines of my previous message you would understand that I already knew this. Look, I'm only harping on about this since the base-files maintainer should have understood that doing a system-level change in one place that is later supposed to be reversed by the skel files isn't going to fly for existing installations. Cheers, Peter -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: base-files 4.0-9: LANG is set to the system default, why not the user selection?
17.02.2012 0:03, Peter Rosin пишет: Mike Kaganski skrev 2012-02-16 12:14: 16.02.2012 21:11, Peter Rosin пишет: Peter Rosin skrev 2012-02-16 06:52: David Sastre Medina skrev 2012-02-15 23:14: The files under /etc/profile.d are sourced by /etc/profile, which sets system wide settings. For user-defined values, the place to override a system-wide setting depends on the shell you're using. E.g., for bash, it would be ~/.bash_profile. Check /etc/skel/.bash_profile. It should include these lines: # Set user-defined locale export LANG=$(locale -uU) Probably you have a customized ~/.bash_profile, so updating to base-files-4.0-9 didn't replace it. Hmmm, ok, that doesn't completely match what I'm seeing in my $HOME, my .bash_profile *looks* (who am I to tell, it's attached) unmodified from 4.0-6, so just a quick question, what postinstall script is responsible for moving the updated skel files into $HOME? I couldn't find any, but admittedly didn't spend much time looking... I located base-files-4.0-6.tar.bz2 and my copy in $HOME is indeed not modified. So, your assertion that customization was preventing the update seems wrong (the date of my .bash_profile is consistent with my original Cygwin installation date). I question whether the skel files are automatically copied to the home directory at any other time than at home directory creation. Are they? PS. I have modified ~/.bashrc and ~/.inputrc, if that is relevant. /etc/defaults/etc/profile is what creates home directory. When executed for the first time for a user, it outputs to the console: I believe it's /etc/profile that is populating the home directory for new users. /etc/defaults/etc/profile is the latest version as provided by the base-files package and will have the same content unless you have poisoned /etc/profile with local edits. If you are pedantic. Mea culpa. Copying skeleton files. These files are for the users to personalise their cygwin experience. They will never be overwritten nor automatically updated. Just pay attention to what is told :) Yes, but when the *maintainer* of that file states otherwise, who should I pay attention to? If you read between the lines of my previous message you would understand that I already knew this. Look, I'm only harping on about this since the base-files maintainer should have understood that doing a system-level change in one place that is later supposed to be reversed by the skel files isn't going to fly for existing installations. Cheers, Peter Then you seem to just mock at the maintainer. It's not too polite. Yes, it would be desirable if this effect (and the proposed steps to fix it for those who already use this package) would be noted in the release advertisement. Yes, sometimes even a maintainer may make mistakes on their maintained stuff. But if you have some objections or proposals, it's better to simply say so to people who devote their time and knowledge to us. And append thank you in the end. -- Best regards, Mike. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: base-files 4.0-9: LANG is set to the system default, why not the user selection?
Mike Kaganski skrev 2012-02-16 14:37: Then you seem to just mock at the maintainer. It's not too polite. Yes, it would be desirable if this effect (and the proposed steps to fix it for those who already use this package) would be noted in the release advertisement. Yes, sometimes even a maintainer may make mistakes on their maintained stuff. But if you have some objections or proposals, it's better to simply say so to people who devote their time and knowledge to us. And append thank you in the end. Hi Mike, Look, I was asking honest questions. I was giving David a chance to correct himself, in a case where I wasn't completely sure what was right and wrong, but my gut told me that I was right. Then you jumped in with snide remarks that I should pay attention. To something that happened eons ago! When it was apparent that I already believed the thing I should pay attention to, and was just questioning something that contradicted it! Then I had a more thorough look at things and confirmed my gut reaction. In my eagerness to respond to your snideness I probably misrepresented things so that it seemed like I knew from the start what was going on. So, David, I apologize if I have offended you and it is perhaps best if everybody just forgets everything that has happened in this thread since Mike appeared in it. Cheers, Peter -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: base-files 4.0-9: LANG is set to the system default, why not the user selection?
On Thu, Feb 16, 2012 at 03:24:47PM +0100, Peter Rosin wrote: Mike Kaganski skrev 2012-02-16 14:37: Then you seem to just mock at the maintainer. It's not too polite. Yes, it would be desirable if this effect (and the proposed steps to fix it for those who already use this package) would be noted in the release advertisement. Yes, sometimes even a maintainer may make mistakes on their maintained stuff. But if you have some objections or proposals, it's better to simply say so to people who devote their time and knowledge to us. And append thank you in the end. Look, I was asking honest questions. I was giving David a chance to correct himself, in a case where I wasn't completely sure what was right and wrong, but my gut told me that I was right. Then you jumped in with snide remarks that I should pay attention. To something that happened eons ago! When it was apparent that I already believed the thing I should pay attention to, and was just questioning something that contradicted it! Then I had a more thorough look at things and confirmed my gut reaction. In my eagerness to respond to your snideness I probably misrepresented things so that it seemed like I knew from the start what was going on. So, David, I apologize if I have offended you and it is perhaps best if everybody just forgets everything that has happened in this thread since Mike appeared in it. No need. It looks like I haven't properly understood your complain. Also it looks like I haven't explain properly what was the thing with setting 'locale' both system-wide and user-defined. For the first, I apologize. WRT the second, here's a new attempt: 'locale' is set system-wide in /etc/profile.d/tzset.* to provide a new functionality, that, IIRC, was included in the announcement of the base-files' release. Also, 'locale' _can_ be set at a user-defined level, to provide the user the ability to set 'locale' despite system-wide setting, wich could be needed in multi-user environments, for instance. base-files includes several files that create you $HOME and populate it with the files under /etc/skel/. After that, if you ever modify them, further updates won't affect those files, respecting the policy of not dealing with user modified files (some other distros will prompt you to either install the package version, keep the installed version or see the differences, for example). The scripts that check for existing files, compare them to the package version and perform the update if it has to be done are: /etc/preremove/base-files.sh /etc/postinstall/base-files.sh Your attached .bash_profile does look unmodified, BTW, so regarding the fact it wasn't replaced by the update process, I've tried to reproduce it, unsuccessfully. It works for me. -- Huella de clave primaria: AD8F BDC0 5A2C FD5F A179 60E7 F79B AB04 5299 EC56 signature.asc Description: Digital signature
Re: base-files 4.0-9: LANG is set to the system default, why not the user selection?
David Sastre Medina skrev 2012-02-16 21:05: No need. It looks like I haven't properly understood your complain. Also it looks like I haven't explain properly what was the thing with setting 'locale' both system-wide and user-defined. For the first, I apologize. WRT the second, here's a new attempt: 'locale' is set system-wide in /etc/profile.d/tzset.* to provide a new functionality, that, IIRC, was included in the announcement of the base-files' release. Also, 'locale' _can_ be set at a user-defined level, to provide the user the ability to set 'locale' despite system-wide setting, wich could be needed in multi-user environments, for instance. (or as in my case, where someone else decided that I should have a non- English version of Windows.) base-files includes several files that create you $HOME and populate it with the files under /etc/skel/. After that, if you ever modify them, further updates won't affect those files, respecting the policy of not dealing with user modified files (some other distros will prompt you to either install the package version, keep the installed version or see the differences, for example). The scripts that check for existing files, compare them to the package version and perform the update if it has to be done are: /etc/preremove/base-files.sh /etc/postinstall/base-files.sh Your attached .bash_profile does look unmodified, BTW, so regarding the fact it wasn't replaced by the update process, I've tried to reproduce it, unsuccessfully. It works for me. As I understand it, base-files contains the file /etc/defaults/etc/skel/.bash_profile. At installation, /etc/postinstall/base-files.sh copies that to /etc/skel/.bash_profile, if it that file doesn't exist already. Then at uninstall, if /etc/preremove/base-files.sh finds that /etc/skel/.bash_profile is not changed, it is removed (so that an updated package feels free to copy over the new version). Further, when a user *first* logs in, /etc/skel/.bash_profile is copied to ~/.bash_profile by the /etc/profile script. At no other point are files in ~ modified, as I understand it. The way I read your explanation above, you are implying that your ~/.bash_profile is updated along with /etc/skel/.bash_profile, and I simply fail to see where that is happening. It is also counter to the message from /etc/profile (also quoted by Mike): Copying skeleton files. These files are for the users to personalise their cygwin experience. They will never be overwritten nor automatically updated. I.e. my /etc/skel/.bash_profile is version 4.0-9 as I expect, but my ~/.bash_profile is the old 4.0-6 version from when I first logged in, and I see no code anywhere that checks if ~/.bash_profile matches /etc/skel/.bash_profile and updates if it is pristine. So, the question remains, why is your ~/.bash_profile updated when you upgrade the base-files package? Or have I misinterpreted your message again? .bash_profile is of course just an example in this, select any of .bash_profile, .inputrc, .bashrc and .profile. Cheers, Peter -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: base-files 4.0-9: LANG is set to the system default, why not the user selection?
On Thu, Feb 16, 2012 at 09:46:46PM +0100, Peter Rosin wrote: David Sastre Medina skrev 2012-02-16 21:05: As I understand it, base-files contains the file /etc/defaults/etc/skel/.bash_profile. At installation, /etc/postinstall/base-files.sh copies that to /etc/skel/.bash_profile, if it that file doesn't exist already. Then at uninstall, if /etc/preremove/base-files.sh finds that /etc/skel/.bash_profile is not changed, it is removed (so that an updated package feels free to copy over the new version). Further, when a user *first* logs in, /etc/skel/.bash_profile is copied to ~/.bash_profile by the /etc/profile script. At no other point are files in ~ modified, as I understand it. The way I read your explanation above, you are implying that your ~/.bash_profile is updated along with /etc/skel/.bash_profile, and I simply fail to see where that is happening. It is also counter to the message from /etc/profile (also quoted by Mike): Copying skeleton files. These files are for the users to personalise their cygwin experience. They will never be overwritten nor automatically updated. This describes the whole process accurately. I.e. my /etc/skel/.bash_profile is version 4.0-9 as I expect, but my ~/.bash_profile is the old 4.0-6 version from when I first logged in, and I see no code anywhere that checks if ~/.bash_profile matches /etc/skel/.bash_profile and updates if it is pristine. So, the question remains, why is your ~/.bash_profile updated when you upgrade the base-files package? It is not. I re-read the whole thread and found where I lead to you assume that: In http://cygwin.com/ml/cygwin/2012-02/msg00477.html I wrote: Probably you have a customized ~/.bash_profile, so updating to base-files-4.0-9 didn't replace it. But I meant: Probably you have a customized (/etc/skel/).bash_profile, so updating to base-files-4.0-9 didn't replace it. That alone lead to the rest of the mess. Sorry. You need to manually apply changes that happen in skeletal files onto your $HOME if you want them. Also, it should have been explicitly emphasized that, for users in your situation (windows system locale in language A, but user-defined preference to lang B), a manual change was needed to preserve such config. -- Huella de clave primaria: AD8F BDC0 5A2C FD5F A179 60E7 F79B AB04 5299 EC56 signature.asc Description: Digital signature
Re: base-files 4.0-9: LANG is set to the system default, why not the user selection?
On 15 February 2012 13:59, Peter Rosin wrote: My Windows is Swedish, but I generally like it to show as little as possible in Swedish so my display language is English. I want English, to not suffer from strange translations that don't make sense, to be able to search for error messages, etc. A recent change seems to have LANG set to the output of the system default language, but I think that's just wrong, it should be the language of the current user. Please change lang.{c}sh to do locale -uU instead of locale -sU. I agree. Where is the recommended position to override LANG until such a change is made, or if it is not an agreeable change? If you're using the default terminal, i.e. mintty, you can set it on the Text page of its options. Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: base-files 4.0-9: LANG is set to the system default, why not the user selection?
On Wed, Feb 15, 2012 at 02:11:14PM +, Andy Koppe wrote: On 15 February 2012 13:59, Peter Rosin wrote: My Windows is Swedish, but I generally like it to show as little as possible in Swedish so my display language is English. I want English, to not suffer from strange translations that don't make sense, to be able to search for error messages, etc. A recent change seems to have LANG set to the output of the system default language, but I think that's just wrong, it should be the language of the current user. Please change lang.{c}sh to do locale -uU instead of locale -sU. Where is the recommended position to override LANG until such a change is made, or if it is not an agreeable change? The files under /etc/profile.d are sourced by /etc/profile, which sets system wide settings. For user-defined values, the place to override a system-wide setting depends on the shell you're using. E.g., for bash, it would be ~/.bash_profile. Check /etc/skel/.bash_profile. It should include these lines: # Set user-defined locale export LANG=$(locale -uU) Probably you have a customized ~/.bash_profile, so updating to base-files-4.0-9 didn't replace it. -- Huella de clave primaria: AD8F BDC0 5A2C FD5F A179 60E7 F79B AB04 5299 EC56 signature.asc Description: Digital signature
Re: base-files 4.0-9: LANG is set to the system default, why not the user selection?
David Sastre Medina skrev 2012-02-15 23:14: The files under /etc/profile.d are sourced by /etc/profile, which sets system wide settings. For user-defined values, the place to override a system-wide setting depends on the shell you're using. E.g., for bash, it would be ~/.bash_profile. Check /etc/skel/.bash_profile. It should include these lines: # Set user-defined locale export LANG=$(locale -uU) Probably you have a customized ~/.bash_profile, so updating to base-files-4.0-9 didn't replace it. Hmmm, ok, that doesn't completely match what I'm seeing in my $HOME, my .bash_profile *looks* (who am I to tell, it's attached) unmodified from 4.0-6, so just a quick question, what postinstall script is responsible for moving the updated skel files into $HOME? I couldn't find any, but admittedly didn't spend much time looking... Cheers, Peter # base-files version 4.0-6 # ~/.bash_profile: executed by bash(1) for login shells. # The latest version as installed by the Cygwin Setup program can # always be found at /etc/defaults/etc/skel/.bash_profile # Modifying /etc/skel/.bash_profile directly will prevent # setup from updating it. # The copy in your home directory (~/.bash_profile) is yours, please # feel free to customise it to create a shell # environment to your liking. If you feel a change # would be benifitial to all, please feel free to send # a patch to the cygwin mailing list. # User dependent .bash_profile file # source the users bashrc if it exists if [ -f ${HOME}/.bashrc ] ; then source ${HOME}/.bashrc fi # Set PATH so it includes user's private bin if it exists # if [ -d ${HOME}/bin ] ; then # PATH=${HOME}/bin:${PATH} # fi # Set MANPATH so it includes users' private man if it exists # if [ -d ${HOME}/man ]; then # MANPATH=${HOME}/man:${MANPATH} # fi # Set INFOPATH so it includes users' private info if it exists # if [ -d ${HOME}/info ]; then # INFOPATH=${HOME}/info:${INFOPATH} # fi -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple