You are not logged in.

#1 2006-05-09 10:07:56

hussam
Member
Registered: 2006-03-26
Posts: 572
Website

locally installed packages

Is there anyway to list packages that are installed but are not in the archlinux repositories?
Say I built some arch packages and installed them and I forgot what the packages were. Or if some package is removed from the repository.
How would I know which are local?

Offline

#2 2006-05-09 10:39:42

syd
Member
From: Auckland, NZ
Registered: 2006-01-22
Posts: 155

Re: locally installed packages

You cant to my knowledge tell where they have been installed from.
Unless you dont clear you /var/cache/pacman dir. Then you know which ones you have downloaded from the net.

I keep all the pkgbuild i make my self in my documents and then cvs most other stuff i need.

Offline

#3 2006-05-09 10:57:51

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

Re: locally installed packages

Here's a quick-n-dirty bash thing:

for pkg in `pacman -Q | cut -d " " -f 1` ; do pacman -Si $pkg 1>/dev/null ; done

That will list all your non-repo packages like this:

Package "foo" was not found.
Package "bar" was not found.
etc ......

Offline

#4 2006-05-09 12:30:40

jaboua
Member
Registered: 2005-11-05
Posts: 634

Re: locally installed packages

You can also try looking through the package names in /var/cache/pacman/src/ - IIRC they won't be removed at a clean of pacman cache. But note that it will also include packages that you have removed...

Offline

#5 2006-05-12 01:51:42

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: locally installed packages

hussam wrote:

Is there anyway to list packages that are installed but are not in the archlinux repositories?

pacman -Qm

Offline

#6 2006-05-12 06:47:38

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

Re: locally installed packages

Jeez! roll Thanks Penguin!

Even after nearly two years on Arch, I still need to follow the advice I often give to others:

man pacman

Offline

#7 2006-05-12 07:07:47

_Gandalf_
Member
Registered: 2006-01-12
Posts: 735

Re: locally installed packages

Exactly !
in this case use tomk trick, so it's slower but gives u what u are seeking

Offline

#8 2006-05-12 14:43:47

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: locally installed packages

-Qm must be new, at least I didn't see it when I read the manpage the last time.

Offline

#9 2006-05-12 21:58:51

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: locally installed packages

brain0 wrote:

-Qm must be new, at least I didn't see it when I read the manpage the last time.

yeah VMikos or whatever his name is from Frugalware was responsible for that. I too have noticed it doesn't display all foreign packages -for me it misses xarchive.
I'm not sure if there is a bug report about it but it may be a good idea to bring it to their attention before pacman3 is released.

Offline

#10 2006-05-13 11:21:02

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

Re: locally installed packages

for xarchive, it makes sense, because there is xarchiver in community.
And the comparison that is done is :
strstr("xarchiver", "xarchive") which returns not null since xarchive is in xarchiver. (quite easy to fix).
But for opera-devel and other svn packages, I don't see why it doesn't work. So I just tried to install opera-devel from aur, and it's correctly listed by pacman -Qm

What about locally updated packages (for example, when you add a patch to a package, and bump the revision) ?
hmm well, these ones are already displayed by pacman -Su :
:: pacman: local (2.9.8-2) appears to be newer than repo (current/2.9.8-1)
but, well they aren't part of archlinux repo, so maybe they should be displayed by pacman -Qm too ?

If anyone could explain pholie problem.. I don't see what provide has to do with it (in the code), but I'll check again.


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

Offline

#11 2006-05-13 16:09:46

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

Re: locally installed packages

ha ok smile it's better now.
So here is a little fix for a stricter string comparison :

--- pacman-2.9.8/src/pacman.c.ori       2006-05-10 20:58:27.000000000 +0200
+++ pacman-2.9.8/src/pacman.c   2006-05-13 14:10:07.000000000 +0200
@@ -2648,10 +2648,8 @@                                          
                                                                char *haystack;
                                                                char *needle;
                                                                haystack = strdup(pkg->name);
-                                                               strtoupper(haystack);
                                                                needle = strdup(info->name);
-                                                               strtoupper(needle);
-                                                               if(strstr(haystack, needle)) {
+                                                               if(strlen(haystack) == strlen(needle) && strstr(haystack, needle)) {                                                     
                                                                        match = 1;
                                                                }
                                                                FREE(haystack);
@@ -2740,10 +2738,8 @@                          
                                                char *haystack;
                                                char *needle;
                                                haystack = strdup(pkg->name);
-                                               strtoupper(haystack);
                                                needle = strdup(info->name);
-                                               strtoupper(needle);
-                                               if(strstr(haystack, needle)) {
+                                               if(strlen(haystack) == strlen(needle) && strstr(haystack, needle)) {                                                     
                                                        match = 1;
                                                }
                                                FREE(haystack);

I just compare the length on the name first. And I removed the strtoupper since I don't think it should be done, but I could be wrong.
Every package should be in lowercase anyway..


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

Offline

Board footer

Powered by FluxBB