You are not logged in.

#1 2007-09-22 10:22:10

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Determine if file is %BACKUP%

Is there any way to know if a file will be overwritten when the package it belongs to is synced?
For now, the simplest solution I've found is to look at "/var/lib/pacman/local/<packagename>/files", but I would really appreciate if pacman could do this (like the way it can check for which package a file belongs to, and list what files belongs to a package etc...).

Thanks for any reply. smile

Offline

#2 2007-09-26 14:41:24

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Determine if file is %BACKUP%

Oh, come on, anyone! yikes

Just a "AFAIK, that is the only solution" reply would be enough... hmm

Offline

#3 2007-09-26 14:45:58

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Determine if file is %BACKUP%

In the common case, you can just do : pacman -Qii <package> and it'll show you the files in BACKUP for the current version of the package.

In the particular case where the file has just been added to the backup array of the new package, it won't show up in pacman -Qii (since this queries the old package), but the file still shouldn't be overwritten during the upgrade.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#4 2007-09-26 16:13:16

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Determine if file is %BACKUP%

Interestingly, -Qii doesn't seem to be documented anywhere. It used to be in pacman -Qh. I'd have to check if that's a known issue.

OT: 1311219, impatience may work for you elsewhere, but it's not particularly appreciated here. If nobody answers your question, just wait, or ask somewhere else e.g. mailing list, IRC, etc.

Offline

#5 2007-09-26 16:52:52

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Determine if file is %BACKUP%

Hmm, apparently there was indeed something in pacman 2, but apparently it wasn't explicit, and even confused an user :
http://bugs.archlinux.org/task/1609

But thinking about it, even though -Qii currently only adds the list of backup files, I guess it could be used for other additional informations in the future.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#6 2007-09-26 17:07:45

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Determine if file is %BACKUP%

I proposed the following patch :

---
 doc/pacman.8.txt    |    4 +++-
 src/pacman/pacman.c |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt
index f6fee7b..9be6b8d 100644
--- a/doc/pacman.8.txt
+++ b/doc/pacman.8.txt
@@ -157,7 +157,9 @@ Query Options[[QO]]
 
 *-i, \--info*::
     Display information on a given package. The '-p' option can be used if
-    querying a package file instead of the local database.
+    querying a package file instead of the local database. Passing two
+    '\--info' or '-i' flags will also display the list of backup files and
+    their modification states.
 
 *-l, \--list*::
     List all files owned by a given package. Multiple packages can be
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index aa12826..24c7ef8 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -113,7 +113,7 @@ static void usage(int op, char *myname)
             printf(_("  -d, --deps           list all packages installed as dependencies\n"));
             printf(_("  -e, --explicit       list all packages explicitly installed\n"));
             printf(_("  -g, --groups         view all members of a package group\n"));
-            printf(_("  -i, --info           view package information\n"));
+            printf(_("  -i, --info           view package information (-ii for backup files)\n"));
             printf(_("  -l, --list           list the contents of the queried package\n"));
             printf(_("  -m, --foreign        list installed packages not found in sync db(s)\n"));
             printf(_("  -o, --owns <file>    query the package that owns <file>\n"));
-- 
1.5.3.2

pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#7 2007-09-28 17:59:29

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Determine if file is %BACKUP%

thanks, shining, that solved everything! big_smile


OT: tomk: I usually ignore that kind of replies, since I mostly agree, but I feel that I should clarify the reason for this doublepost: I have been waiting for a reply to the first question I asked on this forum (link) for a long time now (back in those days I was extremely afraid of making those kinds of mistakes, and didn't even know it was possible to delete posts myself, and asked if a mod could move the topic tongue ). After that time, I started to realize that all questions on this forums won't be answered, so I find it acceptable if people do a revival post in order to bring a (usually quickly answered) question to an end. (note: I'm not trying to completely justifying the doublepost, just explaining why I did it (plus I was quite tired when deciding to post, after working on to much coding smile ))

I'm not using IRC so much, but I really appreciate your recommendation of it, and will look into using that for simpler questions wink

Offline

Board footer

Powered by FluxBB