mirror of
https://github.com/kepler155c/opus
synced 2025-12-16 13:18:06 +00:00
a temporary fix for vfs/delete
This commit is contained in:
@@ -30,7 +30,7 @@ end
|
|||||||
|
|
||||||
local REGISTRY_DIR = 'usr/.registry'
|
local REGISTRY_DIR = 'usr/.registry'
|
||||||
|
|
||||||
-- icon:gsub('.', function(b) return '\\' .. b:byte() end)
|
-- iconExt:gsub('.', function(b) return '\\' .. b:byte() end)
|
||||||
local DEFAULT_ICON = NFT.parse('\30\55\31\48\136\140\140\140\132\
|
local DEFAULT_ICON = NFT.parse('\30\55\31\48\136\140\140\140\132\
|
||||||
\30\48\31\55\149\31\48\128\128\128\30\55\149\
|
\30\48\31\55\149\31\48\128\128\128\30\55\149\
|
||||||
\30\55\31\48\138\143\143\143\133')
|
\30\55\31\48\138\143\143\143\133')
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ local page = UI.Page {
|
|||||||
},
|
},
|
||||||
accelerators = {
|
accelerators = {
|
||||||
[ 'control-q' ] = 'quit',
|
[ 'control-q' ] = 'quit',
|
||||||
space = 'activate',
|
[ ' ' ] = 'activate',
|
||||||
t = 'terminate',
|
t = 'terminate',
|
||||||
},
|
},
|
||||||
eventHandler = function (self, event)
|
eventHandler = function (self, event)
|
||||||
|
|||||||
@@ -100,6 +100,26 @@ end
|
|||||||
function nativefs.delete(node, dir)
|
function nativefs.delete(node, dir)
|
||||||
if node.mountPoint == dir then
|
if node.mountPoint == dir then
|
||||||
fs.unmount(dir)
|
fs.unmount(dir)
|
||||||
|
-- hack here
|
||||||
|
-- if a file is mounted over an existing directory
|
||||||
|
-- ie. sys/apps/MOUNT.LUA
|
||||||
|
-- then sys and sys/apps are created as temp nodes
|
||||||
|
-- therefore, trying to delete sys will was only
|
||||||
|
-- removing the node and not deleting the directory
|
||||||
|
-- Need a better way to backfill nodes in a way
|
||||||
|
-- that preserves the vfs functionality
|
||||||
|
|
||||||
|
-- perhaps a flag that denotes that this is a
|
||||||
|
-- file/directory is the actual mount
|
||||||
|
|
||||||
|
-- this hack will not fix
|
||||||
|
-- rm packages/common
|
||||||
|
-- where packages is linked from a drive
|
||||||
|
-- and urls are mounted under packages/common
|
||||||
|
-- (as the fstype will be linkfs)
|
||||||
|
if node.fstype == 'nativefs' then
|
||||||
|
fs.native.delete(dir)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
fs.native.delete(dir)
|
fs.native.delete(dir)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ UI.Checkbox.defaults = {
|
|||||||
height = 1,
|
height = 1,
|
||||||
width = 3,
|
width = 3,
|
||||||
accelerators = {
|
accelerators = {
|
||||||
space = 'checkbox_toggle',
|
[ ' ' ] = 'checkbox_toggle',
|
||||||
mouse_click = 'checkbox_toggle',
|
mouse_click = 'checkbox_toggle',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ UI.CheckboxGrid.defaults = {
|
|||||||
UIElement = 'CheckboxGrid',
|
UIElement = 'CheckboxGrid',
|
||||||
checkedKey = 'checked',
|
checkedKey = 'checked',
|
||||||
accelerators = {
|
accelerators = {
|
||||||
space = 'grid_toggle',
|
[ ' ' ] = 'grid_toggle',
|
||||||
key_enter = 'grid_toggle',
|
key_enter = 'grid_toggle',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ UI.Chooser.defaults = {
|
|||||||
rightIndicator = UI.extChars and '\187' or '>',
|
rightIndicator = UI.extChars and '\187' or '>',
|
||||||
height = 1,
|
height = 1,
|
||||||
accelerators = {
|
accelerators = {
|
||||||
space = 'choice_next',
|
[ ' ' ] = 'choice_next',
|
||||||
right = 'choice_next',
|
right = 'choice_next',
|
||||||
left = 'choice_prev',
|
left = 'choice_prev',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -730,24 +730,6 @@ function Util.parse(...)
|
|||||||
return args, options
|
return args, options
|
||||||
end
|
end
|
||||||
|
|
||||||
function Util.args(arg)
|
|
||||||
local options, args = { }, { }
|
|
||||||
|
|
||||||
local k = 1
|
|
||||||
while k <= #arg do
|
|
||||||
local v = arg[k]
|
|
||||||
if _ssub(v, 1, 1) == '-' then
|
|
||||||
local opt = _ssub(v, 2)
|
|
||||||
options[opt] = arg[k + 1]
|
|
||||||
k = k + 1
|
|
||||||
else
|
|
||||||
table.insert(args, v)
|
|
||||||
end
|
|
||||||
k = k + 1
|
|
||||||
end
|
|
||||||
return options, args
|
|
||||||
end
|
|
||||||
|
|
||||||
-- http://lua-users.org/wiki/AlternativeGetOpt
|
-- http://lua-users.org/wiki/AlternativeGetOpt
|
||||||
local function getopt( arg, options )
|
local function getopt( arg, options )
|
||||||
local tab = {}
|
local tab = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user