Skip to content
Snippets Groups Projects
Commit 5813bccf authored by David Trattnig's avatar David Trattnig
Browse files

Cleanup after Liquidsoap 1.4.1 upgrade.

parent 533d7798
No related branches found
No related tags found
No related merge requests found
......@@ -127,166 +127,3 @@ if debug then
print(list.assoc(default="", "install_dir", ini))
end
# def read_ini(file)
# ret = get_process_lines("cat "^file )
# ret = list.map(string.split(separator="="), ret)
# # l' => the filling list
# def f(l',l) =
# if list.length(l) >= 2 then
# line = string.extract(pattern='"(.*)"', list.nth(l,1))
# list.append([(list.hd(l),line['1'])],l')
# else
# if list.length(l) >= 1 then
# list.append([(list.hd(l),"")],l')
# else
# l'
# end
# end
# end
# # append install dir
# pwd = get_process_lines("pwd")
# install_dir = dirname(dirname(list.hd(pwd)))
# list.fold(f, [("install_dir", install_dir)], ret)
# end
# debug = false
# def read_ini(file)
# # read ini file
# settings_file_content = get_process_lines("cat "^file )
# # one entry stored as ["setting_name", "setting"]
# settings_map = list.map(string.split(separator="="), settings_file_content)
# def filter_pair(setting_pair) =
# if debug then
# print(" +++ IN FILTER_PAIR +++")
# end
# # get head of settings_pair
# setting_name = list.hd(default="", setting_pair)
# if debug then
# print(" -- setting_name:")
# print(setting_name)
# end
# # settings in ini are with '"', so read them with high comma
# setting_unfiltered = list.nth(default="", setting_pair, 1)
# if debug then
# print(" -- setting_unfiltered:")
# print(setting_unfiltered)
# end
# # filter high comma out. why the hell comes an array ["1", setting] returned?
# # the filter patterns are perl regex
# setting = string.extract(pattern='"(.*)"', setting_unfiltered)
# if debug then
# print(" -- setting ( after string.extract):")
# print(setting['1'])
# end
# filtered_pair = [(setting_name, setting['1'])]
# if debug then
# print(" -- filter_pair returning: --")
# print(filtered_pair)
# end
# # return filtered_pair
# filtered_pair
# end
# def filter_map(filled_list, next_element) =
# # if debug then
# # print(" +++ IN FILTER_MAP +++")
# # print(" .. length of filled_list: ")
# # print(list.length(filled_list))
# # print(" .. next_element")
# # print(next_element)
# # end
# # the normal case: settingname and its setting
# if list.length(next_element) >= 2 then
# if debug then
# print(" ===> LENGTH list to insert in settings_list is equal TWO! <===")
# print(" -- next_element")
# print(next_element)
# end
# setting_pair = filter_pair(next_element)
# # add settings_pair to liquidsoap list
# #list.add(setting_pair, filled_list)
# list.append(setting_pair, filled_list)
# else
# if list.length(next_element) >= 1 then
# if debug then
# print(" ===> LENGTH of list to insert in settings_list is equal ONE! <===")
# print(" -- next_element")
# print(next_element)
# end
# #
# list.append([(list.hd(default="",next_element), "")], filled_list)
# else
# if debug then
# print(" ===> LENGTH of list to insert in settings_list is greater then two or less than one <===")
# print(" -- next_element")
# print(next_element)
# end
# # return the list as is
# filled_list
# end
# end
# end
# # get install dir
# pwd = get_process_lines("pwd") # returns an array
# #absolute_path = list.hd(default="", pwd) # grabs head of array (pwd only returns one line which is our desired result)
# #install_dir = '"' ^ dirname(dirname(absolute_path)) ^ '"' # pre and append " for filter_pair function. otherwise this setting would be lost through regex and fold function below would be imho much more difficult to read
# #pwd = get_process_lines("pwd")
# install_dir = path.dirname(path.dirname(list.hd(default="", pwd)))
# # add installdir to the loaded settings from ini file
# #settings_map = list.add(["install_dir", install_dir], settings_map)
# # list.fold param description:
# # f(a,b,c)
# # a) a function which is fold
# # b) the list which is to be filled (optional with already containing elements)
# # c) from this list every element is taken, function applied and inserted into b
# # fold function without pre and appended "
# settings = list.fold(filter_map, [("install_dir", install_dir)], settings_map)
# #settings = list.fold(filter_map, [], settings_map)
# if debug then
# print(settings)
# end
# settings
# end
# if debug then
# #ini = read_ini("/etc/aura/engine.ini")
# ini = read_ini("../../configuration/engine.ini")
# print(ini)
# print(list.assoc(default="", "install_dir", ini))
# end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment