1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 01:46:13 +01:00

- 'ci'/'rm': properly quote the path component of URLs used in HTTP requests

(now also in DELETE requests, where no quoting was done before at all)
- 'id': properly quote the query part of the URL 
- fix up tests.py
- add to TODO
This commit is contained in:
Dr. Peter Poeml 2006-06-29 23:34:06 +00:00
parent e22f91c2ea
commit b54e25c46b
3 changed files with 45 additions and 4 deletions

27
TODO
View File

@ -66,3 +66,30 @@ Deleting subversion.nb.po.bz2
Sending subversion.viewcvs.conf
Transmitting file data ..
01:20 < darix> DuDE: http://rafb.net/paste/results/hUjH7v14.html
01:21 < darix> that happens if the log is not accessible atm
02:26 <darix> Transmitting file data ..Traceback (most recent call last):
02:26 <darix> File "/usr/bin/osc", line 10, in ?
02:26 <darix> commandline.main()
02:26 <darix> File "/usr/lib/python2.4/site-packages/osc/commandline.py", line 667, in main
02:26 <darix> cmd_dict[cmd](args)
02:26 <darix> File "/usr/lib/python2.4/site-packages/osc/commandline.py", line 340, in checkin
02:26 <darix> p.to_be_deleted.remove(filename)
02:26 <darix> ValueError: list.remove(x): x not in list
osc repos server:search:ui :
<repository name="SUSE_Linux_10.1">
<path project="server:search" repository="SUSE_Linux_10.1" />
<path project="KDE:KDE4" repository="SUSE_Linux_10.1" />
<arch>x86_64</arch>
<arch>i586</arch>
</repository>
<repository name="SUSE_Factory">
<path project="server:search" repository="SUSE_Factory" />
<path project="KDE:KDE4" repository="SUSE_Factory" />
<arch>x86_64</arch>
<arch>i586</arch>
</repository>

View File

@ -10,6 +10,7 @@ __version__ = '0.6'
import os
import sys
import urllib2
from urllib import pathname2url, quote_plus
from urlparse import urlunsplit
import cElementTree as ET
from cStringIO import StringIO
@ -246,7 +247,7 @@ class Package:
def delete_source_file(self, n):
import othermethods
u = makeurl(['source', self.prjname, self.name, n])
u = makeurl(['source', self.prjname, self.name, pathname2url(n)])
othermethods.delfile(u, n, username, password)
self.delete_localfile(n)
@ -256,7 +257,7 @@ class Package:
# escaping '+' in the URL path (note: not in the URL query string) is
# only a workaround for ruby on rails, which swallows it otherwise
u = makeurl(['source', self.prjname, self.name, n.replace('+', '%2B')])
u = makeurl(['source', self.prjname, self.name, pathname2url(n)])
othermethods.putfile(u, os.path.join(self.dir, n), username, password)
shutil.copy2(os.path.join(self.dir, n), os.path.join(self.storedir, n))
@ -838,7 +839,7 @@ def read_meta_from_spec(specfile):
def get_user_id(user):
u = makeurl(['person', user.replace(' ', '+')])
u = makeurl(['person', quote_plus(user)])
try:
f = urllib2.urlopen(u)
return ''.join(f.readlines())
@ -848,7 +849,7 @@ def get_user_id(user):
def get_source_file(prj, package, filename, targetfilename=None):
u = makeurl(['source', prj, package, filename.replace('+', '%2B')])
u = makeurl(['source', prj, package, pathname2url(filename)])
f = urllib2.urlopen(u)
o = open(targetfilename or filename, 'w')

View File

@ -38,6 +38,19 @@ class TestOsc(unittest.TestCase):
<host></host>
<port></port>
</rpm_backend>
<watchlist>
<project name="server:mail"/>
<project name="frox"/>
<project name="home:cthiel1"/>
<project name="server:php"/>
<project name="Apache"/>
<project name="server:httpd-trunk"/>
<project name="server:isc-dhcp"/>
<project name="Subversion"/>
<project name="Tidy"/>
<project name="validators"/>
<project name="zsh"/>
</watchlist>
</person>
"""