2015-08-26 23:20:13 +08:00
|
|
|
function omf_remove_package
|
|
|
|
for pkg in $argv
|
|
|
|
if not omf_util_valid_package $pkg
|
2015-08-27 02:58:35 +08:00
|
|
|
if test $pkg = "omf"
|
|
|
|
echo (omf::err)"You can't remove `omf`"(omf::off) 1^&2
|
2015-08-26 23:20:13 +08: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-27 03:43:01 +08:00
|
|
|
echo "" > $OMF_CONFIG/theme
|
2015-08-26 23:20:13 +08: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-27 02:15:05 +08:00
|
|
|
end
|