Public bug reported:

If the directory you wish to publish to contains characters that need to
be escaped for a URL then create repo bombs out and will not work.

Linux ubuntu 3.19.0-15-generic #15-Ubuntu SMP Thu Apr 16 23:32:37 UTC 2015 
x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 15.04
createrepo                  0.10.3-1 

e.g.

user@ubuntu:~$ createrepo --update -o "/home/luser/source/a 
space/packaging/dist/jenkins/1.642/rpm-rc" --baseurl=file:/tmp/wibble  
"/home/luser/source/a space/packaging/dist/jenkins/1.642/rpm-rc/RPMS/noarch/"
Traceback (most recent call last):
  File "/usr/share/createrepo/genpkgmetadata.py", line 308, in <module>
    main(sys.argv[1:])
  File "/usr/share/createrepo/genpkgmetadata.py", line 276, in main
    mdgen.doPkgMetadata()
  File "/usr/lib/python2.7/dist-packages/createrepo/__init__.py", line 401, in 
doPkgMetadata
    self._setup_old_metadata_lookup()
  File "/usr/lib/python2.7/dist-packages/createrepo/__init__.py", line 387, in 
_setup_old_metadata_lookup
    self.oldData = readMetadata.MetadataIndex(old_repo_path, opts)
  File "/usr/lib/python2.7/dist-packages/createrepo/readMetadata.py", line 50, 
in __init__
    self._repo.baseurl = 'file://' + realpath
  File "/usr/lib/python2.7/dist-packages/yum/config.py", line 99, in __set__
    value, str(e)))
ValueError: Error parsing "baseurl = 'file:///home/luser/source/a 
space/packaging/dist/jenkins/1.642/rpm-rc'": URL must be http, ftp, file or 
https not ""


The code is obviously wrong...
/usr/lib/python2.7/dist-packages/createrepo/readMetadata.py:50
    self._repo.baseurl = 'file://' + realpath

You can not assume that an abitrary directory can be converted to a URL
by prepending with file://   - characters need to be escaped - this is
the whole reason why URL handling functions exist - e.g.
https://docs.python.org/3/library/urllib.request.html#urllib.request.pathname2url

** Affects: make-dfsg (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to make-dfsg in Ubuntu.
https://bugs.launchpad.net/bugs/1547474

Title:
  createrepo not creating URLs correctly

Status in make-dfsg package in Ubuntu:
  New

Bug description:
  If the directory you wish to publish to contains characters that need
  to be escaped for a URL then create repo bombs out and will not work.

  Linux ubuntu 3.19.0-15-generic #15-Ubuntu SMP Thu Apr 16 23:32:37 UTC 2015 
x86_64 x86_64 x86_64 GNU/Linux
  Ubuntu 15.04
  createrepo                  0.10.3-1 

  e.g.

  user@ubuntu:~$ createrepo --update -o "/home/luser/source/a 
space/packaging/dist/jenkins/1.642/rpm-rc" --baseurl=file:/tmp/wibble  
"/home/luser/source/a space/packaging/dist/jenkins/1.642/rpm-rc/RPMS/noarch/"
  Traceback (most recent call last):
    File "/usr/share/createrepo/genpkgmetadata.py", line 308, in <module>
      main(sys.argv[1:])
    File "/usr/share/createrepo/genpkgmetadata.py", line 276, in main
      mdgen.doPkgMetadata()
    File "/usr/lib/python2.7/dist-packages/createrepo/__init__.py", line 401, 
in doPkgMetadata
      self._setup_old_metadata_lookup()
    File "/usr/lib/python2.7/dist-packages/createrepo/__init__.py", line 387, 
in _setup_old_metadata_lookup
      self.oldData = readMetadata.MetadataIndex(old_repo_path, opts)
    File "/usr/lib/python2.7/dist-packages/createrepo/readMetadata.py", line 
50, in __init__
      self._repo.baseurl = 'file://' + realpath
    File "/usr/lib/python2.7/dist-packages/yum/config.py", line 99, in __set__
      value, str(e)))
  ValueError: Error parsing "baseurl = 'file:///home/luser/source/a 
space/packaging/dist/jenkins/1.642/rpm-rc'": URL must be http, ftp, file or 
https not ""

  
  The code is obviously wrong...
  /usr/lib/python2.7/dist-packages/createrepo/readMetadata.py:50
      self._repo.baseurl = 'file://' + realpath

  You can not assume that an abitrary directory can be converted to a
  URL by prepending with file://   - characters need to be escaped -
  this is the whole reason why URL handling functions exist - e.g.
  
https://docs.python.org/3/library/urllib.request.html#urllib.request.pathname2url

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/make-dfsg/+bug/1547474/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to