Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cfg-update not not working correctly [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mcnutty
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2009
Posts: 142

PostPosted: Wed Dec 11, 2024 3:43 pm    Post subject: cfg-update not not working correctly [Solved] Reply with quote

I'm not sure exactly when or why, but 'cfg-update -u' no longer works consistently on my system.

When I run it it will identify the conflicting config files as normal, e.g.,:

Code:
12/11/2024 07:28:32$ cfg-update -u
12/11/2024 07:28:52
Searching for updates...

<< Stage1 >> 0 files in queue for automatic replacing, skipping...

<< Stage2 >> 0 files in queue for automatic 3-way merging, skipping...

<< Stage3 >> 0 files in queue for manual 3-way merging, skipping...

<< Stage4 >> 2 files in queue for manual 2-way merging, starting...

(1/2)  /etc/portage/package.use/steam  *Custom File     
* YOU ARE ABOUT TO UPDATE A CUSTOM FILE. YOU SHOULD ASK YOURSELF
* WHERE DOES IT COME FROM AND WHAT HAPPENDS WHEN YOU REPLACE IT?
* PORTAGE DID NOT INSTALL THE CURRENT FILE, MOST LIKELY IT HAS BEEN
* CREATED AFTER INSTALLATION AND IT MAY CONTAIN CUSTOM SETTINGS.
  Press [y] - to merge the current file and the ._cfg0000_* file with kdiff3
  Press [s] - to skip this update (to investigate first, and try again later)
  Press [1] - to use the ._cfg0000_* file
  Press [2] - to remove the ._cfg0000_* file
  Press [q] - to quit cfg-update immediately
  Merge manually with file : /etc/portage/package.use/._cfg0000_steam ? [y|s|1|2|q]
  In kdiff3 you select the lines that you want to keep.
  When done, click the save button and exit kdiff3!
  When you exit kdiff3, cfg-update will finish the update...


But when I enter 'y', it will bring up kdiff with an empty diff and a dialog that says 0 diffs were found. After clicking ok to the first dialog, a second dialog opens saying (in this example), "Opening of these files failed: /etc/portage/package.use/._cfg0000_steam"

Sometimes rebooting and trying again works and sometimes not. Does anyone know what's going on and how to fix it?

P.S. Sorry, if this posts more than once. After hitting submit I keep getting a message saying something like "Error in posting", and then I don't see my message in the forum. (It appears certain Unicode characters are not allowed and removing them let the post go through)


Last edited by mcnutty on Wed Dec 11, 2024 7:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
freke
Veteran
Veteran


Joined: 23 Jan 2003
Posts: 1038
Location: Somewhere in Denmark

PostPosted: Wed Dec 11, 2024 4:05 pm    Post subject: Reply with quote

Permissions issue? - what user is running cfg-update?
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1963

PostPosted: Wed Dec 11, 2024 4:08 pm    Post subject: Reply with quote

Next time this happens, Choose 's' to skip and then examine both /etc/portage/package.use/steam and /etc/portage/package.use/._cfg0000_steam .
Consider both the contents and the permissions.

Often, files like these are the target of the --autounmask-write option. Personally, I manage my package.use files by hand and disable this functionality.

If you need further help, post the contents of both files here when it occurs again.
Back to top
View user's profile Send private message
mcnutty
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2009
Posts: 142

PostPosted: Wed Dec 11, 2024 4:47 pm    Post subject: Reply with quote

The permissions look ok to me:

Code:
root>ls /etc/portage/package.use/steam
-rw-r--r-- 1 root root 2.1K Jul 28 17:05 /etc/portage/package.use/steam
root>ls /etc/portage/package.use/._cfg0000_steam
-rw-r--r-- 1 root root 2.2K Dec 11 07:25 /etc/portage/package.use/._cfg0000_steam


And the contents are identical as far as I can tell:

Code:

root>diff /etc/portage/package.use/._cfg0000_steam /etc/portage/package.use/._cfg0000_steam
[no output]


I'm reading through the man page about the various autounmask options and they mostly make sense. I don't think I've ever explicitly enabled --autounmask (or any subflag). However, it's possible when I emerged steam (and a few other packages) it asked me if I wanted to automatically add the use flags and I said yes, even though I usually manually copy and paste them to new or existing files.

Is there a way to get back to managing all my use flags manually?
Back to top
View user's profile Send private message
mcnutty
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2009
Posts: 142

PostPosted: Wed Dec 11, 2024 4:55 pm    Post subject: Reply with quote

freke wrote:
Permissions issue? - what user is running cfg-update?


Running cfg-update as roo.
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1340
Location: Richmond Hill, Canada

PostPosted: Wed Dec 11, 2024 4:58 pm    Post subject: Reply with quote

May be you want to review you test :D

your ls show very different size 2.1k vs 2.2k.
And you diff compare same file.

mcnutty wrote:
The permissions look ok to me:

Code:
root>ls /etc/portage/package.use/steam
-rw-r--r-- 1 root root 2.1K Jul 28 17:05 /etc/portage/package.use/steam
root>ls /etc/portage/package.use/._cfg0000_steam
-rw-r--r-- 1 root root 2.2K Dec 11 07:25 /etc/portage/package.use/._cfg0000_steam


And the contents are identical as far as I can tell:

Code:

root>diff /etc/portage/package.use/._cfg0000_steam /etc/portage/package.use/._cfg0000_steam
[no output]


I'm reading through the man page about the various autounmask options and they mostly make sense. I don't think I've ever explicitly enabled --autounmask (or any subflag). However, it's possible when I emerged steam (and a few other packages) it asked me if I wanted to automatically add the use flags and I said yes, even though I usually manually copy and paste them to new or existing files.

Is there a way to get back to managing all my use flags manually?
Back to top
View user's profile Send private message
mcnutty
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2009
Posts: 142

PostPosted: Wed Dec 11, 2024 5:22 pm    Post subject: Reply with quote

pingtoo wrote:
May be you want to review you test :D

your ls show very different size 2.1k vs 2.2k.
And you diff compare same file.


Thanks! 8O

Code:
root>diff /etc/portage/package.use/._cfg0000_steam /etc/portage/package.use/steam
17,18c17
< # move sys-devel/llvm llvm-core/llvm
< llvm-core/llvm  abi_x86_32
---
> sys-devel/llvm  abi_x86_32
38,39c37
< # move sys-devel/clang llvm-core/clang
< llvm-core/clang abi_x86_32
---
> sys-devel/clang abi_x86_32


I am still stuck on how to resolve this though.
Back to top
View user's profile Send private message
freke
Veteran
Veteran


Joined: 23 Jan 2003
Posts: 1038
Location: Somewhere in Denmark

PostPosted: Wed Dec 11, 2024 6:30 pm    Post subject: Reply with quote

Is it a matter of shell used? (what shell is used?)

I haven't seen command-prompts like that.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2528

PostPosted: Wed Dec 11, 2024 6:56 pm    Post subject: Reply with quote

mcnutty wrote:

I am still stuck on how to resolve this though.


Up until now I knew about etc-update but never heard of cfg-update. I use dispatch-conf however. Try it or etc-update.

p.s. check if there are more ._cfg files.

Best Regards,
Georgi
Back to top
View user's profile Send private message
mcnutty
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2009
Posts: 142

PostPosted: Wed Dec 11, 2024 7:09 pm    Post subject: Reply with quote

freke wrote:
Is it a matter of shell used? (what shell is used?)

I haven't seen command-prompts like that.


I use bash. The command prompt 'root>' is just a mockup. My actual prompt contains Unicode that the forums don't accept.
Back to top
View user's profile Send private message
mcnutty
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2009
Posts: 142

PostPosted: Wed Dec 11, 2024 7:11 pm    Post subject: Reply with quote

logrusx wrote:
mcnutty wrote:

I am still stuck on how to resolve this though.


Up until now I knew about etc-update but never heard of cfg-update. I use dispatch-conf however. Try it or etc-update.

p.s. check if there are more ._cfg files.

Best Regards,
Georgi


I've been using cfg-update without any (major) issues for at least 15 years. I don't like dispatch-conf or etc-update and don't really want to change.
Back to top
View user's profile Send private message
mcnutty
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2009
Posts: 142

PostPosted: Wed Dec 11, 2024 7:26 pm    Post subject: Reply with quote

After some more investigation, my current best guess is kdiff3 is the problem. Running kdiff3 manually on the command line
Code:
root>kdiff3 /etc/portage/package.use/._cfg0000_steam /etc/portage/package.use/steam

produces the same error as with cfg-update. However, using a different tool on the command line e.g., meld, works just fine. Strangely, running kdiff3 without arguments and then selecting the files from the GUI works just fine. Also running:
Code:
root>cfg-update -u -t meld

works as expected.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2528

PostPosted: Wed Dec 11, 2024 8:31 pm    Post subject: Reply with quote

mcnutty wrote:
and don't really want to change.


I'm sorry, I thought you had a different problem :)

mcnutty wrote:
After some more investigation, my current best guess is kdiff3 is the problem. Running kdiff3 manually on the command line
Code:
root>kdiff3 /etc/portage/package.use/._cfg0000_steam /etc/portage/package.use/steam

produces the same error as with cfg-update. However, using a different tool on the command line e.g., meld, works just fine. Strangely, running kdiff3 without arguments and then selecting the files from the GUI works just fine. Also running:
Code:
root>cfg-update -u -t meld

works as expected.


That actually speaks for a change needed in cfg-update. A bug might be helpful.

EDIT: I just checked and kdiff3-1.11.5 from the binhost works fine with cfg-update. For the test I copied one of my package.use entries as a ._cfg file, made a single changes in it and kdiff3 showed the difference fine in a graphic window.

Best Regards,
Georgi
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1963

PostPosted: Wed Dec 11, 2024 9:11 pm    Post subject: Reply with quote

logrusx wrote:
That actually speaks for a change needed in cfg-update. A bug might be helpful.

I'll disagree in that if the command-line does the same thing, then it's kdiff's fault. cfg-update can use other tools by default in its config file if necessary (or change options as needed). cfg-update is just calling the diff/merge tool so nothing to fix in itself.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2528

PostPosted: Wed Dec 11, 2024 9:25 pm    Post subject: Reply with quote

grknight wrote:
logrusx wrote:
That actually speaks for a change needed in cfg-update. A bug might be helpful.

I'll disagree in that if the command-line does the same thing, then it's kdiff's fault. cfg-update can use other tools by default in its config file if necessary (or change options as needed). cfg-update is just calling the diff/merge tool so nothing to fix in itself.


Maybe you didn't see the edit I made to my post above. I'm pretty sure when I made it, nobody had posted after me yet.

I wrongly assumed something had changed in kdiff3. Which might still hold true if OP's using the testing version.

Best Regards,
Georgi
Back to top
View user's profile Send private message
mcnutty
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2009
Posts: 142

PostPosted: Wed Dec 11, 2024 9:31 pm    Post subject: Reply with quote

logrusx wrote:

EDIT: I just checked and kdiff3-1.11.5 from the binhost works fine with cfg-update. For the test I copied one of my package.use entries as a ._cfg file, made a single changes in it and kdiff3 showed the difference fine in a graphic window.


Definitely, looks like it is probably a KDE/kdiff3 bug. It claims to be fixed in 1.11.2, but maybe not.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2528

PostPosted: Thu Dec 12, 2024 6:49 am    Post subject: Reply with quote

mcnutty wrote:

Definitely, looks like it is probably a KDE/kdiff3 bug. It claims to be fixed in 1.11.2, but maybe not.


That bug is related to Windows installer.

Version 1.11.5 works fine for me, what version do you have?

Best Regards,
Georgi
Back to top
View user's profile Send private message
mcnutty
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2009
Posts: 142

PostPosted: Thu Dec 12, 2024 3:52 pm    Post subject: Reply with quote

[quote="logrusx"]
mcnutty wrote:

That bug is related to Windows installer.

Version 1.11.5 works fine for me, what version do you have?

Best Regards,
Georgi


The initial bug report might have been about the Windows installer, but the comment I linked to was a user running Arch (kdiff3 1.11.1) and is showing the exact behavior I am seeing on version 1.11.5. Anyway I've filed a bug report on the KDE bug tracker.

Thanks for all the help and responses. :)
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1963

PostPosted: Thu Dec 12, 2024 5:37 pm    Post subject: Reply with quote

mcnutty wrote:
The initial bug report might have been about the Windows installer, but the comment I linked to was a user running Arch (kdiff3 1.11.1) and is showing the exact behavior I am seeing on version 1.11.5. Anyway I've filed a bug report on the KDE bug tracker.

Thanks for all the help and responses. :)

The bug report seems to indicate kdiff3 has a hard time with mixed line endings in a file.
Possibly check the non-printable characters and line endings to ensure both files are UNIX (\n and not \r\n)
Back to top
View user's profile Send private message
mcnutty
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2009
Posts: 142

PostPosted: Thu Dec 12, 2024 5:52 pm    Post subject: Reply with quote

grknight wrote:
The bug report seems to indicate kdiff3 has a hard time with mixed line endings in a file.
Possibly check the non-printable characters and line endings to ensure both files are UNIX (\n and not \r\n)

All files have UNIX newlines. This will fail as described before:

Code:
$echo "a" > file1.txt; echo "b" > file2.txt; kdiff3 file1.txt file2.txt
Back to top
View user's profile Send private message
mcnutty
Tux's lil' helper
Tux's lil' helper


Joined: 29 Dec 2009
Posts: 142

PostPosted: Fri Dec 20, 2024 8:54 pm    Post subject: Reply with quote

The bug appears to be fixed in 1.12.0.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum