/[gentoo-src]/portage/pym/sync/parseuri.py
Gentoo

Contents of /portage/pym/sync/parseuri.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download) (as text)
Sun Nov 7 14:38:39 2004 UTC (14 years, 1 month ago) by ferringb
Branch: MAIN
CVS Tags: portage_041204, HEAD
Branch point for: portage_2_1
Changes since 1.2: +1 -1 lines
File MIME type: text/x-python
header fixes.

1 # parseuri.py; parses a SYNC uri, returning protocol/host_uri
2 # Copyright 2004 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 #$Header: /var/cvsroot/gentoo-src/portage/pym/sync/parseuri.py,v 1.2 2004/11/07 14:06:53 ferringb Exp $
5
6 import portage_const
7
8 def parseSyncUri(uri):
9 """parse a SYNC uri, returning a tuple of protocol,host_uri"""
10 u=uri.lower()
11 if u.startswith("rsync") or len(u) == 0:
12 if len(u) <= 5:
13 return ('rsync',portage_const.RSYNC_HOST)
14 return ('rsync',u[8:])
15 elif u.startswith("cvs://"):
16 u=u[6:]
17 return ('cvs',u)
18 elif u.startswith("snapshot"):
19 if len(u)==8:
20 # the caller gets to randomly crapshoot a mirror for it.
21 return ('snapshot',None)
22 return ('snapshot',u[9:])
23 else:
24 return (None,None)

  ViewVC Help
Powered by ViewVC 1.1.20