diff options
author | rupak19 | 2020-04-22 17:41:02 +0530 |
---|---|---|
committer | rupak19 | 2020-04-22 17:41:02 +0530 |
commit | ebaf2d3f27b386ebcd2fbd511a9868ee842cac3f (patch) | |
tree | e8783ce2d1fcdceb16ddb32915c76535c62acce7 /cleaner.sce | |
parent | d6e8cfd86be242d0a1a09a1ef7d8b7f3d12af795 (diff) | |
download | FOSSEE-Signal-Processing-Toolbox-ebaf2d3f27b386ebcd2fbd511a9868ee842cac3f.tar.gz FOSSEE-Signal-Processing-Toolbox-ebaf2d3f27b386ebcd2fbd511a9868ee842cac3f.tar.bz2 FOSSEE-Signal-Processing-Toolbox-ebaf2d3f27b386ebcd2fbd511a9868ee842cac3f.zip |
Minor corrections in macros sci files
Diffstat (limited to 'cleaner.sce')
-rw-r--r-- | cleaner.sce | 80 |
1 files changed, 53 insertions, 27 deletions
diff --git a/cleaner.sce b/cleaner.sce index 370c68f..aab2d3e 100644 --- a/cleaner.sce +++ b/cleaner.sce @@ -1,38 +1,64 @@ // This file is released under the 3-clause BSD license. See COPYING-BSD. // Generated by builder.sce: Please, do not edit this file -try - getversion("scilab"); -catch - error("Scilab 5.0 or more is required."); -end +oldmode = mode(); +oldlines = lines()(2); +lines(0); + function perform_clean() - root_tlbx = get_absolute_file_path('cleaner.sce'); + root_tlbx = get_absolute_file_path('cleaner.sce'); - if isfile(root_tlbx + '/macros/cleanmacros.sce') then - exec(root_tlbx+'/macros/cleanmacros.sce'); - end + if isfile(root_tlbx + '/macros/cleanmacros.sce') then + exec(root_tlbx+'/macros/cleanmacros.sce'); + else + if isdir(root_tlbx + "/macros/") then + deletefile(root_tlbx + "/macros/lib"); + binfiles = findfiles(root_tlbx + "/macros/", "*.bin"); + if ~isempty(binfiles) then + deletefile(root_tlbx + "/macros/" + binfiles); + end + end + end - if isfile(root_tlbx + '/src/cleaner_src.sce') then - exec(root_tlbx+'/src/cleaner_src.sce'); - end + if isfile(root_tlbx + "/src/cleaner_src.sce") then + exec(root_tlbx + "/src/cleaner_src.sce"); + mdelete(root_tlbx + "/src/cleaner_src.sce"); + end - if isfile(root_tlbx + "/sci_gateway/cleaner_gateway.sce") then - exec(root_tlbx + "/sci_gateway/cleaner_gateway.sce"); - mdelete(root_tlbx + "/sci_gateway/cleaner_gateway.sce"); - end + if isfile(root_tlbx + "/sci_gateway/cleaner_gateway.sce") then + exec(root_tlbx + "/sci_gateway/cleaner_gateway.sce"); + mdelete(root_tlbx + "/sci_gateway/cleaner_gateway.sce"); + end - if isfile(root_tlbx + "/help/cleaner_help.sce") then - exec(root_tlbx + "/help/cleaner_help.sce"); - end + if isfile(root_tlbx + "/help/cleaner_help.sce") then + exec(root_tlbx + "/help/cleaner_help.sce"); + else + if isdir(root_tlbx + "/jar/") then + rmdir(root_tlbx + "/jar/", "s"); + end + end - if isfile(root_tlbx + "/loader.sce") then - mdelete(root_tlbx + "/loader.sce"); - end + if isfile(root_tlbx + "/loader.sce") then + mdelete(root_tlbx + "/loader.sce"); + end - if isfile(root_tlbx + "/unloader.sce") then - mdelete(root_tlbx + "/unloader.sce"); - end + if isfile(root_tlbx + "/unloader.sce") then + mdelete(root_tlbx + "/unloader.sce"); + end endfunction -perform_clean(); -clear perform_clean; + +try + perform_clean(); +catch + [errmsg, tmp, nline, func] = lasterror(); + msg = "%s: error on line #%d: ""%s""\n"; + msg = msprintf(msg, func, nline, errmsg); + lines(oldlines); + mode(oldmode); + clear perform_clean oldlines oldmode tmp nline func errmsg; + error(msg); +end + +lines(oldlines) +mode(oldmode); +clear perform_clean oldlines oldmode; |