blob: 03337fced2e7bedc71c200e48bafb81c6b658bc0 (
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
prokit install [-a <arch>] [-P <plat>] <suite> <chroot>
<suite>
e.g. rs1, dev/trunk, or proteanos:dev/trunk
if <arch> != host-arch
install host-arch base packages to /inst
prokit shell <chroot>
prokit opkg <chroot> [<option> ...] <command> [<argument> ...]
prokit opkbuild <chroot> [<option> ...] <pkgdir>
gets build deps, makes and installs metapackage, opkbuilds
removes metapackage, autoremoves cruft
developer:
host$ prokit install -a core-linux-eglibc -P dev proteanos:dev/trunk chroot
host$ prokit opkbuild chroot .
buildd:
host$ prokit opkg chroot install src-expat
host$ prokit opkbuild chroot chroot/usr/src/expat_*/
run_cmd()
{
if $# lt cmd_$cmd_min_args
help $cmd
exit 1
if cmd_$cmd_max_args is set and $# gt cmd_$cmd_max_args
help $cmd
exit
i=0; args=
while i lt cmd_$cmd_exp_args
args="$args ''"
eval cmd_$cmd_main $@ $args
}
cmd_install_min_args=2
cmd_install_exp_args=2
cmd_install_max_args=2
opkg cmd? parses opts after <chroot>?
maybe <chroot> itself should be an option?
ask profile for arch and feed index URIs
for each feed
download feed index
control=
for each line in feed index
if line not empty
control="$control$line$LF"
else
pkg=`echo $control | sed -n 's/^Package: *//p'`
run profile callback
if $pkg should be installed
pkgs="$pkgs $pkg"
for each field in $install_dep_fields $host_dep_fields
deps=`echo $control | sed -n
"s/^$field: *//p"`
new_deps=
IFS=', '; for each dep in $deps
dep=`echo $dep | sed
's/ *|.*$//; s/ *(.*$/;'`
# or maybe `echo $dep |
cut -d ' ' -f 1`
new_deps="$new_deps $dep"
echo "$pkg$new_deps" >$field.list
all_deps=
while $new_pkgs not empty
all_deps="$all_deps $new_pkgs"
new_deps=
for each pkg in $new_pkgs
new_deps=`grep "^$pkg " *depends.list | cut -d ' ' -f 2-`
new_deps=`printf '%s\n' $new_deps | sort -u`
new_pkgs=
for each pkg in $new_deps
if $pkg not in $all_deps
new_pkgs="$new_pkgs $pkg"
for each line in feed index
if line not empty
parse control fields
else
run profile callback
if $pkg should be installed
pkgs="$pkgs $pkg"
unresolved="$deps"
while $unresolved not empty
for each line in feed index
if line not empty
parse control fields
else
if $unresolved starts with $pkg
allpkgs='base'
newpkgs='busybox linux-image opkg'
foreach pkg
if $pkg in $newpkgs
|