File: apt.sh

package info (click to toggle)
shoop 0.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 328 kB
  • ctags: 41
  • sloc: sh: 1,138; makefile: 209; perl: 44
file content (52 lines) | stat: -rw-r--r-- 929 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
46
47
48
49
50
51
52
OBJECT . new APT

APT . methoddir =q /usr/lib/apt/methods
APT . fetch : '
	local method=$1 uri file aptmethod counter entity; shift
	aptmethod=$($THIS . methoddir)/$method
	if [ ! -x $aptmethod ]; then
		echo "Method \`$method\` not found!"
		return 1
	fi
	while [ $# -gt 0 ]; do
		counter=$(($counter + 1))		
		local fetch_uri_$counter="$1" fetch_file_$counter="$2"
		shift 2
		entity="$entity $counter"
	done
	(cat << _EOF_
601 Configuation
Config-Item: Debug::Acquire::http=true

_EOF_
	for a in $entity; do
		eval uri=\$fetch_uri_$a file=\$fetch_file_$a
		rm -f $file
		cat << _EOF_
600 URI Acquire
URI: $uri
Filename: $file

_EOF_
		sleep 1
	done) |
	(
		while read; do
			echo "to method [$REPLY]" >&2
			echo "$REPLY"
		done
	) |
	($aptmethod; echo -e "999 Method done\nExit-Status: $?")|
	(
		while read; do
			echo "from method {$REPLY}" >&2
			if [ "$inmsg" ]; then
				:
			else
				:
			fi
		done
	)
	echo $?
	wait
'