class RBT::CreateAndPopulatePkgconfigDirectory
Constants
- NAMESPACE
#¶ ↑
NAMESPACE
¶ ↑#¶ ↑
Public Class Methods
[](i = '')
click to toggle source
Public Instance Methods
check_on_this_directory?()
click to toggle source
#¶ ↑
check_on_this_directory?¶ ↑
#¶ ↑
# File lib/rbt/misc/create_and_populate_pkgconfig_directory.rb, line 74 def check_on_this_directory? @check_on_this_directory end
Also aliased as: target?
reset()
click to toggle source
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/rbt/misc/create_and_populate_pkgconfig_directory.rb, line 81 def run _ = target? # This may be e. g. "/Programs/Sharedmimeinfo/Current/". if File.directory? _ # ===================================================================== # # Ok, it is a directory. Now we have to check for two things: # (1) does the subdirectory "share/pkgconfig/" exist. # ===================================================================== # new_target = _+'share/pkgconfig/' if File.directory?(new_target) and !(Dir.empty?(new_target)) # =================================================================== # # If we enter here, we know that e. g. # "/Programs/Sharedmimeinfo/Current/share/pkgconfig/". # must exist. So now we have to check if lib/pkgconfig/ does # NOT exist - or if it does, whether it is empty. # =================================================================== # new_pkgconfig_directory = _+'lib/pkgconfig/' unless File.directory?(new_pkgconfig_directory) and !Dir.empty?(new_pkgconfig_directory) # ================================================================= # # In this case first create this directory: # ================================================================= # mkdir(new_pkgconfig_directory, :be_silent) unless File.directory?(new_pkgconfig_directory) if File.directory?(new_pkgconfig_directory) and Dir.empty?(new_pkgconfig_directory) case @mode when :copy Dir[new_target+'*'].each {|this_entry| opnn; e 'Copying '+sfile(this_entry)+' towards '+ sdir(new_pkgconfig_directory)+'.' copy(this_entry, new_pkgconfig_directory) } when :symlink Dir[new_target+'*'].each {|this_entry| opnn; e 'Symlinking '+sfile(this_entry)+' towards '+ sdir(new_pkgconfig_directory)+'.' symlink(this_entry, new_pkgconfig_directory) } end end end end else opnn; e "#{teal(_)} is not a directory. This class requires a directory." end end
set_check_on_this_directory(i = '')
click to toggle source