View Single Post
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#56
Well.. this probably won't work and is certainly overly complicated.. but I don't know of a way to list repo's directly from apt. This makes use of tricks with find and grep, both of which are probably bastardized versions on the N900 and will probably not work.

Code:
#!/usr/bin/python                                                               
import commands                                                                 
                                                                                
enabled = commands.getoutput('find /etc/apt -name *.list -exec grep -v "^#" {} \
; | grep -v "^$"')                                                              
disabled = commands.getoutput('find /etc/apt -name *.list -exec grep "^#" {} \; 
| grep -Ev "^#\W*$"')                                                           
                                                                                
print "Enabled Repositories \n\n" + enabled                                     
                                                                                
print "\n\nDisabled Repositories \n\n" + disabled
Fortunately.. you could totally python-ify this which would work on the N900... just search for all *.list files in /etc/apt and open them, then look for a # at the beginning of the line. Those with a # are disabled, those without are enabled.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following 2 Users Say Thank You to fatalsaint For This Useful Post: