Check and manage pacnew files

Well i update also the first post:
For contributions is possible use this repo in codeberg ( i find more easy setup mirroring in both way here )

I push all of your suggestions/corrections soon but in this days i m a little busy with my daily work

3 Likes

You have removed all special formatting:
see there

thiis your

No I didn’t. The chat has changed the content. Copy/past does not work in the forum, I can see, but I cannot upload the file. Perhaps I should have used the code formatting, I’ll try again:

es.po corrected new
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the manjaro-pacnew-checker package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# 
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: manjaro-pacnew-checker\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: attranslate\n"

msgid "Now we will <span foreground='red'>remove</span> the $suffix file"
msgstr "Ahora <span foreground='red'>eliminaremos</span> el archivo $suffix ."

msgid ""
"This program is free software, you can redistribute it and/or modify it under the terms of the GNU "
"General Public License as published by the Free Software Foundation version 3 of the License.\n"
"\n"
"This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without "
"even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "
"General Public License for more details.\n"
"\n"
"Author: Stefano Capitani\n"
"stefano@manjaro.org"
msgstr ""
"Este programa es software libre, puede redistribuirlo y/o modificarlo bajo los términos de la "
"Licencia Pública General GNU publicada por la Free Software Foundation, versión 3 de la licencia.\n"
"\n"
"Este programa se distribuye con la esperanza de que sea útil, pero SIN NINGUNA GARANTÍA, "
"ni siquiera la garantía implícita MERCANTIL o ADECUACIÓN PARA UN PROPÓSITO PARTICULAR. "
"Consulte la Licencia Pública General GNU para más detalles.\n"
"\n"
"Autor: Stefano Capitani\n"
"Stefano@manjaro.org"

msgid ""
"<span foreground='red'>New Pacnew/Pacsave files found:\\n"
"</span>\n"
"Keep in mind:\\n"
"\n"
"You must be aware of your choices. If you are unsure please inquire using our social channels such "
"as our support forum.\\n"
msgstr ""
"<span foreground='red'>Se encontraron nuevos archivos pacnew/pacsave:\\n"
"</span>\n"
"Tenga en cuenta:\n"
"\n"
"Debe ser consciente de sus elecciones. Si no está seguro, pregunte usando nuestros canales "
"sociales, por ejemplo nuestro foro de soporte.\\n"

msgid "What do you want to do with the file <span foreground='red'>$basefile</span>?\\n"
msgstr "¿Qué quiere hacer con el archivo <span foreground='red'>$basefile</span>?\\n"

msgid "Keep the original and remove the $suffix file"
msgstr "Mantener el archivo original y eliminar el archivo $suffix ."

msgid "View and merge the $suffix file"
msgstr "Ver y fusionar el archivo $suffix "

msgid "Replace the original with the $suffix file"
msgstr "Sustituir el archivo original por el archivo $suffix ."

msgid "Do nothing"
msgstr "No hacer nada"

msgid "Management of Pacnew/Pacsave complete"
msgstr "Gestión de Pacnew/Pacsave completa"

Yes, now it works properly.


BTW: I’ve tried to edit the file in codeberg repo, but I don’t now how to do that. I’ve created a fork, but I cannot find how to propose a merge… (I’m sorry, I’ve never user git or similar repos in a collaborative mode, just for my own projects).

i think you need to click there
image
Pull Request
and then new Pull Request

Done (I hope!)

Sorry to skip the hundred or so posts … but …
I feel I should mention that the manjaro-pacnew-checker package as it is now seems to have odd dependencies…
kio-admin is an optional dep, while gvfs is a required dep.
Meaning even if kio is already installed, gvfs will be installed anyways …
I dont think this is the intended behavior.

1 Like

kio-admin should not even be an optional dependency in my opinion.

It is just not needed, and has purpose not required/used with pacnew-checker.

There’s just no escape from the GNOME Borg, is there? :stuck_out_tongue:

1 Like

I just sent a PR on Codeberg to revert the changes made to FR language which broke the consistency (it removed new lines), and made the translation consistent with the original regarding all the \n and \\n, and strings (like the <span> on a new line which was different from the original strings).

Overall I think the PO files are weirdly constructed, adding the new lines in that file was a mistake to begin with, the new lines should be only in the original code of the executable, and the text strings should just but that, text strings. It would make the PO files clearer.

I have a question that boggles my mind since the begining of this project.

There was an app pacnew-chaster, that did everything that this script intended to do, but simply better and in a more convenient way. It wasn’t perfect, but easier to use. It was abandoned, but worked well for years. Recently hooks started creating some errors, so I uninstalled it, but wouldn’t it be just better to fork it, or maybe ask the owner to take over the original project, and upgrade it, so it would work as seamlessly as before?

https://aur.archlinux.org/packages/pacnew-chaser

Currently, the least problematic method of managing pacnew files is this command:


sudo DIFFPROG=meld pacdiff

but I’m not sure if it’s finding everything, hence this is not the best solution either.

Not really dead (I reinstalled it on a new PC 6 months ago and I’m still using it). But pacnew-chaser.hook is disabled* (renamed to /etc/pacman.d/hooks/pacnew-chaser).
If I don’t have any issues on gitlab for the last 6 years, for me it’s all ok, no reason to go back to (old) code. And I regularly get feedback from people who still use it.
Note: I can’t connect to gitlab anymore, it sends a key to an old email. So I can’t even reply to an issue.

I’m thinking (since one year) of totally rewriting this application one day (in another language), but that may be in 6 months or 1 year.

EDIT: disabled hook, manually after install (popup during installation is not for me)

So can I safely install it now? Previously it was creating some error messages during update, but seemed to be working fine when launched.

I still use pacnew-chaser (with meld for compare/edit), in fact since its creation several years ago. Happy with it and hoping it will last a long time more :wink:

1 Like

The audacity to come here, asking to scrap this project and fork another one so user can continue to use something he used before and likes better. Are you insane?

//EDIT:

There is an issue @Ste74 with the HOOK script /usr/share/libalpm/scripts/pacnew-check, the use of last command should be stopped. It cuts the username to a specific length so it breaks if username is longer than 8 characters. Is it even need to “sudo as the user” when the hook is executed? Isn’t it a root action already? Anyway, basically last update broke it for people with username longer than 8 character.

Maybe with Polkit you can allow Pacnew Checker to delete that file without elevating privileges.

On another topic, I think the whole authentication thing should be changed, typing the sudo password for every click/action is getting old I’m not gonna lie. I don’t have a good idea for now to change this. will update this post if I have a bright idea.

//EDIT2: For the hook script problem, maybe a simple solution is to touch the file /tmp/pacnew-check.file as root (no sudo) and chmod it 777 so the user can delete it. Problem solved. (//EDIT: no, user can not delete it then only owner can in this folder)

I see there is still kio-admin as optional unrelated dependency in the package. As stated before it is not needed for the admin:/// protocol. It seems to be needed for that protocol to work in GUI file explorer which has nothing to do here.

//EDIT3: I now think it would be simpler to make a Polkit permission file and just allow all actions by default, it currently is kind of a mess regarding the dozen authentication you need to do when you want to manage a few .pacnew files. But I would not do that without more safeguards for the critical .pacnew files that should never be allowed to be merged, see my early report about that Check and manage pacnew files - #7 by omano

Michal, pacdiff is the official thing and it will find everything. Stefano’s project is a gui around it for convenience and using it internally. No idea about the chaser, i just heard about it, sounds interesting.

I use pacnew-chaser from the AUR. It works perfectly well. :wink:

3 Likes

On the old forum, there was his topic. And as mentioned above, I haven’t touched it in years. Users of the manjaro forum had contributed ideas and feedback.

For me, it was originally a lazarus test: to see if it was easy to make a gtk or qt application with exactly the same code. And for this test, I might as well take a small project that might be useful and not already exist. What’s more, Pascal was the first language I learned at school, so I could see how it had evolved 30 years later.
The test was not good: qt compilation ok but not gtk. As a result, I stopped using it because it didn’t meet my expectations.


and who is not good ?

last --since="-1d"
12345678 tty4                          Sat Jun 29 21:03   still logged in
patrick  tty3                          Sat Jun 29 21:01   still logged in



who -u
...
patrick  pts/3        2024-06-28 19:08 00:53        3883 (:0)
1234567890123456789              2024-06-29 21:01   ?             0
patrick  tty3         2024-06-29 21:01  ancie      76825
1234567890123456789 tty4         2024-06-29 21:03 00:04       76869

yes, 1234567890123456789 is a user :rofl:

1 Like

Problem is that it is the Pacman hook that executes the command, and Ste74 has made it in last update that we don’t need to elevate privileges to delete the pacnew-check spy file as the user, when it is created by the Pacman hook (when the file exists, Pacnew Chercker is run), by making it owned by the user. so the who command will say root and will not work then when the script (not the hook) will be run as the user.

ok
we can use a filter | grep -v “root”
BUT
in my output , who is the good user ? here the last is in tty4, but which user run pacman ??? me or 123456… ? both are connected at the moment
so
list users is not a good solution


YES create a rule(no pass) for delete is best

it should definitely be documented (not just somewhere, but in the man page)
that user names are going to be truncated

I did not see any indication of it - only when this fails with long user names it becomes apparent
and people scratch their head …