wesbarnett / snap-pac

Pacman hooks that use snapper to create pre/post btrfs snapshots like openSUSE's YaST
GNU General Public License v2.0
180 stars 14 forks source link

No description when using pamac #12

Closed aardbol closed 6 years ago

aardbol commented 6 years ago

Love the idea of your snap-pac script!

But I wanted to know, is it possible if you could add the feature of adding the package name to the name of the snapshot instead of only a static string?

wesbarnett commented 6 years ago

It's doable, but sometimes updates have several packages, which wouldn't fit into the description.

aardbol commented 6 years ago

Can't you get the name of the main package + the number of the dependencies that are installed together with it then?

As far as installing multiple software at the same time which are unrelated, a snap is made for each installation, so that isn't what you meant right?

In any case, this improvement would be awesome. And so would you, although you already are for creating this tool

wesbarnett commented 6 years ago

A snapshot is not created for each individual package when upgrading. A pre and post snapshot are created for each pacman transaction, which can be multiple packages. The description should already contain the package names for installing a package. For example, if I install "nano" the snapper description is "pacman -S nano". Are you wanting the package names for upgrading too (which currently only has a description of "pacman -Syu").

aardbol commented 6 years ago

Neither when I install or upgrade a description is added to the snapper snapshot list. The only information that is added is that it uses the timeline mechanism and whether it's a pre or post snapshot. Ideally the mentioned information should be added both when installing and upgrading packages.

This is my experience using pamac

wesbarnett commented 6 years ago

What distibution are you using? Do you get descriptions when using "pacman" manually? What version of snap-pac do you have installed?

aardbol commented 6 years ago

Yes I get description of the packages. Even when I go into Detailed more of pamac, then it displays the output of pacman.

Version 1.1 And Antergos Linux

wesbarnett commented 6 years ago

What's the output of sudo snapper -c root list -t pre-post?

aardbol commented 6 years ago

https://image.tf/show/VFiQ9tJW1UEwm6Ic

wesbarnett commented 6 years ago

That description is not in my source code anywhere. I'm thinking it may have been added downstream by Antergos or they are using a fork of the project. Can you post the contents of `/etc/snapper/configs/root?

aardbol commented 6 years ago

Antergos is like Arch, they don't add modify packages and provide pure upstream. The description was customised by my with these lines: PACMAN_PRE_DESCRIPTION and PACMAN_POST_DESCRIPTION because if I don't do that, the descriptions remain empty

wesbarnett commented 6 years ago

Gotcha. I don't use pamac, but I tested it out. Here's what I get when the description is not overidden:

7775  | 7776   | Fri 25 Aug 2017 08:57:49 PM EDT | Fri 25 Aug 2017 08:57:51 PM EDT | /usr/bin/pamac-system-daemon                        |

If I use pacman here is an example description:

7777  | 7778   | Fri 25 Aug 2017 08:59:56 PM EDT | Fri 25 Aug 2017 08:59:57 PM EDT | pacman -S nano                                      |

The hook in this package is just a bash script and uses ps to find out what the parent process of the script is (usually pacman, even with AUR helpers, fontends, etc). It looks like the actual package handling for pamac is all internal, and so this script is unable to access whatever pamac-system-daemon is doing.

aardbol commented 6 years ago

I see. It's unfortunate that it's not compatible with pamac :(