File: apt-file.conf

package info (click to toggle)
apt-file 2.1.5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 296 kB
  • ctags: 37
  • sloc: perl: 815; makefile: 70; sh: 58
file content (45 lines) | stat: -rw-r--r-- 2,531 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Apt-file configuration file

# Substitutions are made as follows:
#	host => remote hostname
#	port => remote port
#	uri => complete URI from sources.list
#	path => path from /
#	dist => the distribution name
#	comp => the component name
#	cache => path to the local cache dir
#	dest => the destination file name inside the cache dir
#	cdrom => cdrom mount point

# Where are located Packages (relative to <comp> directory)
destination = <host>_<path>_dists_<dist>_Contents-<arch>.gz

# common code blocks can be defined as variables and be used as $check_cmd, etc. later
check_cmd = ( ( gunzip -l "<cache>/<dest>_tmp" >/dev/null 2>&1 || (echo "File is not gzipped."; false) ) && mv "<cache>/<dest>_tmp" "<cache>/<dest>" 2>&1 )
error_cmd = ( rm -f "<cache>/<dest>_tmp"; echo "Can't get <uri>/dists/<dist>/Contents-<arch>.gz" )
post_dl_cmd = $check_cmd || $error_cmd 


# Fetch methods using curl -L
curl_cmd = curl -f -L -z "<cache>/<dest>" -R -o "<cache>/<dest>_tmp"
# We test if "<cache>/<dest>_tmp" exists, because we only get the file if it is newer
curl_post_dl_cmd = ( test ! -f "<cache>/<dest>_tmp" || $check_cmd ) || $error_cmd 
http = $curl_cmd "<uri>/dists/<dist>/Contents-<arch>.gz" >/dev/null 2>&1 && $curl_post_dl_cmd
ftp = $curl_cmd --ftp-pasv "<uri>/dists/<dist>/Contents-<arch>.gz" >/dev/null 2>&1 && $curl_post_dl_cmd
# In debtorrent URLs, we have to replace 'debtorrent' by 'http'
debtorrent = $curl_cmd "http://<host>:<port|9988><path>/dists/<dist>/Contents-<arch>.gz" >/dev/null 2>&1 && $curl_post_dl_cmd

# Fetch methods using wget
# Automatically used if curl is not installed
http2 = wget -P "<cache>" -O "<cache>/<dest>_tmp" "<uri>/dists/<dist>/Contents-<arch>.gz" >/dev/null 2>&1 && $post_dl_cmd
ftp2 = wget --passive-ftp -P "<cache>" -O "<cache>/<dest>_tmp" "<uri>/dists/<dist>/Contents-<arch>.gz" >/dev/null 2>&1 && $post_dl_cmd

ssh = scp -l <user> -P <port|22> "<host>:/<path>/dists/<dist>/Contents-<arch>.gz" "<cache>/<dest>_tmp" && $post_dl_cmd
rsh = rcp -l <user> "<host>:/<path>/dists/<dist>/Contents-<arch>.gz" "<cache>/<dest>_tmp" && $post_dl_cmd
file = cp "/<path>/dists/<dist>/Contents-<arch>.gz" "<cache>/<dest>"
copy = cp "/<path>/dists/<dist>/Contents-<arch>.gz" "<cache>/<dest>"
cdrom = echo "Put CDROM labeled <path> in the cdrom device" > /dev/stderr ; read ; mount "<cdrom>"; cp "<cdrom>/dists/<dist>/Contents-<arch>.gz" "<cache>/<dest>" ; umount "<cdrom>"

# Schemes that might require user input on 'apt-file update'
# These will be skipped if -N is given
interactive = cdrom rsh ssh