Bachsau schriebPacman tut dies nicht, denn es legt z.B. auch *.pacnew-Dateien an, wenn die Originaldatei nicht geändert wurde aber das neue Paket Änderungen enthält.
Stimmt nicht. Die Beschreibung des backup-Arrays verweist auf die Erläuterungen zum pacman-Verhalten, siehe man PKGBUILD:
backup (array)
An array of file names, without preceding slashes, that should be
backed up if the package is removed or upgraded. This is commonly
used for packages placing configuration files in /etc. See
"Handling Config Files" in pacman(8) for more information.
Der Umgang von pacman mit Dateien aus dem backup-Array steht dann im besagten Abschnitt "Handling Config Files", siehe man pacman:
HANDLING CONFIG FILES
Pacman uses the same logic as rpm to determine action against files
that are designated to be backed up. During an upgrade, three MD5
hashes are used for each backup file to determine the required action:
one for the original file installed, one for the new file that is about
to be installed, and one for the actual file existing on the file
system. After comparing these three hashes, the follow scenarios can
result:
original=X, current=X, new=X
All three files are the same, so overwrites are not an issue.
Install the new file.
original=X, current=X, new=Y
The current file is the same as the original, but the new one
differs. Since the user did not ever modify the file, and the new
one may contain improvements or bug fixes, install the new file.
original=X, current=Y, new=X
Both package versions contain the exact same file, but the one on
the file system has been modified. Leave the current file in place.
original=X, current=Y, new=Y
The new file is identical to the current file. Install the new
file.
original=X, current=Y, new=Z
All three files are different, so install the new file with a
.pacnew extension and warn the user. The user must then manually
merge any necessary changes into the original file.
original=NULL, current=Y, new=Z
The package was not previously installed, and the file already
exists on the file system. Install the new file with a .pacnew
extension and warn the user. The user must then manually merge any
necessary changes into the original file.
Zu beachten ist, dass pacman mit Hashes über den Dateiinhalten arbeitet. Gibt es also Änderungen durch hinzugefügten oder entfernten Whitespace, dann ist das zwar oft keine semantische Änderung, für pacman jedoch trotzdem ein Unterschied.
pacman warnt, etwas verklausuliert, beim Aktualisieren, wenn eine Datei aus dem backup-Array fehlt (und daher wieder geschrieben wird):
Warnung: konnte Dateiinformationen für etc/skel/.bash_profile nicht ermitteln
/etc/skel/.bash_profile ist übrigens nicht leer, sondern sourct ~/.bashrc, die als /etc/skel/.bashrc auch nicht leer ist.
Die Idee ist vermutlich, dass die Bash beim Starten grundsätzlich die ~/.bashrc laden soll und zwar unabhängig ob die Bash als Login-Shell aufgerufen wurde oder nicht. Man also immer die gewünschte Bash-Konfiguration hat, egal wie die Bash gestartet wird. Dagegen wird ~/.profile nur berücksichtigt, wenn die Bash als Login-Shell gestartet wird. Siehe man bash, Abschnitt Invocation.
Vielleicht passen deine Änderungen der .profile besser in die .bashrc. Gegen den Paketbauer und den Paketmanager zu arbeiten ist irgendwann später einmal nicht selten die Quelle zeitaufwändig zu klärender "Probleme".