You are not logged in.
Hi, I cant get it to work, I downloaded, give it executable permissions and change the .txt extension to .sh, first I ran:
sh bigpkg.sh
and got
bigpkg.sh: line 26: syntax error near unexpected token `('
bigpkg.sh: line 26: `def strip_versioning(pkg):'
and then tried with:
./bigpkg.sh
and got:
/usr/bin/env: python: No such file or directory
Python is installed on my system.
How to solve this?
cheers
Last edited by 655321 (2010-11-20 01:05:42)
Linux user #498977
With microsoft you get windows and gates, with linux you get the whole house!
My Blog about ArchLinux and other stuff
Offline
change "python" to "python2" on the top line.
Edit: I should rewrite it in python3...
Offline
change "python" to "python2" on the top line.
Edit: I should rewrite it in python3...
Thx! changing to python2 on the script helped
cheers.
PS: I really have some big ass packages lol
Linux user #498977
With microsoft you get windows and gates, with linux you get the whole house!
My Blog about ArchLinux and other stuff
Offline
Nice app, my system is 2.5GB smaller now!
Offline
Very nice, script, Allan. I placed it in the AUR. Before this script, I have been using pacgraph to accomplish this task. (pacgraph -c), but I think your method is more elegant and more accurately captures the true size.
Two suggestions to improve the output IMO:
1) Format the output with the size in MB rather than in K
2) Reverse the order of the pkgname and size and separate the two by a tab to make the output look a bit cleaner
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Online
bigpkg seems to crash on dependencies that have been removed locally with pacman -Rd.
ᶘ ᵒᴥᵒᶅ
Offline
I have not touched this script in over a year... so feel free to do what you want to it. I will probably adjust it once pacman-3.5 is release as it will be nicely broken then!
Offline
bigpkg seems to crash on dependencies that have been removed locally with pacman -Rd.
That is because you pacman database is inconsistent... one package says you have a dependency installed but there is not database entry. Again, not likely to get fixed any time soon...
Offline
Just for the record:
v0.3.0 is now on my site with pacman-3.5 fixes
The package in the AUR has been updated.
Offline
@graysky
I posted in the aur how I edited to add KB, MB, and GB then I read this post and decided to implement your other idea:
http://paste.pocoo.org/show/448968/
(oh and I changed it from /usr/bin/env python2 to /use/bin/env python since its python 3.x now)
Offline
(oh and I changed it from /usr/bin/env python2 to /use/bin/env python since its python 3.x now)
Seems to work fine with python2 if you keep the 'python2' part.
Not sure if '953.00KB' is helpful - do I really care about every byte?
Offline
markbabc wrote:(oh and I changed it from /usr/bin/env python2 to /use/bin/env python since its python 3.x now)
Seems to work fine with python2 if you keep the 'python2' part.
Not sure if '953.00KB' is helpful - do I really care about every byte?
just checked and .format() works in 2.6 and up so everything should work in python2 or python
and the .00 is for the MB/GB ones but if it makes you feel better you can modify it to not show if there is no decimal....
Actually upon consideration it is sorta pointless to have all that .00 for KB's so here you go: http://paste.pocoo.org/show/448980/
Last edited by markbabc (2011-07-29 19:10:36)
Offline
Unfortunately it causes formatting problems:
Size PKG
20.0KB: downgrade
20.0KB: mozilla-common
52.0KB: resourceproto
68.0KB: xf86driproto
76.0KB: bigreqsproto
76.0KB: xcmiscproto
140.0KB: xf86-video-fbdev
140.0KB: xf86-video-vesa
148.0KB: xf86-input-keyboard
152.0KB: mingetty
...
852.0KB: pkg-config
884.0KB: hunspell
946.0KB: sxiv
972.0KB: fakeroot
1.06MB: lsof
1.08MB: xorg-xinit
1.12MB: libidl2
1.12MB: sfarkxtc
...
7.14MB: mbrola-voices-us3
8.67MB: xorg-server
9.39MB: initscripts
10.71MB: arch-wiki-lite
12.09MB: festival-pl-em
12.99MB: quickserve
13.12MB: iotop
...
85.86MB: kernel26
95.27MB: arch-wiki-docs
133.37MB: android-notifier-desktop
141.69MB: fluidr3
158.37MB: festival-jmk-arctic
224.84MB: festival-us-awb-multisyn
Edit: Grrr, In my terminal the columns are not off by one character, they are off by eight.
I "fixed it" by piping the output of your script to 'column -t'.
./bp | column -t
Last edited by karol (2011-07-29 19:32:51)
Offline
not sure why you still have .0KB heres what i get:
Size PKG
28KB: modprobed_db
80KB: zd1211-firmware
105KB: gen-init-cpio
113KB: xf86-video-vesa
129KB: acpi
153KB: tree
153KB: sl
189KB: ncdu
233KB: patch
241KB: dash
...
1.56MB: ntfs-3g
1.58MB: sudo
1.59MB: nano
1.64MB: xorg-server-utils
1.66MB: clyde-git
1.73MB: cryptsetup
1.76MB: xmlto
...
14.80MB: man-pages
16.06MB: xorg-fonts-75dpi
17.31MB: openmotif
17.32MB: xorg-fonts-100dpi
17.36MB: docbook-xsl
18.06MB: transmission-gtk
19.18MB: ruby
19.34MB: comix
19.83MB: imagemagick
...
93.55MB: boost
98.43MB: chromium
98.84MB: jre
279.72MB: libreoffice
535.45MB: ghc
for some odd reason its treating \t\t really weird making some tabs bigger than others... unless theres preceeding whitespace before the pkg names?
Offline
not sure why you still have .0KB
python2 :-)
With python3 the zeroes are gone.
Offline
Alright I forgot python2.x and 3.x division acts differently... if you want the same thing that im coding (why bother with 2.x when 3.x is default in arch?) do from __future__ import division
http://paste.pocoo.org/show/448999/
Thats it with adjusted spaces so the pkg names are all lined up
Last edited by markbabc (2011-07-29 19:43:32)
Offline
I only said it worked OK with python2 - I considered it a bonus :-)
I've changed the format a bit to suit my preferences:
[karol@black test]$ diff -Naur a/bp2 b/bp2
--- a/bp2 2011-07-29 20:17:32.000000000 +0000
+++ b/bp2 2011-07-29 20:17:55.000000000 +0000
@@ -25,7 +25,7 @@
def adjust_space(pkg, size):
size_l = len(size)
- spaces = (16-size_l)*" "
+ spaces = (12-size_l)*" "
return "{0}:{1}{2}".format(size, spaces, pkg)
def find_pkg_size(size, options=["KB", "MB", "GB"], count=0):
@@ -33,8 +33,8 @@
count += 1
return find_pkg_size(size/1024, options, count)
else:
- if count == 0: return "{0}{1}".format(size, options[count])
- else: return "{0:0.2f}{1}".format(size, options[count])
+ if count == 0: return "{0:5,} {1}".format(size, options[count])
+ else: return "{0:5,.1f} {1}".format(size, options[count])
def strip_versioning(pkg):
r = re.compile('[^=,^<,^>]+')
m = r.match(pkg)
@@ -116,6 +116,7 @@
pkg_usage = [ [v[1],v[0]] for v in pkg_usage.items()]
pkg_usage.sort()
-print("Size \t\tPKG\n")
+print(" SIZE PKG")
for pkg in range(len(pkg_usage)):
print("{0}".format(adjust_space(pkg_usage[pkg][1], find_pkg_size(round(pkg_usage[pkg][0])))))
+print(" SIZE PKG")
SIZE PKG
20 KB: downgrade
20 KB: mozilla-common
52 KB: resourceproto
68 KB: xf86driproto
76 KB: bigreqsproto
76 KB: xcmiscproto
142 KB: xf86-video-fbdev
142 KB: xf86-video-vesa
827 KB: abs
855 KB: pkg-config
888 KB: hunspell
957 KB: sxiv
1,001 KB: fakeroot
1.1 MB: lsof
1.1 MB: xorg-xinit
1.1 MB: sfarkxtc
1.1 MB: libidl2
7.1 MB: mbrola-voices-us3
8.7 MB: xorg-server
9.4 MB: initscripts
10.7 MB: arch-wiki-lite
12.1 MB: festival-pl-em
13.0 MB: quickserve
13.2 MB: iotop
85.9 MB: kernel26
95.3 MB: arch-wiki-docs
133.5 MB: android-notifier-desktop
141.7 MB: fluidr3
158.4 MB: festival-jmk-arctic
224.9 MB: festival-us-awb-multisyn
SIZE PKG
Thanks!
Offline
nice! didnt think to do the {0:num,} thing! although in your what if a pkg is 1000.1 MB large? you have to make it 6 instead of 5 (I went with 7 because I kept the two decimal places)
Offline