* [gentoo-user] Difficulty with updating /etc/basb/bashrc @ 2024-06-14 15:53 Alan Mackenzie 2024-06-14 16:22 ` netfab ` (3 more replies) 0 siblings, 4 replies; 19+ messages in thread From: Alan Mackenzie @ 2024-06-14 15:53 UTC (permalink / raw To: gentoo-user Hello, Gentoo. I performed a portage update today, and at the end it informed me I had to deal with /etc/bash/bashrc. This file's standard version has changed, and I have apparently made changes in my own copy. But the new file from portage bears no resemblance to my existing version. It is just 32 lines long compared to the existing file of 111 lines. The existing file does things like setting up PS1 and colours, the new one doesn't seem to. My main problem is that I don't know which parts of the existing bashrc are my changes (which I'd want to keep) and which parts were the standard bashrc (which I can allow to be superseded by the new version). I think portage is at fault here - it should retain the older standard version of /etc/bash/bashrc so that users can resolve the differences with a 3-way diff. Right now, I have a problem. Is there any convenient way I can get the older standard file contents back again, so as to be able to do this 3-way diff? Or any other suggestions? Thanks! -- Alan Mackenzie (Nuremberg, Germany). ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 15:53 [gentoo-user] Difficulty with updating /etc/basb/bashrc Alan Mackenzie @ 2024-06-14 16:22 ` netfab 2024-06-14 17:33 ` Alan Mackenzie 2024-06-14 18:25 ` [gentoo-user] " Vitaliy Perekhovy ` (2 subsequent siblings) 3 siblings, 1 reply; 19+ messages in thread From: netfab @ 2024-06-14 16:22 UTC (permalink / raw To: gentoo-user Le 14/06/24 à 17:53, Alan Mackenzie a tapoté : > Right now, I have a problem. Is there any convenient way I can get > the older standard file contents back again, so as to be able to do > this 3-way diff? The old bashrc file installed by previous versions of the ebuild : https://github.com/gentoo/gentoo/blob/master/app-shells/bash/files/bashrc The new bashrc file : https://github.com/gentoo/gentoo/blob/master/app-shells/bash/files/bashrc-r1 ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 16:22 ` netfab @ 2024-06-14 17:33 ` Alan Mackenzie 2024-06-14 17:47 ` netfab ` (3 more replies) 0 siblings, 4 replies; 19+ messages in thread From: Alan Mackenzie @ 2024-06-14 17:33 UTC (permalink / raw To: gentoo-user Hello, Netfab. On Fri, Jun 14, 2024 at 18:22:11 +0200, netfab wrote: > Le 14/06/24 à 17:53, Alan Mackenzie a tapoté : > > Right now, I have a problem. Is there any convenient way I can get > > the older standard file contents back again, so as to be able to do > > this 3-way diff? > The old bashrc file installed by previous versions of the ebuild : > https://github.com/gentoo/gentoo/blob/master/app-shells/bash/files/bashrc > The new bashrc file : > https://github.com/gentoo/gentoo/blob/master/app-shells/bash/files/bashrc-r1 I don't have access to these files, unfortunately. Github has blocked them behind a script. I certainly amn't about to let a Microsoft script run in my browser. That is just too high a cost to pay. Are these files freely available, anywhere, perhaps? -- Alan Mackenzie (Nuremberg, Germany). ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 17:33 ` Alan Mackenzie @ 2024-06-14 17:47 ` netfab 2024-06-14 17:52 ` netfab ` (2 subsequent siblings) 3 siblings, 0 replies; 19+ messages in thread From: netfab @ 2024-06-14 17:47 UTC (permalink / raw To: gentoo-user Le 14/06/24 à 19:33, Alan Mackenzie a tapoté : > Are these files freely available, anywhere, perhaps? > And if you try to get the raw version with wget ? > $ cd /tmp > $ wget https://raw.githubusercontent.com/gentoo/gentoo/master/app-shells/bash/files/bashrc ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 17:33 ` Alan Mackenzie 2024-06-14 17:47 ` netfab @ 2024-06-14 17:52 ` netfab 2024-06-15 19:52 ` Alan Mackenzie 2024-06-15 11:39 ` Peter Humphrey 2024-06-16 14:26 ` [gentoo-user] " Nuno Silva 3 siblings, 1 reply; 19+ messages in thread From: netfab @ 2024-06-14 17:52 UTC (permalink / raw To: gentoo-user Le 14/06/24 à 19:33, Alan Mackenzie a tapoté : > Are these files freely available, anywhere, perhaps? Else, everything is also available from gentoo.org : https://gitweb.gentoo.org/repo/gentoo.git/tree/app-shells/bash/files/bashrc Click on plain to get the raw version. ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 17:52 ` netfab @ 2024-06-15 19:52 ` Alan Mackenzie 0 siblings, 0 replies; 19+ messages in thread From: Alan Mackenzie @ 2024-06-15 19:52 UTC (permalink / raw To: gentoo-user Hello, Netfab. On Fri, Jun 14, 2024 at 19:52:32 +0200, netfab wrote: > Le 14/06/24 à 19:33, Alan Mackenzie a tapoté : > > Are these files freely available, anywhere, perhaps? > Else, everything is also available from gentoo.org : > https://gitweb.gentoo.org/repo/gentoo.git/tree/app-shells/bash/files/bashrc > Click on plain to get the raw version. Thanks, that helped. -- Alan Mackenzie (Nuremberg, Germany). ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 17:33 ` Alan Mackenzie 2024-06-14 17:47 ` netfab 2024-06-14 17:52 ` netfab @ 2024-06-15 11:39 ` Peter Humphrey 2024-06-16 14:26 ` [gentoo-user] " Nuno Silva 3 siblings, 0 replies; 19+ messages in thread From: Peter Humphrey @ 2024-06-15 11:39 UTC (permalink / raw To: gentoo-user On Friday, 14 June 2024 18:33:57 BST Alan Mackenzie wrote: > Are these files freely available, anywhere, perhaps? Your backup from last week? :) -- Regards, Peter. ^ permalink raw reply [flat|nested] 19+ messages in thread
* [gentoo-user] Re: Difficulty with updating /etc/basb/bashrc 2024-06-14 17:33 ` Alan Mackenzie ` (2 preceding siblings ...) 2024-06-15 11:39 ` Peter Humphrey @ 2024-06-16 14:26 ` Nuno Silva 3 siblings, 0 replies; 19+ messages in thread From: Nuno Silva @ 2024-06-16 14:26 UTC (permalink / raw To: gentoo-user On 2024-06-14, Alan Mackenzie wrote: > Hello, Netfab. > > On Fri, Jun 14, 2024 at 18:22:11 +0200, netfab wrote: >> Le 14/06/24 à 17:53, Alan Mackenzie a tapoté : >> > Right now, I have a problem. Is there any convenient way I can get >> > the older standard file contents back again, so as to be able to do >> > this 3-way diff? > >> The old bashrc file installed by previous versions of the ebuild : > >> https://github.com/gentoo/gentoo/blob/master/app-shells/bash/files/bashrc > >> The new bashrc file : > >> https://github.com/gentoo/gentoo/blob/master/app-shells/bash/files/bashrc-r1 > > I don't have access to these files, unfortunately. Github has blocked > them behind a script. I certainly amn't about to let a Microsoft script > run in my browser. That is just too high a cost to pay. > > Are these files freely available, anywhere, perhaps? In this case it's definitely better to use Gentoo's gitweb instead of the GitHub mirror, but, for reference, currently with GitHub you can replace "/blob/" with "/raw/" in the address to get redirected to the raw address (which has more different parts, but just doing this replacement will get you there). (Also: For commit diff URLs in GitHub, appending .diff will get you the plain diff.) (But gitweb is quite better than GitHub, especially now that GitHub requires javascript (and also some newer features, so just enabling javascript isn't enough, you need one of a small number of browsers). GitHub used to be quite usable to browse repositories and investigate code, navigating around different commits in the history, and checking "blame" annotations and so on, but now it's not useful to me even for just that...) -- Nuno Silva ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 15:53 [gentoo-user] Difficulty with updating /etc/basb/bashrc Alan Mackenzie 2024-06-14 16:22 ` netfab @ 2024-06-14 18:25 ` Vitaliy Perekhovy 2024-06-14 20:54 ` Jack 2024-06-15 19:58 ` Alan Mackenzie 2024-06-14 23:43 ` Paul Colquhoun 2024-06-15 16:39 ` Wol 3 siblings, 2 replies; 19+ messages in thread From: Vitaliy Perekhovy @ 2024-06-14 18:25 UTC (permalink / raw To: gentoo-user; +Cc: feriman [-- Attachment #1: Type: text/plain, Size: 379 bytes --] On Fri, Jun 14, 2024 at 03:53:35PM +0000, Alan Mackenzie wrote: > I think portage is at fault here - it should retain the older standard > version of /etc/bash/bashrc so that users can resolve the differences > with a 3-way diff. Before replace your old bashrc file, portage place the old one here: /etc/config-archive/etc/bash/bashrc -- Regards, Vitaliy Perekhovy [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 963 bytes --] ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 18:25 ` [gentoo-user] " Vitaliy Perekhovy @ 2024-06-14 20:54 ` Jack 2024-06-15 6:38 ` Vitaliy Perekhovy 2024-06-15 19:58 ` Alan Mackenzie 1 sibling, 1 reply; 19+ messages in thread From: Jack @ 2024-06-14 20:54 UTC (permalink / raw To: gentoo-user On 2024.06.14 14:25, Vitaliy Perekhovy wrote: > On Fri, Jun 14, 2024 at 03:53:35PM +0000, Alan Mackenzie wrote: > > I think portage is at fault here - it should retain the older > standard > > version of /etc/bash/bashrc so that users can resolve the > differences > > with a 3-way diff. > > Before replace your old bashrc file, portage place the old one > here: /etc/config-archive/etc/bash/bashrc I don't have any such directory. What package does it belong to, or is it a config setting for portage or another package? ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 20:54 ` Jack @ 2024-06-15 6:38 ` Vitaliy Perekhovy 2024-06-15 22:00 ` Jack 0 siblings, 1 reply; 19+ messages in thread From: Vitaliy Perekhovy @ 2024-06-15 6:38 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 545 bytes --] On Fri, Jun 14, 2024 at 04:54:09PM -0400, Jack wrote: > I don't have any such directory. What package does it belong to, or is > it a config setting for portage or another package? Yes, it is a configuration of portage itself. There is an env variable CONFIG_PROTECT that contains a list of directories that portage will protect from automatic modification. Please check this article: https://wiki.gentoo.org/wiki/CONFIG_PROTECT You can query that variable by `portageq envvar CONFIG_PROTECT'. -- Regards, Vitaliy Perekhovy [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 963 bytes --] ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-15 6:38 ` Vitaliy Perekhovy @ 2024-06-15 22:00 ` Jack 2024-06-15 22:24 ` Peter Humphrey 0 siblings, 1 reply; 19+ messages in thread From: Jack @ 2024-06-15 22:00 UTC (permalink / raw To: gentoo-user On 2024.06.15 02:38, Vitaliy Perekhovy wrote: > On Fri, Jun 14, 2024 at 04:54:09PM -0400, Jack wrote: > > I don't have any such directory. What package does it belong to, > or is > > it a config setting for portage or another package? > > Yes, it is a configuration of portage itself. There is an env variable > CONFIG_PROTECT that contains a list of directories that portage will > protect from automatic modification. Please check this article: > https://wiki.gentoo.org/wiki/CONFIG_PROTECT > > You can query that variable by `portageq envvar CONFIG_PROTECT'. /etc is the first entry in my CONFIG_PROTECT, but I still have no config-archive under /etc. I think the folders listed in that variable are treated specially by portage in terms of not silently replacing config files, but doesn't control save/archive. A bit of searching found the wiki page for dispatch-conf, which includes: Before running dispatch-conf for the first time, the settings in /etc/dispatch-conf.conf should be edited, and the archive directory specified in /etc/dispatch-conf.conf will need to be created (/etc/config-archive by default). So it appears that directory may be specific to that tool, and not directly related to portage. ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-15 22:00 ` Jack @ 2024-06-15 22:24 ` Peter Humphrey 0 siblings, 0 replies; 19+ messages in thread From: Peter Humphrey @ 2024-06-15 22:24 UTC (permalink / raw To: gentoo-user On Saturday, 15 June 2024 23:00:07 BST Jack wrote: > A bit of searching found the wiki page for dispatch-conf, which > includes: > > Before running dispatch-conf for the first time, the settings in > /etc/dispatch-conf.conf should be edited, and the archive directory > specified in /etc/dispatch-conf.conf will need to be created > (/etc/config-archive by default). > > So it appears that directory may be specific to that tool, and not > directly related to portage. I wondered if it was a systemd feature, but apparently not. Thanks for clearing that up. -- Regards, Peter. ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 18:25 ` [gentoo-user] " Vitaliy Perekhovy 2024-06-14 20:54 ` Jack @ 2024-06-15 19:58 ` Alan Mackenzie 1 sibling, 0 replies; 19+ messages in thread From: Alan Mackenzie @ 2024-06-15 19:58 UTC (permalink / raw To: gentoo-user; +Cc: feriman Hello, Vitaliy. On Fri, Jun 14, 2024 at 21:25:23 +0300, Vitaliy Perekhovy wrote: > On Fri, Jun 14, 2024 at 03:53:35PM +0000, Alan Mackenzie wrote: > > I think portage is at fault here - it should retain the older standard > > version of /etc/bash/bashrc so that users can resolve the differences > > with a 3-way diff. > Before replace your old bashrc file, portage place the old one > here: /etc/config-archive/etc/bash/bashrc Thanks, I didn't know that. It was extremely helpful. It turns out that Gentoo has reorganised the layout of /etc/bash/bashrc, fragmenting it into bashrc itself and three files in /etc/bash/bashrc.d. Knowing that I was able to sort things out without further problems. It would have been nice to have known about this change before it happened, but I suppose it's too minor a change to clog up the eselect news system with. > -- > Regards, > Vitaliy Perekhovy -- Alan Mackenzie (Nuremberg, Germany). ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 15:53 [gentoo-user] Difficulty with updating /etc/basb/bashrc Alan Mackenzie 2024-06-14 16:22 ` netfab 2024-06-14 18:25 ` [gentoo-user] " Vitaliy Perekhovy @ 2024-06-14 23:43 ` Paul Colquhoun 2024-06-15 8:51 ` Re[2]: " Stefan Schmiedl 2024-06-15 20:10 ` Alan Mackenzie 2024-06-15 16:39 ` Wol 3 siblings, 2 replies; 19+ messages in thread From: Paul Colquhoun @ 2024-06-14 23:43 UTC (permalink / raw To: gentoo-user On Saturday, June 15, 2024 1:53:35 A.M. AEST Alan Mackenzie wrote: > Hello, Gentoo. > My main problem is that I don't know which parts of the existing bashrc > are my changes (which I'd want to keep) and which parts were the standard > bashrc (which I can allow to be superseded by the new version). > > I think portage is at fault here - it should retain the older standard > version of /etc/bash/bashrc so that users can resolve the differences > with a 3-way diff. You edited the old file, not portage. Why didn't you keep a copy of the old file? On the other hand, a quick "locate bashrc" says that my system has some old versions stored away at: /var/db/repos/gentoo/app-shells/bash/files -- Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/ Asking for technical help in newsgroups? Read this first: http://catb.org/~esr/faqs/smart-questions.html#intro ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re[2]: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 23:43 ` Paul Colquhoun @ 2024-06-15 8:51 ` Stefan Schmiedl 2024-06-15 20:10 ` Alan Mackenzie 1 sibling, 0 replies; 19+ messages in thread From: Stefan Schmiedl @ 2024-06-15 8:51 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 721 bytes --] ------ Original Message ------ From "Paul Colquhoun" <paulcol@andor.dropbear.id.au> To gentoo-user@lists.gentoo.org Date 15.06.2024 01:43:22 Subject Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc >You edited the old file, not portage. > >Why didn't you keep a copy of the old file? > I have this in the crontabs of my servers: # fcrontab -l | grep git 2024-06-15 10:26:22 INFO listing root's fcrontab %hourly,mail(no) 35 cd /etc && git add --all . && git commit -m "autocommit" One server recorded 147 commits during the last 12 months, another one reports 1509 commits during the last 12 years. Set it up and forget about it until you run into this problem the next time. s. [-- Attachment #2: Type: text/html, Size: 2901 bytes --] ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 23:43 ` Paul Colquhoun 2024-06-15 8:51 ` Re[2]: " Stefan Schmiedl @ 2024-06-15 20:10 ` Alan Mackenzie 2024-06-17 7:25 ` Wols Lists 1 sibling, 1 reply; 19+ messages in thread From: Alan Mackenzie @ 2024-06-15 20:10 UTC (permalink / raw To: gentoo-user Hello, Paul. On Sat, Jun 15, 2024 at 09:43:22 +1000, Paul Colquhoun wrote: > On Saturday, June 15, 2024 1:53:35 A.M. AEST Alan Mackenzie wrote: > > Hello, Gentoo. > > My main problem is that I don't know which parts of the existing bashrc > > are my changes (which I'd want to keep) and which parts were the standard > > bashrc (which I can allow to be superseded by the new version). > > I think portage is at fault here - it should retain the older standard > > version of /etc/bash/bashrc so that users can resolve the differences > > with a 3-way diff. > You edited the old file, not portage. > Why didn't you keep a copy of the old file? Because that's one of the itsy-bitsy routine things that ought to be automatic, not something that each user should have to think out for himself. It turns out I actually had the old file in /etc/config-archive all along. It's a shame dispatch-conf and friends don't do an automatic 3-way merge. This would make things so much simpler and less stressful. > On the other hand, a quick "locate bashrc" says that my system has some old > versions stored away at: > /var/db/repos/gentoo/app-shells/bash/files For some reason, I don't actually have that directory. > -- > Reverend Paul Colquhoun, ULC. http://andor.dropbear.id.au/ > Asking for technical help in newsgroups? Read this first: > http://catb.org/~esr/faqs/smart-questions.html#intro -- Alan Mackenzie (Nuremberg, Germany). ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-15 20:10 ` Alan Mackenzie @ 2024-06-17 7:25 ` Wols Lists 0 siblings, 0 replies; 19+ messages in thread From: Wols Lists @ 2024-06-17 7:25 UTC (permalink / raw To: gentoo-user On 15/06/2024 21:10, Alan Mackenzie wrote: >> Why didn't you keep a copy of the old file? > Because that's one of the itsy-bitsy routine things that ought to be > automatic, not something that each user should have to think out for > himself. Dunno which update tool it is, but istr there is a tool that does exactly that ... > > It turns out I actually had the old file in /etc/config-archive all > along. It's a shame dispatch-conf and friends don't do an automatic > 3-way merge. This would make things so much simpler and less stressful. Until it gets it wrong. Which is exactly why it doesn't. Which is why git doesn't. Which is why pretty much all tools don't. If they can figure it out they do, but they don't charge ahead regardless. Cheers, Wol ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [gentoo-user] Difficulty with updating /etc/basb/bashrc 2024-06-14 15:53 [gentoo-user] Difficulty with updating /etc/basb/bashrc Alan Mackenzie ` (2 preceding siblings ...) 2024-06-14 23:43 ` Paul Colquhoun @ 2024-06-15 16:39 ` Wol 3 siblings, 0 replies; 19+ messages in thread From: Wol @ 2024-06-15 16:39 UTC (permalink / raw To: gentoo-user On 14/06/2024 16:53, Alan Mackenzie wrote: > I think portage is at fault here - it should retain the older standard > version of /etc/bash/bashrc so that users can resolve the differences > with a 3-way diff. Is it portage itself that DID the update, or it did it tell you to do the update with etc-update, or dispatch-conf, or any one of those programs. Ime portage leaves the new version as ._something so you should have both the old and new versions until you mess it up yourself :-) And as I keep moaning, you can't blame portage for other software being stupid. Doesn't bash have a ~/.bashrc you can edit? I know - all too often the DE gets in the way ... Imho dovecot gets it perfectly right (as does systemd, actually, both of them thought this through properly) because it has a configuration in the default file that tells it to read a local file. So the package manager updates the standard file, and the standard file reads the local configuration to update it with the local settings. Cheers, Wol ^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2024-06-17 7:25 UTC | newest] Thread overview: 19+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-06-14 15:53 [gentoo-user] Difficulty with updating /etc/basb/bashrc Alan Mackenzie 2024-06-14 16:22 ` netfab 2024-06-14 17:33 ` Alan Mackenzie 2024-06-14 17:47 ` netfab 2024-06-14 17:52 ` netfab 2024-06-15 19:52 ` Alan Mackenzie 2024-06-15 11:39 ` Peter Humphrey 2024-06-16 14:26 ` [gentoo-user] " Nuno Silva 2024-06-14 18:25 ` [gentoo-user] " Vitaliy Perekhovy 2024-06-14 20:54 ` Jack 2024-06-15 6:38 ` Vitaliy Perekhovy 2024-06-15 22:00 ` Jack 2024-06-15 22:24 ` Peter Humphrey 2024-06-15 19:58 ` Alan Mackenzie 2024-06-14 23:43 ` Paul Colquhoun 2024-06-15 8:51 ` Re[2]: " Stefan Schmiedl 2024-06-15 20:10 ` Alan Mackenzie 2024-06-17 7:25 ` Wols Lists 2024-06-15 16:39 ` Wol
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox