View | Details | Raw Unified | Return to bug 14697
Collapse All | Expand All

(-)installer-0.4.org/initinstall.d/20-metadata-basesystem.sh (-6 / +19 lines)
Lines 2-25 Link Here
2
2
3
. install2-init-functions
3
. install2-init-functions
4
4
5
6
metadir="/tmp/metadata"
7
mkdir -p "$metadir"
8
cp-metadata "$metadir/basesystem.manifest" || :
9
10
5
METHOD="${METHOD:-cdrom}"
11
METHOD="${METHOD:-cdrom}"
6
HOST="${HOST:-}"
12
HOST="${HOST:-}"
7
PREFIX="${PREFIX:-}"
13
PREFIX="${PREFIX:-}"
14
AUTH_DATA="${LOGIN:-}"
15
PASSWORD="${PASSWORD:-}"
16
if [[ -n "$PASSWORD" && -n "$AUTH_DATA" ]]; then
17
    AUTH_DATA=$(echo "$AUTH_DATA:$PASSWORD@")
18
elif [ -n "$AUTH_DATA" ]; then
19
    AUTH_DATA=$(echo "$AUTH_DATA@")
20
fi
21
	    
8
22
9
[ "$PREFIX" != "/" ] || PREFIX=
23
[ "$PREFIX" != "/" ] || PREFIX=
10
24
11
image_prefix=
25
image_prefix=
12
case "$METHOD" in
26
case "$METHOD" in
13
	http|ftp)
27
	http)
14
		    image_prefix="$METHOD://$HOST$PREFIX"
28
		    image_prefix="$METHOD://$HOST$PREFIX"
15
		    ;;
29
		    ;;
30
	ftp)
31
		    image_prefix="$METHOD://$AUTH_DATA$HOST$PREFIX"
32
		    ;;
16
	cdrom|disk|nfs)
33
	cdrom|disk|nfs)
17
		    image_prefix="$image_dir"
34
		    image_prefix="$image_dir"
18
		    ;;
35
		    ;;
19
esac
36
esac
20
37
21
metadir="/tmp/metadata"
38
sed -i -r -e "s#^(.*)#$image_prefix/ALTLinux/RPMS.base/\1#" "$metadir/basesystem.manifest" || :
22
23
mkdir -p "$metadir"
24
cp-metadata "$metadir/basesystem.manifest" &&
25
    sed -i -r -e "s#^(.*)#$image_prefix/ALTLinux/RPMS.base/\1#" "$metadir/basesystem.manifest" || :
(-)installer-0.4.org/scripts/cp-metadata (-1 / +12 lines)
Lines 5-10 Link Here
5
METHOD="${METHOD:-cdrom}"
5
METHOD="${METHOD:-cdrom}"
6
HOST="${HOST:-}"
6
HOST="${HOST:-}"
7
PREFIX="${PREFIX:-}"
7
PREFIX="${PREFIX:-}"
8
AUTH_DATA="${LOGIN:-}"
9
PASSWORD="${PASSWORD:-}"
10
if [[ -n "$PASSWORD" && -n "$AUTH_DATA" ]]; then
11
    AUTH_DATA=$(echo "$AUTH_DATA:$PASSWORD@")
12
elif [ -n "$AUTH_DATA" ]; then
13
    AUTH_DATA=$(echo "$AUTH_DATA@")
14
fi
8
15
9
image_prefix=
16
image_prefix=
10
curl_args="-s -S --retry 5 --retry-delay 2"
17
curl_args="-s -S --retry 5 --retry-delay 2"
Lines 25-34 get_local_metadata() { Link Here
25
32
26
33
27
case "$METHOD" in
34
case "$METHOD" in
28
	http|ftp)
35
	http)
29
		    image_prefix="$METHOD://$HOST$PREFIX"
36
		    image_prefix="$METHOD://$HOST$PREFIX"
30
		    get_remote_metadata "$1"
37
		    get_remote_metadata "$1"
31
		    ;;
38
		    ;;
39
	ftp)
40
		    image_prefix="$METHOD://$AUTH_DATA$HOST$PREFIX"
41
		    get_remote_metadata "$1"
42
		    ;;
32
	cdrom|disk|nfs)
43
	cdrom|disk|nfs)
33
		    image_prefix="$image_dir"
44
		    image_prefix="$image_dir"
34
		    get_local_metadata "$1"
45
		    get_local_metadata "$1"

Return to bug 14697