blob: 2c4c71df8694b29a956fe0c5ad2fb8ad4850a70b (
plain) (
blame)
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
|
#!/usr/bin/python
# This script is mainly used to demo the updateFile function.
import os
import os.path
import string
import sys
def setup_paths():
check_file = 'lib/python/debian_support.py'
path = os.getcwd()
while 1:
if os.path.exists("%s/%s" % (path, check_file)):
sys.path = [path + '/lib/python'] + sys.path
return path
idx = string.rfind(path, '/')
if idx == -1:
raise ImportError, "could not setup paths"
path = path[0:idx]
root_path = setup_paths()
import debian_support
if len(sys.argv) <> 3:
sys.stderr.write("usage: apt-update-file REMOTE LOCAL\n")
sys.exit(1)
try:
debian_support.updateFile(sys.argv[1], sys.argv[2])
except:
print >>sys.stderr, \
"error: in download of %s to %s:" % (repr(sys.argv[1]),
repr(sys.argv[2]))
raise
|