openSUSE:Libzypp URIs

Jump to: navigation, search

Libzypp provides unified access to resources on various types of media. These resources can be identified by a standard Uniform Resource Identifier (URI). Any application using libzypp can take advantage of this and enable their users to work with these URIs, like YaST or Zypper does. ZYpp basically uses URIs to locate package repositories, but ZYpp applications can use them to locate and identify also other resorces like RPM files, .repo files, or openSUSE Build Service repositories. This article lists all the supported URI schemes and usages.

Icon-expand.png
This article is a stub!
This article needs to be expanded. You are welcome to help in line with the Style Guidelines.

TODO:

  • specific scheme descriptions and how do they work
  • specific URI parameters
  • crosslinks
  • real life examples


Quick Reference

http://download.opensuse.org/distribution/SL-OSS-factory/inst-source
dir:/home/jkupec/myrpms
dvd:/
nfs:/nfsserver/path/to/repo
iso:/?iso=/path/to/openSUSE11-DVD.iso
iso:/?iso=CD1.iso&url=nfs:/myserver/dirwithisos


Components of a URI

 ftp://example.com:8042/over/there?name=ferret#nose
 \_/   \______________/\_________/ \_________/ \__/
  |           |            |            |        |
scheme     authority       path        query   fragment
  |   _____________________|__
 / \ /                        \
 urn:example:animal:ferret:nose

All URIs require a scheme identifier (like http or file). The parts following the scheme are scheme-specific, as you can see from the above example. Various applications can ease the use of URIs, e.g. by providing input fields to fill (like in YaST's Repository Management module), or by guessing omitted components (like Zypper treating file or directory paths as dir URIs).


ZYpp URIs

All URIs supported by ZYpp can contain a query parameter named alias. This is a reserved parameter that can be used by applications as a repository identifier.


HTTP/HTTPS/FTP

You are probably very familiar with these already:

http://server/path/on/server
http://user:pass@server/path
https://user:pass@server/path?proxy=foo&proxyuser=me&proxypass=pw
ftp://server/relative/path/to/media/dir
ftp://server/%2fabsolute/path/to/media/dir
ftp://user:pass@server/path/to/media/dir
ftp://user:pass@server/%2f/home/user/path/to/media/dir

URLs can have query parameters (like "proxy" above) that configure access:

Parameter Value Default Description Corresponding cURL option
timeout Number 60 Specify connect timeout in seconds CURLOPT_CONNECTTIMEOUT
ssl_verify yes, no, verify_host, verify_peer yes Whether to verify server SSL certificate CURLOPT_SSL_VERIFYHOST, CURLOPT_SSL_VERIFYPEER
ssl_capath Pathname /etc/ssl/certs Directory for SSL certificates CURLOPT_CAPATH
proxy Hostname None Specify proxy server CURLOPT_PROXY
proxyport TCP port 80 Specify proxy server port CURLOPT_PROXY
proxyuser Username None Specify proxy server username CURLOPT_PROXYUSERPWD
proxypassword Password Value read from ~/.curlrc Specify proxy server password CURLOPT_PROXYUSERPWD

CD/DVD

cd:/
cd:/subdir
cd:/?devices=/dev/hda,/dev/hdb
dvd:/
dvd:/subdir
dvd:/?devices=/dev/hda,/dev/hdb


Local Files

dir:/directory/name
file:/directory/name


SMB/CIFS

cifs://servername/share/path/on/the/share"
cifs://username:passwd@servername/share/path/on/the/share?mountoptions=ro
smb://servername/share/path/on/the/share"
smb://username:passwd@servername/share/path/on/the/share?mountoptions=ro


NFS

nfs://nfs-server/exported/path
nfs://nfs-server/exported/path?mountoptions=ro


HD Disk Volumes

hd:/?device=/dev/hda1
hd:/subdir?device=/dev/sda1
hd:/subdir?device=/dev/sda1&filesystem=reiserfs


ISO Images

iso:/?iso=/path/to/CD1.iso
iso:/?iso=CD1.iso&url=dir:/path/to
iso:/?iso=CD1.iso&url=nfs://server/path/to/media
iso:/?iso=CD1.iso&url=hd:/?device=/dev/hda
iso:/?iso=DVD1.iso&url=hd:/directory/?device=/dev/sda2
iso:/subdir?iso=DVD1.iso&url=nfs://nfs-server/directory&mnt=/nfs/attach/point&filesystem=udf