updated on Sat Jan 14 12:12:45 UTC 2012
[aur-mirror.git] / pacorder / pacorder
blob2d25b69d0c93797c94ff10d0ddfb241e6230d391
1 #!/bin/sh
2 #~ script wrote by <xavi@netsons.org> and <ech0s7@netsons.org>
3 #~
4 #~ This program is free software: you can redistribute it and/or modify
5 #~ it under the terms of the GNU General Public License as published by
6 #~ the Free Software Foundation, either version 3 of the License, or
7 #~ (at your option) any later version.
8 #~
9 #~ This program is distributed in the hope that it will be useful,
10 #~ but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 #~ GNU General Public License for more details.
13 #~
14 #~ You should have received a copy of the GNU General Public License
15 #~ along with this program. If not, see <http://www.gnu.org/licenses/>.
17 case "$1" in
18 ""|-h|--help)
19 # help me!
20 echo -e " pacorder, a script to sort all packages installed in your Arch Linux by\n required space.\n\n to use it (decreasing output in kilobytes), simply run: \n pacorder -DK [--dkb]\n decreasing output in megabytes: \n pacorder -DM [--dmb] \n\n to have increasing output (biggest packages the least) siply run:\n pacorder -IK [--ikb]\n or\n pacorder -IM [--imb] \n\n to display this help \n pacorder -h or --help\n"
22 -DM|--dmb) LANG=C pacman -Qi | sed -n '/^Name[^:]*: \(.*\)/{s//\1 /;x};/^Installed[^:]*: \(.*\)/{s//\1/;H;x;s/\n//;p}' | sort -rnk2 | awk '{$2=$2/1024; printf "%-30s %s MB\n", $1, $2}'
24 -IM|--imb) LANG=C pacman -Qi | sed -n '/^Name[^:]*: \(.*\)/{s//\1 /;x};/^Installed[^:]*: \(.*\)/{s//\1/;H;x;s/\n//;p}' | sort -nk2 | awk '{$2=$2/1024; printf "%-30s %s MB\n", $1, $2}'
26 -DK|--dkb) LANG=C pacman -Qi | sed -n '/^Name[^:]*: \(.*\)/{s//\1 /;x};/^Installed[^:]*: \(.*\)/{s//\1/;H;x;s/\n//;p}' | sort -rnk2 | awk '{printf "%-30s %s KB\n", $1, $2}'
28 -IK|--ikb) LANG=C pacman -Qi | sed -n '/^Name[^:]*: \(.*\)/{s//\1 /;x};/^Installed[^:]*: \(.*\)/{s//\1/;H;x;s/\n//;p}' | sort -nk2 | awk '{printf "%-30s %s KB\n", $1, $2}'
30 *) echo -e " pacorder, a script to sort all packages installed in your Arch Linux by\n required space.\n\n to use it (decreasing output in kilobytes), simply run: \n pacorder -DK [--dkb]\n decreasing output in megabytes: \n pacorder -DM [--dmb] \n\n to have increasing output (biggest packages the least) siply run:\n pacorder -IK [--ikb]\n or\n pacorder -IM [--imb] \n\n to display this help \n pacorder -h or --help\n"
32 esac