2015-09-07 22:34:11 +00:00
|
|
|
function omf.bundle.remove
|
2016-04-19 08:16:58 +00:00
|
|
|
set -l bundle $OMF_CONFIG/bundle
|
|
|
|
|
2016-04-19 07:34:33 +00:00
|
|
|
if test -L $OMF_CONFIG/bundle
|
2016-04-19 07:14:10 +00:00
|
|
|
set bundle (readlink $OMF_CONFIG/bundle)
|
|
|
|
end
|
2015-09-07 22:34:11 +00:00
|
|
|
|
|
|
|
if test -f $bundle
|
|
|
|
set type $argv[1]
|
|
|
|
set name $argv[2]
|
2015-09-11 17:51:35 +00:00
|
|
|
set bundle_contents (cat $bundle | sort -u)
|
2015-09-07 22:34:11 +00:00
|
|
|
|
|
|
|
rm -f $bundle
|
|
|
|
|
|
|
|
for record in $bundle_contents
|
|
|
|
set record_type (echo $record | cut -d' ' -f1)
|
2015-12-25 16:02:44 +00:00
|
|
|
set record_name_or_url (echo $record | cut -d' ' -f2-)
|
2015-12-20 19:57:51 +00:00
|
|
|
set record_name (omf.packages.name $record_name_or_url)
|
2015-09-07 22:34:11 +00:00
|
|
|
|
2015-12-25 16:02:44 +00:00
|
|
|
if not test "$type" = "$record_type" -a "$name" = "$record_name"
|
|
|
|
echo "$record_type $record_name_or_url" >> $bundle
|
2015-09-07 22:34:11 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-09-11 17:52:04 +00:00
|
|
|
|
|
|
|
return 0
|
2015-09-07 22:34:11 +00:00
|
|
|
end
|