monotone-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-users] Reading *other* attrs from an attr_functions[] function


From: Douglas Dickinson
Subject: [Monotone-users] Reading *other* attrs from an attr_functions[] function?
Date: Mon, 23 Mar 2015 13:36:08 -0700

Is there a monotone lua function like GET_ATTR(filename, attrname) ??

My own unix permissions handling attribute "ds:chmod" works,
BUT the execute bit is then overwritten by the "mtn:execute" handler,
So I want to override the default handler for "mtn:execute" to respect
both attributes,
Ideally something like:

attr_functions["mtn:execute"] =
   function(filename, value)
      if (GET_ATTR(filename, "ds:chmod") ~=nil) then  -- ????
         return execute(string.format("chmod %s %s", value, filename))
      end
      -- Continue like normal "mtn:execute"...
      if (value == "true") then
         set_executable(filename)
      else
         clear_executable(filename)
      end
   end

Many thanks in advance,
./ddd



-- Simple `chmod` handler
attr_functions["ds:chmod"] =
  function(filename, value)
    if value == nil then
      return nil
    end
    return execute(string.format("chmod %s %s", value, filename))
  end

-- 
  "why, oh why, didn't I take the *blue* pill?"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]