2015-08-27 18:55:29 +00:00
|
|
|
function omf.remove_package
|
2015-08-26 15:20:13 +00:00
|
|
|
for pkg in $argv
|
2015-08-27 18:55:29 +00:00
|
|
|
if not omf.util_valid_package $pkg
|
2015-08-26 18:58:35 +00:00
|
|
|
if test $pkg = "omf"
|
|
|
|
echo (omf::err)"You can't remove `omf`"(omf::off) 1^&2
|
2015-08-26 15:20:13 +00:00
|
|
|
else
|
|
|
|
echo (omf::err)"$pkg is not a valid package/theme name"(omf::off) 1^&2
|
|
|
|
end
|
|
|
|
return $OMF_INVALID_ARG
|
|
|
|
end
|
|
|
|
|
|
|
|
if test -d $OMF_PATH/pkg/$pkg
|
|
|
|
emit uninstall_$pkg
|
|
|
|
rm -rf $OMF_PATH/pkg/$pkg
|
|
|
|
else if test -d $OMF_PATH/themes/$pkg
|
|
|
|
if test $pkg = (cat $OMF_CONFIG/theme)
|
2015-08-26 19:43:01 +00:00
|
|
|
echo "" > $OMF_CONFIG/theme
|
2015-08-26 15:20:13 +00:00
|
|
|
end
|
|
|
|
rm -rf $OMF_PATH/themes/$pkg
|
|
|
|
end
|
|
|
|
if test $status -eq 0
|
|
|
|
echo (omf::em)"$pkg succesfully removed."(omf::off)
|
|
|
|
else
|
|
|
|
echo (omf::err)"$pkg could not be found"(omf::off) 1^&2
|
|
|
|
end
|
|
|
|
end
|
|
|
|
refresh
|
2015-08-26 18:15:05 +00:00
|
|
|
end
|