Pacdiff -s Bug - merge

In the last stable update there was 2x pacnew files, i merged on my PC/Laptop right after the update 1 file and then i switched on both system from Kernel 6.1 to 6.6… 1 week later, i just wanted to merge the other pacnew file with pacdiff -s but when i press m for Merge there is only a message in Terminal: -> Unable to find a base package.

v for view is working on both system and Meld is showing up.
q for quit and s for skip is working too.

1 Like

pacdiff doesn’t change when changing kernel.

pacdiff is part of pacman-contrib

1 Like

It is not kernel related since i was on 6.6 since long time. There is some “bug” or probably misconfiguration with merging and meld since the last update. But i just edited my pacnew manually and didn’t bother to debug.

Yeah i reinstalled it after the stable release.

Well i also could still use V (for VIEW) and was still able to merge it with Meld… i just wanted to tell there is a bug, even its minor.

Maybe i have flawed memories? But i think i would know when Merge (M) Hotkey wasnt working in first place.

Besides Kernel Switch, i don’t think i changed anything else around my Manjaro, specially not on my Laptop. :man_shrugging:

If I recall correct pacdiff requires vi - so possibly you will need to use Esc to switch back to command mode.

If think this is a common mistake when using vi based tools - switching command mode back and forth.

There was actually some error message that pacdiff threw, but i do not remember anymore…i just had to change one line in ma passwd file so i did it manually with another text editor and did not bother anymore.
As i said, in my case i noticed it after last update. I think it worked without errors before, but the last pacnews before that were some months ago…

i tried to simulate it - either pacdiff is buggy or it does not work with my simulation

[teo@teo-lenovo-v15 ~]$ sudo updatedb
[teo@teo-lenovo-v15 ~]$ DIFFPROG=meld pacdiff -s -l
==> pacnew file found for /home/teo/bla.conf
:: (V)iew, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/m/s/r/o/q] v
error: No package owns /home/teo/bla.conf
:: (V)iew, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/m/s/r/o/q] m
error: No package owns /home/teo/bla.conf
:: (V)iew, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/m/s/r/o/q] q
[teo@teo-lenovo-v15 ~]$ pacdiff -s -l
==> pacnew file found for /home/teo/bla.conf
:: (V)iew, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/m/s/r/o/q] v
error: No package owns /home/teo/bla.conf
:: (V)iew, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/m/s/r/o/q] m
error: No package owns /home/teo/bla.conf
:: (V)iew, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/m/s/r/o/q] q
[teo@teo-lenovo-v15 ~]$ pacdiff -l
==> pacnew file found for /home/teo/bla.conf
:: (V)iew, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/m/s/r/o/q] v
error: No package owns /home/teo/bla.conf
:: (V)iew, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/m/s/r/o/q] q
[teo@teo-lenovo-v15 ~]$ 

Because of this I moved to meld to merge new configuration files.

I made another test, this time for real with pacman.conf. The error about ownership is logically not there anymore. By hitting M i get the error about the base package. As far as i understand from topics in the arch forum, that seems to be connected with me clearing the pacman cache.

However, if i select V for view, Meld opens, i can make changes to the files and after saving and closing meld everything is fine (pacdiff sees the changes, asks for deletion, etc. as expected).

1 Like

Atleast im not alone. So there is something wrong with the pacman cache? Can this be fixed?

As i said already, its just a minor bug… V (View) and Edit/Merging still works. But when there is a solution, i would love to fix it.

Sry, I can’t follow you.
vi? command mode???

Some new feature since update of pacdiff a couple of months ago according to arch forum
, seems like it requires cached version of packets and i cleaned my cache after the update.

It does not start VI editor at all, that is the problem. Not the meld variable.

1 Like

Maybe my cache was cleaned also, but after the switch from 6.1 to 6.6 Kernel, thats why it was running first but then not…!? :face_with_monocle:

I just remember i was also using Bleachbit on both systems, a cache cleaning program. :scream: :innocent: :rofl:

First off,
I never use the ‘merge’ function.
heres a bit of it, related to your query.

base_cache_tar() {

        for cachedir in "${cachedirs[@]}"; do
                pushd "$cachedir" &>/dev/null || {
                        error "failed to chdir to '%s', skipping" "$cachedir"

                find "$PWD" -name "$package-[0-9]*.pkg.tar*" ! -name '*.sig' |
                        pacsort --files --reverse | sed -ne '2p'

                popd &>/dev/null || exit


merge_file() {

        package="$(pacman -Qoq "$file")" || return 1
        base_tar="$(base_cache_tar "$package")"

        if [[ -z $base_tar ]]; then
                msg2 "Unable to find a base package."
                return 1

        basename="$(basename "$file")"
        tempdir="$(mktemp -d --tmpdir "pacdiff-merge-$basename.XXX")"
        base="$(mktemp "$tempdir"/"$basename.base.XXX")"
        merged="$(mktemp "$tempdir"/"$basename.merged.XXX")"

        if ! bsdtar -xqOf "$base_tar" "${file#/}" >"$base"; then
                msg2 "Unable to extract the previous version of this file."
                return 1

        if $mergeprog "$file" "$base" "$pacfile" >"$merged"; then
                msg2 "Merged without conflicts."

        $diffprog "$file" "$merged"

        while :; do
                ask "Would you like to use the results of the merge? [y/n] "

                read -r c || return 1
                case $c in
                        y|Y) break ;;
                        n|N) return 1 ;;
                        *) msg2 "Invalid answer." ;;

        if ! $SUDO cp -v "$merged" "$file"; then
                warning "Unable to write merged file to %s. Merged file is preserved at %s" "$file" "$merged"
                return 1
        $SUDO rm -rv "$pacfile" "$tempdir"
        return 0

So yeah … anything between missing package or package cache could do it.

pacdiff is the utility for finding/parsing the pacnews. It is not an editor or diff manager.
I dont understand this statement.
I use meld too … as called by pacdiff.


Meld is still buggy when i press “m”, i don’t even see a Password query… and the content from Meld is buggy as hell and show’s different content, compared to “v” View.

Merging with View still works btw.

Still not melds fault.

Do you know what the merge option does?
I showed it above.

It will do the merge for you without asking and then compare the difference.
This relies on MERGEPROG which is diff3 -m by default.
Again - this happens already when you hit m - then DIFFPROG is used to show you the difference of the previous file and merged file.

Your examples seem to show it … doing exactly what it is supposed to do.

But i always did “m” Merge in the past and it behaved like “v” View today.

TBH i never used View till the moment where Merge was broken (3 month ago).

Is it possible that the code maybe changed fundamental in the last ~7month?
I just don’t understand how it can behave so much differently today.

Or maybe i have the wrong viewpoint and Merge was buggy in the past and behaved like View and this is fixed today? :crazy_face:

Yes i noticed this a couple of months ago, i am not sure if merge worked before, and if is a bug or by design of pacdiff. Just use view from now on.

1 Like

view was always the only suggestion.

merge - as shown above does something different - it tries to automatically merge the files and then uses DIFFPROG to show the difference. This has not changed any time recently.

This ‘automatic merge’ is also why it was never the suggestion.

If you are really interested … the most recent change was to how mlocate was used in March.

I pressed ^W^W]cdp:q:wq, and it worked.

m “merge” wasn’t automatic for me :thinking:

I never saw this merge behavior like on the screenshots that i uploaded in msg13

Till march this year i manually merged my files with Meld, this is my pacnew History:

Merged am 07/2023 PC/Laptop:

Merged am 14/08/2023 PC/Laptop:
/etc/pam.d/sddm (only deleted)

Merged am 14/08/2023 PC only:

Merged am 19/09/2023 PC/Laptop:
Merged am 19/09/2023 PC only:

Merged am 05/03/2024 PC/Laptop:

Passwd was first pacnew file where “Merge” changed for me.

Btw. I don’t mind if a Mod changed the Topic Title and remove “after changing from Kernel 6.1 to 6.6” since it was a mistake from my side, to add this Kernel stuff but it don’t had a relation to the change.

Edit: Thank for the topic change :slight_smile:

Dont know what to tell you. I quoted the script above already and it has done the same things in that regard at least as far back as the last year or 2 (and I dont feel like looking further).

This stuff right here … where it merges and then shows the difference if successful.
Again this is not new.

        if $mergeprog "$file" "$base" "$pacfile" >"$merged"; then
                msg2 "Merged without conflicts."

        $diffprog "$file" "$merged"

(and again why I would never suggest using the ‘merge’ function)

1 Like