lib/fpm/package/dir.rb
# Add a new path to this package.
#
# If the path is a directory, it is copied recursively. The behavior
# of the copying is modified by the :chdir and :prefix attributes.
#
# If :prefix is set, the destination path is prefixed with that value.
# If :chdir is set, the current directory is changed to that value
# during the copy.
#
# Example: Copy /etc/X11 into this package as /opt/xorg/X11:
#
#     package.attributes[:prefix] = "/opt/xorg"
#     package.attributes[:chdir] = "/etc"
#     package.input("X11")
Add a new path to this package.
If the path is a directory, it is copied recursively. The behavior
of the copying is modified by the :chdir and :prefix attributes.

If :prefix is set, the destination path is prefixed with that value.
If :chdir is set, the current directory is changed to that value
during the copy.




Add a new path to this package . If the path is a directory it is copied recursively . The behavior of the copying is modified by the : chdir and : prefix attributes . If : prefix is set the destination path is prefixed with that value . If : chdir is set the current directory is changed to that value during the copy .
def input(path)
    @logger.debug("Copying", :input => path)
    @logger["method"] = "input"
    ::Dir.chdir(@attributes[:chdir] || ".") do
      if @attributes[:prefix]
        clone(path, File.join(staging_path, @attributes[:prefix]))
      else
        clone(path, staging_path)
      end
    end
    self.license = "unknown"
    self.vendor = [ENV["USER"], Socket.gethostname].join("@")
  ensure
    @logger.remove("method")
  end
def input ( path ) @logger . debug ( "Copying" , :input => path ) @logger [ "method" ] = "input" :: Dir . chdir ( @attributes [ :chdir ] || "." ) do if @attributes [ :prefix ] clone ( path , File . join ( staging_path , @attributes [ :prefix ] ) ) else clone ( path , staging_path ) end end self . license = "unknown" self . vendor = [ ENV [ "USER" ] , Socket . gethostname ] . join ( "@" ) ensure @logger . remove ( "method" ) end
Add a new path to this package.
Add a new path to this package .
# Set some defaults. This is useful because other package types # can include license data from themselves (rpms, gems, etc), # but to make sure a simple dir -> rpm works without having # to specify a license. # Clean up any logger context we added.
path
<not_specific>