You are not logged in.

#51 2007-05-14 07:16:16

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: Pacman 3: Ready To Move

I just upgraded over the weekend. I installed the missing dependencies first (pacman -S fakeroot blabla) and then ran pacman -Syu and everything went like a charm! After I'd rebooted I wasn't even sure things were upgraded: everything behaved the same! smile

Kudos to everybody involved on pacman3!


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#52 2007-05-15 03:33:30

wroot
Member
Registered: 2005-02-22
Posts: 26

Re: Pacman 3: Ready To Move

Just to mention of those "who arent aware of this". I'm the one of them. Checking arch page and forums rarely. So last friday i tried to do pacman -Syu and it said newer version of pacman is available. But i couldnt upgrade it because of dependencies. So i ran pacman -Syu again and press No for pacman upgrade. And everything went fine. So i didnt need to go to forums at all smile

Offline

#53 2007-05-15 10:27:07

anakin
Member
From: Portugal
Registered: 2006-09-11
Posts: 85
Website

Re: Pacman 3: Ready To Move

Just came back from two weeks holiday straight to the forum. Did a pacman -Sy pacman followed by pacman -Syu and sat there watching the brand new pacman 3 flawlessly updating all the packages which had gone out of sync while I was gone. By the way, pacman 3 is really damn fast.


www.geekslot.com - a place where peculiar people fit

Offline

#54 2007-05-16 11:46:56

Bebo
Member
From: Göteborg, Sweden
Registered: 2006-06-07
Posts: 207

Re: Pacman 3: Ready To Move

Not sure if I should start a new thread for this question. I do cleanups every now and then, and remove stuff that I don't use. Now with the "-Qe" behaviour being changed, how do I list all explicitly installed packages, i.e. those that were not pulled in as dependencies? (IMVHO, it would've been better to keep the old -Qe behaviour (e as in explicit), and make a new option that works as -Qe do now (search for orphans).)

Offline

#55 2007-05-16 13:03:42

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: Pacman 3: Ready To Move

Bebo wrote:

Not sure if I should start a new thread for this question. I do cleanups every now and then, and remove stuff that I don't use. Now with the "-Qe" behaviour being changed, how do I list all explicitly installed packages, i.e. those that were not pulled in as dependencies? (IMVHO, it would've been better to keep the old -Qe behaviour (e as in explicit), and make a new option that works as -Qe do now (search for orphans).)

I agree, this is functionality I want.

Offline

#56 2007-05-16 13:48:06

Romashka
Forum Fellow
Registered: 2005-12-07
Posts: 1,054

Re: Pacman 3: Ready To Move

Bebo wrote:

Not sure if I should start a new thread for this question. I do cleanups every now and then, and remove stuff that I don't use. Now with the "-Qe" behaviour being changed, how do I list all explicitly installed packages, i.e. those that were not pulled in as dependencies? (IMVHO, it would've been better to keep the old -Qe behaviour (e as in explicit), and make a new option that works as -Qe do now (search for orphans).)

find /var/lib/pacman/local/*/desc | xargs grep -L %REASON% | cut -d / -f 6

wink


to live is to die

Offline

#57 2007-05-16 14:15:33

anakin
Member
From: Portugal
Registered: 2006-09-11
Posts: 85
Website

Re: Pacman 3: Ready To Move

I was figuring a way myself before I saw Romashka's. Much harder on the cpu, neverthless by some reason it's outputting what seems a more accurate list.

for i in $( pacman -Q | cut -d ' ' -f 1 ); do pacman -Qi $i | grep -B 16 -i '^install.*explicitly' | grep -i '^name' | cut -d : -f 2; done

www.geekslot.com - a place where peculiar people fit

Offline

#58 2007-05-16 16:48:05

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

Re: Pacman 3: Ready To Move

anakin wrote:

I was figuring a way myself before I saw Romashka's. Much harder on the cpu, neverthless by some reason it's outputting what seems a more accurate list.

for i in $( pacman -Q | cut -d ' ' -f 1 ); do pacman -Qi $i | grep -B 16 -i '^install.*explicitly' | grep -i '^name' | cut -d : -f 2; done

hmm, I don't understand why that -B 16 hack, and grep name after, while you already have it : $i
16 wasn't high enough for some packages here, but anyway, it's unnecessary :

for i in $( pacman -Q | cut -d ' ' -f 1 ); do (LANG=C pacman -Qi $i | grep -i '^install.*explicitly') &> /dev/null && echo $i; done

Also, pacman -Q looks in /var/lib/pacman/local anyway, so you can always get the same result by looking there directly, like Romashka said.
Though, his version outputs only the packages that doesn't contain %REASON%, while pacman -Qi reports a package is explicitly installed when either REASON is missing, or REASON section contains 0. So that complicates the script.
I didn't find a short way to do this in one line script, so here is a verbose version smile

#!/bin/sh
for i in /var/lib/pacman/local/*/desc; do 
  bla=`grep -A1 %REASON% $i | tail -n1`
  if [ -z "$bla" -o "$bla" = "0" ]; then
    echo $i | cut -d'/' -f6 | sed 's/-[^-]*-[^-]*$//'; 
  fi
done

Or you could do in 2 steps, first with Romashka's version for finding the packages without %REASON%, then a similar one for finding the ones with reason set to 0 :

find /var/lib/pacman/local/*/desc | xargs grep -L %REASON% | cut -d / -f 6 | sed 's/-[^-]*-[^-]*$//'
find /var/lib/pacman/local/*/desc | xargs grep -A1 %REASON% |grep -e '-0$' | cut -d / -f 6 | sed 's/-[^-]*-[^-]*$//'

That's by far the quickest, I'm not sure why, it looks at each package twice, while the above ones do it only once.

Last edited by shining (2007-05-16 17:00:22)


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

Offline

#59 2007-05-16 17:28:41

Bebo
Member
From: Göteborg, Sweden
Registered: 2006-06-07
Posts: 207

Re: Pacman 3: Ready To Move

Yes, I believe shining's for loop solution imitates what pacman -Qe did previously. I really do appreciate the new pacman, and the work on it, but to me it seems a bit, er, counterproductive to replace one need for scripting (finding "real" orphans) with another (finding explicitly installed packages), especially when the latter was implemented before.

Offline

#60 2007-05-16 17:56:35

anakin
Member
From: Portugal
Registered: 2006-09-11
Posts: 85
Website

Re: Pacman 3: Ready To Move

shining wrote:

hmm, I don't understand why that -B 16 hack, and grep name after, while you already have it : $i
16 wasn't high enough for some packages here, but anyway, it's unnecessary :

You're right... I did it in a hurry. Your final version looks good, though as you mentioned the best approach is obviously reading the database directly. Again I did it while on the phone and didn't had the time to go through the database format, just wanted to help Bebo quickly.

Last edited by anakin (2007-05-16 18:20:48)


www.geekslot.com - a place where peculiar people fit

Offline

#61 2007-05-17 05:31:35

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Pacman 3: Ready To Move

Please add a feature request to the bug tracker if you want this functionality back.  The reason it was changed is that it was supposed to list "orphans" but did something else.

Offline

#62 2007-05-17 08:46:33

Bebo
Member
From: Göteborg, Sweden
Registered: 2006-06-07
Posts: 207

Re: Pacman 3: Ready To Move

Yes, I've read the discussions on that. Somehow it seems to me that people were confused with the long option name, --orphan, as compared to the short option name, -e, and the description of the action.

Okay, I'll see if I can make a feature request of it (should've thought of that at once, instead of whining here...). I've realized that I have to think it through a bit more, though. Maybe it was only _almost_ doing what I wanted...

Anyway, thanks for all the responses smile

Offline

#63 2007-05-19 12:01:17

Romashka
Forum Fellow
Registered: 2005-12-07
Posts: 1,054

Re: Pacman 3: Ready To Move

phrakture wrote:

Please add a feature request to the bug tracker if you want this functionality back.  The reason it was changed is that it was supposed to list "orphans" but did something else.

Someone reported it here: http://bugs.archlinux.org/task/7208


to live is to die

Offline

#64 2007-05-19 13:04:38

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

Re: Pacman 3: Ready To Move

erm, I'm just realizing, what does listing all explicitly installed packages have to do with orphans ?
All scripts above show all explicitly installed packages, not only orphans.
I think the bug report makes more sense :
"I'd like to request for a Pacman Query functionality that lists all packages (explicitly installed or installed as a dep) that are not required by any other package."
So, I wrote a 2 lines patch that makes pacman -Qee list all orphans. (which was the old -Qe behavior I guess)
pacman -Qe behavior is kept (list orphans installed as dep).
I'm attaching it to the bug report.


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

Offline

#65 2007-05-19 13:19:51

Bebo
Member
From: Göteborg, Sweden
Registered: 2006-06-07
Posts: 207

Re: Pacman 3: Ready To Move

Romashka wrote:

Someone reported it here: http://bugs.archlinux.org/task/7208

Great! After pondering what I was after, that FR fits perfectly. "Explicitly" installed packages aren't that interesting, but the "top of the food chain" packages are, i.e. those that no other package depend on.

Offline

#66 2007-05-23 07:17:31

akrito
Member
Registered: 2006-09-29
Posts: 10

Re: Pacman 3: Ready To Move

Until this feature hits current, here's what I use to find packages that no others depend on:

#!/bin/sh
for i in /var/lib/pacman/local/*; do
    test `sed -n '/%REQUIREDBY%/ {n; p}' $i/depends` || sed -n '/%NAME%/ {n; p}' $i/desc
done

Offline

Board footer

Powered by FluxBB