blob: a1c40651e4bcc71643d58b0060c9a5e212b70b88 (
plain)
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
|
#!/bin/sh
create_deps_graph () {
for f in $DEP_DIR/*; do
printf "${f#$DEP_DIR/}:"
local deps=""
[ -f "$f" ] && while read line; do
for dep in $line; do
case "$deps" in
*"$dep"*);;
*) deps="$deps $dep";;
esac
done
done < $f
printf "%s\n" "$deps"
done
}
create_packages_list () {
for pkg in $@; do
while read line; do
set -- $line
shift
echo $pkg $@
done < $PACKAGES_DIR/$pkg
done
}
mirror () {
local MIRROR_DIR=${SYSROOT}${1:-$MIRROR_DIR}
mkdir -p $MIRROR_DIR/repo
create_deps_graph > $MIRROR_DIR/repo/deps.graph
mkdir -p $MIRROR_DIR/keychain
cp -r $KEYCHAIN_DIR/* $MIRROR_DIR/keychain/
local packages=$(list)
create_packages_list $packages > $MIRROR_DIR/repo/packages.list
cd $MIRROR_DIR/repo
fetch $packages
cd -
}
|