You are not logged in.

#1 2011-12-12 19:42:31

vitoreiji
Member
Registered: 2009-09-04
Posts: 67

[SOLVED] System wide diff?

Hi,
This is not really a question about installation, but since it is about hardware migration (got a new machine and getting rid of the old one), I think this is the best place to post it. Please move it if I'm wrong.
I would like to see every tweak that I made to my old system, to see if I still need it and wether it aplies to my new one.

So, in stages, I would:
1) generate a list of files that are not owned by any package with this tip from the wiki;
2) then I would get a diff of every file in my installed packages against the files that are actually in my system. Could I use pacman for that? I mean, it does know when a file owned by a package is different in the system (so it generates pacnew files). How would I do that? This was not very helpful...


Has this been done before by someone else? Are there tools to help me in this quest? Am I forgeting something?
Thanks!

Last edited by vitoreiji (2011-12-17 04:38:44)

Offline

#2 2011-12-12 19:55:00

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

Re: [SOLVED] System wide diff?

pacman only generates pacsave files for the packages included in the backup array.
http://projects.archlinux.org/svntogit/ … ges/pacman

backup=(etc/pacman.conf etc/makepkg.conf)

Changes done to other files will be lost because pacman will just overwrite these files on update but until there's an update available the edits are "cloaked".


I think it's enough if you just compare the configs.

Last edited by karol (2011-12-12 20:00:46)

Offline

#3 2011-12-12 20:10:42

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: [SOLVED] System wide diff?

karol wrote:

pacman only generates pacsave files for the packages included in the backup array.

Even so, knowing which of the backup files have been edited might be useful. Can it be done?

Edit: Yes it can.

Theoretically you could reinstall all packages and have pacman throw a notice on this event (if pacman did such a thing):

original=X, current=Y, new=X
Both package versions contain the exact same file, but the one on
the filesystem has been modified. Leave the current file in place.
karol wrote:

I think it's enough if you just compare the configs.

How would you do that?

Last edited by Lars Stokholm (2012-01-21 19:49:40)

Offline

#4 2011-12-12 20:13:27

vitoreiji
Member
Registered: 2009-09-04
Posts: 67

Re: [SOLVED] System wide diff?

karol wrote:

pacman only generates pacsave files for the packages included in the backup array.

I didn't know this was true to pacnew files as well.
I guess I'll have to write a script to unpack all of my cached packages and diff all the files then...

Offline

#5 2011-12-12 20:29:39

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

Re: [SOLVED] System wide diff?

You should have a backup of your important files, like your configs. Simply diff them against the stock configs anyway you like (using vimdiff, meld etc.).

IMHO it's easier to make notes about what do you alter and why as you go e.g. custom compiled packages, configs, unofficial repos.

Offline

#6 2011-12-12 20:35:41

vitoreiji
Member
Registered: 2009-09-04
Posts: 67

Re: [SOLVED] System wide diff?

karol wrote:

You should have a backup of your important files, like your configs. Simply diff them against the stock configs anyway you like (using vimdiff, meld etc.).

The main trouble is I'm not sure what is important and what is not. That's why I was looking to cover all bases.

karol wrote:

IMHO it's easier to make notes about what do you alter and why as you go e.g. custom compiled packages, configs, unofficial repos.

I agree, and I did take some notes about some stuff I did in the old system, but I'm not sure if I documented everything. I was sloppy and now I'm suffering the consequences sad

Offline

#7 2011-12-12 20:54:06

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

Re: [SOLVED] System wide diff?

vitoreiji wrote:
karol wrote:

You should have a backup of your important files, like your configs. Simply diff them against the stock configs anyway you like (using vimdiff, meld etc.).

The main trouble is I'm not sure what is important and what is not. That's why I was looking to cover all bases.

Not sure I understand, every setting should do something. Only you can answer the questions like "Do I need it?" or "Do I like how it's working right now or do I want to change it?".
I have some makepkg config and I should know why e.g. do I have PKGEXT set to '.pkg.tar':

[karol@black ~]$ tail /etc/makepkg.conf
#
# WARNING: Do NOT modify these variables unless you know what you are
#          doing.
#
#PKGEXT='.pkg.tar.xz'
PKGEXT='.pkg.tar'
#PKGEXT='.pkg.tar.gz'
SRCEXT='.src.tar.gz'

# vim: set ft=sh ts=2 sw=2 et:

I think it's a good idea to comment things out instead of removing them altogether, especially if you're switching settings or trying them out.


Another example: Arch does not provide any config for vim, so I try to comment every non-trivial setting I put there.


You can start your new install by asking yourself do you need all those apps - maybe you can remove some packages you no longer use.

Offline

#8 2011-12-12 20:56:15

Awebb
Member
Registered: 2010-05-06
Posts: 6,286

Re: [SOLVED] System wide diff?

Don't diff, use a checksum. Compare the old checksum to the new (use find or something like that in a bash script) and if it's not the same, copy over the backup file.

Offline

#9 2011-12-12 20:57:43

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

Re: [SOLVED] System wide diff?

Awebb wrote:

Don't diff, use a checksum. Compare the old checksum to the new (use find or something like that in a bash script) and if it's not the same, copy over the backup file.

rsync?

Offline

#10 2011-12-12 21:16:30

vitoreiji
Member
Registered: 2009-09-04
Posts: 67

Re: [SOLVED] System wide diff?

karol wrote:

I think it's a good idea to comment things out instead of removing them altogether, especially if you're switching settings or trying them out.

I agree, but my point is that I'm not sure which files on my system have non-standard things (with or without comments).

karol wrote:

You can start your new install by asking yourself do you need all those apps - maybe you can remove some packages you no longer use.

That I am doing smile

Awebb wrote:

Don't diff, use a checksum. Compare the old checksum to the new (use find or something like that in a bash script) and if it's not the same, copy over the backup file.

Good idea, thanks!

And karol, rsync would copy things without telling me how they are different, right? Not really what I had in mind...

Offline

#11 2011-12-16 23:25:30

vitoreiji
Member
Registered: 2009-09-04
Posts: 67

Re: [SOLVED] System wide diff?

I filed a feature request to make this kind of task easier, enabling the user to tell pacman to store the md5sums of every file in every package, and no just the ones in the backup array.

Offline

#12 2011-12-16 23:40:25

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

Re: [SOLVED] System wide diff?

Why include it in pacman? There already are many applications that find duplicates and if you keep track of changes you make, that's a no-issue at all.

Pacman does not track user-created files, such as configs so your feature request won't help you much.

Offline

#13 2011-12-17 00:38:54

vitoreiji
Member
Registered: 2009-09-04
Posts: 67

Re: [SOLVED] System wide diff?

karol wrote:

Why include it in pacman? There already are many applications that find duplicates and if you keep track of changes you make, that's a no-issue at all.

Duplicates? What do you  mean?

karol wrote:

Pacman does not track user-created files, such as configs so your feature request won't help you much.

I know pacman doesn't keep track of user-created files, and that a lot of configs are user-created, but there are also configs and other things that have been done in files that do belong to packages, these are the ones I am looking for.
The user-created files I can easily find with the aforementioned pacman tip.

Offline

#14 2011-12-17 00:48:59

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

Re: [SOLVED] System wide diff?

vitoreiji wrote:
karol wrote:

Why include it in pacman? There already are many applications that find duplicates and if you keep track of changes you make, that's a no-issue at all.

Duplicates? What do you  mean?

If you have the stock packages and the potentially modified ones, running a program that finds duplicates (based on size, checksum or whatever) will produce a list of files that were not modified. Files present in these packages that are not on this list are different so they were modified.

Offline

#15 2011-12-17 04:38:01

vitoreiji
Member
Registered: 2009-09-04
Posts: 67

Re: [SOLVED] System wide diff?

karol wrote:

If you have the stock packages and the potentially modified ones, running a program that finds duplicates (based on size, checksum or whatever) will produce a list of files that were not modified. Files present in these packages that are not on this list are different so they were modified.

That's interesting. I would look into that, but...

Turns ou my feature request was a duplicate of this one, and although this feature is scheduled to come in pacman 4.1.0, in the coments this post was linked and it contains exactly what I need.

Well, that's it then, I'm marking this as solved.

Thank you, karol, for your patience and advice, you have been very helpful!

Offline

Board footer

Powered by FluxBB