You are not logged in.

#1 2015-04-12 21:56:45

komitaltrade
Member
Registered: 2015-04-12
Posts: 8

Package list install script help

Please help about the script to launch (custom) package list (e.g. 'packlist') with "commented" (#) ("disabled) packages and "uncomented" (allowed to install) packages (all of them with description.

I need something simple like

pacman -S --needed $(comm -12 <(pacman -Slq|sort) <(sort packlist) )

except that above don't alow any sort of "comments" and/or descriptions (of packages) in "packlist".

Offline

#2 2015-04-12 22:17:43

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Package list install script help

Perhaps use sed or grep to filter out the comments.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2015-04-12 23:09:38

komitaltrade
Member
Registered: 2015-04-12
Posts: 8

Re: Package list install script help

fsckd wrote:

Perhaps use sed or grep to filter out the comments.

Thanks for reply, but how it should to be (look) in my example? ("pacman -S --needed $(comm -12 <(pacman -Slq|sort) <(sort packlist) )")

To explain, I need all listed options (e.g sort order is important, as well as to skip already installed packages).

Offline

#4 2015-04-13 00:23:12

komitaltrade
Member
Registered: 2015-04-12
Posts: 8

Re: Package list install script help

Maybe this wil help.

List with comments looks something like this, but I want to install just gwenview and kdegraphics-kamera

##############################################################

#:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
#:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
#:: :: :: :: :: :: :: :: :: KDEGraphics :: :: :: :: :: :: :: ::
#:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::
#:: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::

##############################################################

gwenview # A fast and easy to use image viewer for KDE.
kdegraphics-kamera # Configure Kamera.
#kdegraphics-kolourpaint # Paint Program
#kdegraphics-kruler # Screen Ruler
#kdegraphics-ksnapshot # Screen Capture Program

Offline

#5 2015-04-13 00:33:19

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Package list install script help

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Fo … s_and_code


awk '!/^#/ {print $1}' file
gwenview
kdegraphics-kamera

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2015-04-13 00:39:48

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

Re: Package list install script help

It prints empty lines too. pacman doesn't seem to mind, but

awk '!/^#|^$/ {print $1}' file

takes care of it.

Offline

#7 2015-04-13 00:46:29

komitaltrade
Member
Registered: 2015-04-12
Posts: 8

Re: Package list install script help

jasonwryan wrote:

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Fo … s_and_code

Sorry

Offline

#8 2015-04-13 00:53:05

komitaltrade
Member
Registered: 2015-04-12
Posts: 8

Re: Package list install script help

karol wrote:

It prints empty lines too. pacman doesn't seem to mind, but

awk '!/^#|^$/ {print $1}' file

takes care of it.

THANKS!!!

P.S. One more question. What options to add to print (create) such "clean" list in new file?

Offline

#9 2015-04-13 00:57:45

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Package list install script help

awk '!/^#|^$/ {print $1}' file > newfile

Moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2015-04-13 00:59:00

komitaltrade
Member
Registered: 2015-04-12
Posts: 8

Re: Package list install script help

Install will be

pacman -S $(awk '!/^#|^$/ {print $1}' file)

But I ask for new file.

Offline

#11 2015-04-13 01:00:21

komitaltrade
Member
Registered: 2015-04-12
Posts: 8

Re: Package list install script help

jasonwryan wrote:
awk '!/^#|^$/ {print $1}' file > newfile

Moving to NC...

Thanks. Closed topic.

Offline

#12 2015-04-13 01:01:35

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Package list install script help

pacman -S $(awk '!/^#|^$/ {print $1}' file)
awk '!/^#|^$/ {print $1}' file > newfile

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#13 2015-04-13 01:57:08

komitaltrade
Member
Registered: 2015-04-12
Posts: 8

Re: Package list install script help

jasonwryan wrote:
pacman -S $(awk '!/^#|^$/ {print $1}' file)

That is nice, but when you already "pulled it on table", another question:

How to include in your code also this command options for pacman (from begin of topic)

pacman -S --needed $(comm -12 <(pacman -Slq|sort) <(sort file) )

Offline

#14 2015-04-13 21:51:41

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

Re: Package list install script help

You don't need one command. You can first parse the package list and then run pacman on that list:

awk '!/^#|^$/ {print $1}' file > newfile
pacman -S --needed $(comm -12 <(pacman -Slq|sort) <(sort newfile))

Offline

Board footer

Powered by FluxBB