You are not logged in.

#1 2005-05-19 19:23:12

firedance
Member
From: Stockholm, Sweden
Registered: 2005-04-18
Posts: 131

Download all from -Ss

I want to download all the results when i do a search, is this possible?

Offline

#2 2005-05-19 19:46:46

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

Re: Download all from -Ss

errm.... why do you want to do that?  sometimes when you want to do something, and it's not readilly available, it's because there's a different way to accomplish the same thing...

can you explain why you need this?

it'd probably require some small script to do something like that

Offline

#3 2005-05-19 19:55:27

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: Download all from -Ss

Warning: these commands are only on one line each

Note:
1. must be run as root
2. replace "pacman -Sw" with "pacman -Sy" to install the packages. "pacman -Sw" only downloads the packages.
3. Replace string by what you're looking for. Note that there are 2 positions where STRING must be replaced in the first example.


The following lines installs all packages with STRING in their name.

pacman -Ss STRING | grep "/.* [0-9]..*-*." | grep "STRING" |
sed -e "s/^.*///g" | sed -e "s/ .*$//g" | while read p; do yes | pacman -Sw $p ; done 

The following line installs all files which have STRING in their name OR description.

pacman -Ss STRING | grep "/.* [0-9]..*-*." | sed -e "s/^.*///g" | sed -e "s/ .*$//g" |
while read p; do yes | pacman -Sw $p ; done 

---

Or.. maybe you're looking for groups. Use

pacman -Sg

to list all the available groups.

Offline

#4 2005-05-19 20:06:11

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Download all from -Ss

#!/bin/sh

p=`pacman -Ss $* | sed -e 's/^ .*//' -e 's|.*/||' -e 's/ .*//'`
echo $p
pacman -S $p

Just give the thing you want to search for as parameter and happy installing.

Offline

#5 2005-05-19 20:14:10

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: Download all from -Ss

Oh... haven't seen multiple seds in one line by now.
Good to know that. Thanks i3839.

Offline

#6 2005-05-19 20:20:40

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Download all from -Ss

Ah silly of me, it can be simpler:

#!/bin/sh

p=`pacman -Ss $* | sed -e 's/ .*//' -e 's|.*/||'`
echo $p
pacman -S $p

Offline

#7 2005-05-19 22:05:31

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

Re: Download all from -Ss

i3839 wrote:

Ah silly of me, it can be simpler:

#!/bin/sh

p=`pacman -Ss $* | sed -e 's/ .*//' -e 's|.*/||'`
echo $p
pacman -S $p

I think Penguin put it best when he said "sed '\//////lookslike/ateepee'"

Offline

#8 2005-05-19 22:35:39

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Download all from -Ss

phrakture wrote:

I think Penguin put it best when he said "sed '\//////lookslike/ateepee'"

Only if you want...

#!/bin/sh

p=`pacman -Ss $* | sed -e 'ss .*ss' -e 'ss.*/ss'`
echo $p
pacman -S $p

Offline

#9 2005-05-19 22:46:37

firedance
Member
From: Stockholm, Sweden
Registered: 2005-04-18
Posts: 131

Re: Download all from -Ss

Thanks guys!

Offline

Board footer

Powered by FluxBB