You are not logged in.
seems this was all a bit overkill.... 'pacman -Qm' does the same.
either way, for those that are still interested, here you go...
#!/usr/bin/python
from ftplib import FTP
from heapq import merge
import re
import string
import sys
import subprocess
def create_unsupported_list(architecture):
repos=['core','extra','community','testing']
ftp = FTP('ftp.archlinux.org')
ftp.login()
location=[] # initialize directory list on server
for repo in repos:
location.append(repo+'/os/'+architecture)
filelist=[] # initialize filelist
for directory in location:
filelist.append(ftp.nlst(directory))
[list1,list2,list3,list4]=merge(filelist)
CompleteList=list(merge(list1,list2,list3,list4))
string_list=' '.join(CompleteList)
p = subprocess.Popen('pacman -Q', shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
(fin, fout) = (p.stdout, p.stdin)
result = fin.read()
Local=string.split(result,'\n')
LocalPackages=[]
for entry in Local:
tmp=re.split(" ", entry)
LocalPackages.append(tmp[0]+'-')
Official=[] # initialize lists
NonOfficial=[]
for i in LocalPackages:
if i in string_list:
Official.append(i)
else:
NonOfficial.append(i)
print "list of non official packages installed:"
print ""
for entry in NonOfficial:
print entry[0:len(entry)-1]
print ""
if __name__ == '__main__':
if len(sys.argv) == 2:
if sys.argv[1] == 'i686':
architecture='i686'
create_unsupported_list(architecture)
sys.exit()
if sys.argv[1] == 'x86_64':
architecture='x86_64'
create_unsupported_list(architecture)
sys.exit()
else:
print ""
print "Not a valid architecture passed to the program."
print "Use either i686 or x86_64 as argument to the program."
print ""
sys.exit()
else:
print ""
print "Not a valid architecture passed to the program."
print "Use either i686 or x86_64 as argument to the program."
print ""
sys.exit()
Last edited by pressh (2010-02-19 11:16:53)
Offline
Isn't that what "pacman -Qm" does?
Offline
Isn't that what "pacman -Qm" does?
crap... why didn't I know that...
wasted a good half an hour of my time
[edit] changed topic title to reflect my stupidity
Last edited by pressh (2010-02-19 11:11:31)
Offline
Nah - it is a combination of "pacman -Qm" + "paclist <unofficial repo>".
Offline