You are not logged in.

#1 2007-10-18 07:51:16

bsdson.tw
Member
From: Taiwan
Registered: 2005-05-06
Posts: 161

List packages not required by any one

This script is based on the discussion
http://bbs.archlinux.org/viewtopic.php?id=2010

and slightly modified:

#!/bin/bash

# arg[1] = -c | -v
# -c : compact output
# only package name
# -v : verbose output
# name, url, install date, desc
#
# version=2
# date=16:00 10/11/2007
# author=Henry Lee (bsdson.tw)
#

skip="pacNoReq.skip"

echo "date=$(date)"
echo

for pkgName in $(pacman -Qi | cut -d " " -f 1); do

    grep -q $pkgName $skip >& /dev/null
    if [ 0 -eq $? ]; then
        :

    else
        tmp=$(pacman -Qi $pkgName)

        echo "$tmp" | grep -q "^Required By \+: None$"
        if [ 0 -eq $? ]; then
            if [ -z "$1" ]; then
                echo "$tmp" | grep "\(Name\|Descript\)"

            elif [ "-c" = "$1" ]; then
                echo "$tmp" | grep "Name"

            elif [ "-v" = "$1" ]; then
                echo "$tmp" | grep "\(Name\|URL\|Install Date\|Description\)"
            fi

            echo
        fi
    fi
done

Offline

#2 2007-10-18 08:08:39

Pierre
Developer
From: Bonn
Registered: 2004-07-05
Posts: 1,964
Website

Re: List packages not required by any one

What do you think about "pacman -Qe"?

Offline

#3 2007-10-18 13:16:00

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: List packages not required by any one

pacman -Qe is considerably different from before after pacman 3, so that script is quite useful.


1000

Offline

#4 2007-10-18 19:03:10

kumico
Member
Registered: 2007-09-28
Posts: 224
Website

Re: List packages not required by any one

byte wrote:

pacman -Qe is considerably different from before after pacman 3, so that script is quite useful.

i don't understand this statement, i though pacman2 was/is soon to be incompatible with the current repo structure [1]http://www.archlinux.org/news/345/

Offline

#5 2007-10-18 20:45:21

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: List packages not required by any one

This shouldn't be necessary soon...changes have already been committed in to pacman to add more flexibility without scripts: Feature Request - pacman -Q options

Offline

Board footer

Powered by FluxBB