You are not logged in.

#1 2015-09-21 14:38:47

aneaz
Member
Registered: 2015-09-21
Posts: 2

arch-diff - diff all pacman packages against the filesystem

For ages I thought about writing a small tool that lists all files differing from their original state installed by pacman, in order to get a sense of how messed up a system currently is. Finally, i got around writing it:

https://github.com/aneas/arch-diff
https://aur.archlinux.org/packages/arch-diff/

It compares the mtree-lists of all installed packages with the filesystem (filetype, mode, uid, gid, size, md5) and prints all missing, untracked and modified entries. My goal is to keep my system clean and regain some confidence in the tidyness and integrity of my Archlinux installation.
The tool itself is in its alpha state, but should work if given the right permissions.

Any feedback is highly welcome!

Offline

#2 2015-09-21 20:32:21

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: arch-diff - diff all pacman packages against the filesystem

Is it like 'pacman -Qkk' with a more verbose output?

Offline

#3 2015-09-22 08:46:40

aneaz
Member
Registered: 2015-09-21
Posts: 2

Re: arch-diff - diff all pacman packages against the filesystem

I have to admit I didn't know about pacman -Qkk. This would have saved we a weekend...

Yes, arch-diff is just like it, a bit more verbose maybe, and it performs a md5 instead of relying on modtime. Additionally, it lists all untracked files on the filesystem. Untracked directories will not be expanded, so don't worry about it scanning your home dirs or mountpoints. This can be useful if you happen to perform a `sudo make install` on some project and want to delete all those rogue files.

Offline

#4 2015-09-23 10:33:43

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: arch-diff - diff all pacman packages against the filesystem

I like this, especially for its untracked files and directories smile

Your PKGBUILD installs into /usr/local, however. This line inside package() fixes that:

make PREFIX="/usr" DESTDIR="$pkgdir/" install

If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#5 2016-02-16 22:49:34

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: arch-diff - diff all pacman packages against the filesystem

After the Pacman 5.0 update, arch-diff started spewing out a lot of "[missing] ./BUILDINFO" lines. I opened an issue and followed up with a pull request to fix this[1, 2] but as of yet I have not received a reply from aneaz (I will try an email soon).

Until then, you can take my patched fork of arch-diff which fixes the issue: https://github.com/Unia/arch-diff. For a PKGBUILD, see: https://gist.github.com/Unia/c0e0e873c7ffbade8aa7 (This PKGBUILD also fixes the issue described in my post above).

[1]: https://github.com/aneas/arch-diff/issues/2
[2]: https://github.com/aneas/arch-diff/pull/4


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#6 2016-05-25 13:24:36

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: arch-diff - diff all pacman packages against the filesystem

^ Both issues described above by myself have just been resolved smile


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

Board footer

Powered by FluxBB