Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=2520398b33be6032eec0ff16505079a236519df4
commit 2520398b33be6032eec0ff16505079a236519df4 Author: Miklos Vajna <[email protected]> Date: Thu Jan 15 00:08:58 2009 +0100 scripts/mirrors: fix for the case when a path of a mirror is empty diff --git a/scripts/mirrors.py b/scripts/mirrors.py index 3d5de29..65c7e4b 100644 --- a/scripts/mirrors.py +++ b/scripts/mirrors.py @@ -32,8 +32,11 @@ for i in xmldoc.getElementsByTagName('mirror'): for j in i.getElementsByTagName('type'): m.types.append(j.firstChild.toxml()) for j in ['id', 'path', 'ftp_path', 'http_path', 'rsync_path', 'country', 'supplier', 'bandwidth']: - if i.getElementsByTagName(j) and i.getElementsByTagName(j)[0].firstChild: - m.__setattr__(j, i.getElementsByTagName(j)[0].firstChild.toxml()) + if i.getElementsByTagName(j): + if i.getElementsByTagName(j)[0].firstChild: + m.__setattr__(j, i.getElementsByTagName(j)[0].firstChild.toxml()) + else: + m.__setattr__(j, "") try: mirrors[m.country] except KeyError: @@ -63,6 +66,8 @@ for i in countries: path = j.http_path except AttributeError: path = j.path - sock.write("Server = %s://%s%s.frugalware.org/%s/%s/frugalwa...@carch@\n" % + if len(path): + path = "/%s" % path + sock.write("Server = %s://%s%s.frugalware.org%s/%s/frugalwa...@carch@\n" % (proto, domain, j.id, path, ver)) sock.close() _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
