You are not logged in.

#1 2006-03-23 19:18:10

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

show new orphans after uninstalling

Hello !

I wrote a little script to show new orphans after pacman -R:
http://archiwain.free.fr/os/i686/pacremove/pacremove

exemple:

# pacremove -Rcs grisbi
removing grisbi... done.
This packages are no longer used and can be removed:
libofx

Then I can manually remove "libofx" if I want smile
This is usefull for manually installed depends for aur's packages (with aurbuild or qpkg).

Maybe this little function could be added in pacman ? roll

Offline

#2 2006-03-23 20:07:45

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: show new orphans after uninstalling

Nice.  This is something I was just thinking about yesterday.

Offline

#3 2006-03-23 20:17:03

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: show new orphans after uninstalling

wain:

E-Mail the script to Judd!


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#4 2006-03-23 20:39:26

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: show new orphans after uninstalling

You know, to remove orphans with an uninstalled package you can use the '-s' option.

Offline

#5 2006-03-23 21:26:57

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: show new orphans after uninstalling

Gullible Jones wrote:

You know, to remove orphans with an uninstalled package you can use the '-s' option.

pacman -Rcs doesn't remove explicitly installed packages  roll

Offline

#6 2006-03-23 21:41:16

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: show new orphans after uninstalling

Yup, right you are... Sorry, I didn't take that into account.

Offline

#7 2006-03-24 06:59:12

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: show new orphans after uninstalling

Is your host down?  I came back to my arch machine just to get a timed out connection.

Offline

#8 2006-03-24 07:23:05

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: show new orphans after uninstalling

it seems to work.

#!/bin/bash
# wain@gmx.net
# pacremove is a pacman's wrapper that can look for orphans after removing packages
BEFORE=/tmp/before.$$
AFTER=/tmp/after.$$
VERSION='0.1.0'

if (( $# < 2 ))
then
cat << EOF
pacremove version $VERSION
usage:  pacremove {-R --remove} [options] <package>
options:
  -c, --cascade       remove packages and all packages that depend on them
  -d, --nodeps        skip dependency checks
  -k, --dbonly        only remove database entry, do not remove files
  -n, --nosave        remove configuration files as well
  -s, --recursive     remove dependencies also (that won't break packages)
      --config <path> set an alternate configuration file
      --noconfirm     do not ask for any confirmation
      --noprogressbar do not show a progress bar when downloading files
  -v, --verbose       be verbose
  -r, --root <path>   set an alternate installation root
  -b, --dbpath <path> set an alternate database locationthen
EOF
exit 0
fi

# search orphans before removing
pacman -Qe | awk '{print $1}' > $BEFORE

# remove with pacman
pacman $@

# search orphans after removing
pacman -Qe | awk '{print $1}' > $AFTER

# show new orphans
neworphans=$(comm -1 -3 $BEFORE $AFTER)
[ ! -z $neworphans ] && { echo "This packages are no longer used and can be removed:"; echo $neworphans; }

# remove tmp files
rm $BEFORE $AFTER

exit 0

Offline

#9 2006-04-06 18:25:52

Galdona
Member
Registered: 2006-03-15
Posts: 196

Re: show new orphans after uninstalling

thanks for the script  big_smile

Offline

#10 2007-01-29 18:21:46

ro0x
Member
From: Santiago, Chile
Registered: 2004-06-20
Posts: 79

Re: show new orphans after uninstalling

nice feature! I want to see in pacman!

Offline

#11 2007-01-29 18:30:38

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

Re: show new orphans after uninstalling

Please send this script to the pacman-dev mailing list (for credit and discussion).

Offline

#12 2007-01-29 23:00:30

wain
Member
From: France
Registered: 2005-05-01
Posts: 289
Website

Re: show new orphans after uninstalling

ro0x wrote:

nice feature! I want to see in pacman!

Thanks,
This function is included in yaourt cool
The goal of yaourt is to

The goal of yaourt is to add all the things which I miss in pacman like AUR support, manage .pacsave/.pacnew files, clean database etc...
Free with the developers to re-use some yaourt's code in pacman (it's GPL) cool

Offline

#13 2007-02-01 23:48:33

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

Re: show new orphans after uninstalling

phrakture wrote:

Please send this script to the pacman-dev mailing list (for credit and discussion).

It seems I missed it. Was it included in pacman3?


to live is to die

Offline

Board footer

Powered by FluxBB