2015-09-07 19:34:11 -03:00
|
|
|
function omf.bundle.install
|
2015-11-01 21:05:52 -02:00
|
|
|
test -n "$argv";
|
|
|
|
and set bundle $argv
|
|
|
|
or set bundle $OMF_CONFIG/bundle
|
2015-08-29 19:22:53 -03:00
|
|
|
|
2015-09-11 14:53:27 -03:00
|
|
|
if test -f $bundle
|
2015-10-15 00:23:22 -03:00
|
|
|
set packages (omf.packages.list --installed)
|
2015-09-11 14:53:27 -03:00
|
|
|
set bundle_contents (cat $bundle | sort -u)
|
2015-08-29 19:22:53 -03:00
|
|
|
|
2015-09-11 14:53:27 -03:00
|
|
|
for record in $bundle_contents
|
2015-10-15 00:23:22 -03:00
|
|
|
test -n "$record"; or continue
|
|
|
|
|
|
|
|
set type (echo $record | cut -s -d' ' -f1 | sed 's/ //g')
|
|
|
|
contains $type theme package; or continue
|
2015-08-29 19:22:53 -03:00
|
|
|
|
2015-10-15 00:23:22 -03:00
|
|
|
set name_or_url (echo $record | cut -s -d' ' -f2- | sed 's/ //g')
|
|
|
|
test -n "$name_or_url"; or continue
|
|
|
|
|
2015-12-25 18:02:44 +02:00
|
|
|
set name (omf.package_name $name_or_url)
|
2015-08-29 19:22:53 -03:00
|
|
|
|
2015-10-15 00:23:22 -03:00
|
|
|
if not contains $name $packages
|
|
|
|
omf.install $name_or_url;
|
|
|
|
and set installed
|
2015-08-29 19:22:53 -03:00
|
|
|
end
|
|
|
|
end
|
2015-09-11 14:54:00 -03:00
|
|
|
|
|
|
|
sort -u $bundle -o $bundle
|
2015-08-29 19:22:53 -03:00
|
|
|
end
|
|
|
|
|
2015-10-15 00:23:22 -03:00
|
|
|
set -q installed
|
2015-08-29 19:22:53 -03:00
|
|
|
end
|