From 59052ecdf6c37c710a95d544af73e2f1bd07e4b0 Mon Sep 17 00:00:00 2001 From: Darcy Shen Date: Tue, 24 Oct 2023 16:02:13 +0800 Subject: [PATCH] [13_6] Upgrade to lolly 1.2.13/1.2.14 --- src/Plugins/Bibtex/bibtex.cpp | 3 ++- src/Plugins/Ghostscript/gs_utilities.cpp | 11 ++++++----- src/Plugins/LaTeX_Preview/latex_preview.cpp | 7 ++++--- src/Plugins/Metafont/tex_files.cpp | 13 +++++++------ src/Plugins/Qt/qt_printer_widget.cpp | 3 ++- src/Plugins/Tex/latex_recover.cpp | 3 ++- src/Scheme/L2/glue_lolly.lua | 2 +- src/Scheme/L2/init_glue_l2.cpp | 1 + src/System/Files/tm_file.cpp | 9 +++++---- src/System/Misc/tm_sys_utils.cpp | 3 ++- src/Texmacs/Server/tm_server.cpp | 3 ++- xmake/packages.lua | 11 +++-------- 12 files changed, 37 insertions(+), 32 deletions(-) diff --git a/src/Plugins/Bibtex/bibtex.cpp b/src/Plugins/Bibtex/bibtex.cpp index e928eaaf80..ef9cb0c425 100644 --- a/src/Plugins/Bibtex/bibtex.cpp +++ b/src/Plugins/Bibtex/bibtex.cpp @@ -16,6 +16,7 @@ #include "converter.hpp" #include "wencoding.hpp" #include "tree_helper.hpp" +#include "lolly/system/subprocess.hpp" static string bibtex_command= "bibtex"; @@ -200,7 +201,7 @@ bibtex_run (string bib, string style, url bib_file, tree bib_t) { debug_shell << cmdln << "\n"; } string log; - if (lolly::system (cmdln, log)) + if (lolly::system::check_output (cmdln, log)) bibtex_error << log << "\n"; else { int pos=0; diff --git a/src/Plugins/Ghostscript/gs_utilities.cpp b/src/Plugins/Ghostscript/gs_utilities.cpp index 462777947a..e6b944bda8 100644 --- a/src/Plugins/Ghostscript/gs_utilities.cpp +++ b/src/Plugins/Ghostscript/gs_utilities.cpp @@ -17,6 +17,7 @@ #include "file.hpp" #include "gs_utilities.hpp" #include "image_files.hpp" +#include "lolly/system/subprocess.hpp" #include "scheme.hpp" #include "sys_utils.hpp" #include "tm_file.hpp" @@ -355,7 +356,7 @@ gs_to_png (url image, url png, int w, int h) { // Achtung! w,h in pixels << " -c \" grestore \""; } if (os_win () || os_mingw ()) { - lolly::system (cmd); + lolly::system::call (cmd); } else { std::system (as_charp (cmd)); @@ -431,7 +432,7 @@ gs_to_pdf (url image, url pdf, int w, int h) { cmd << " -f " << sys_concretize (image); cmd << " -c \" grestore \" "; // debug_convert << cmd << LF; - lolly::system (cmd); + lolly::system::call (cmd); if (DEBUG_CONVERT) debug_convert << cmd << LF << "pdf generated? " << exists (pdf) << LF; } @@ -462,7 +463,7 @@ gs_to_pdf (url doc, url pdf, bool landscape, double paper_h, double paper_w) { // so we add some PS code to override the PDF document title with // the name of the PDF file. - lolly::system (cmd); + lolly::system::call (cmd); if (DEBUG_CONVERT) debug_convert << cmd << LF << "pdf generated? " << exists (pdf) << LF; } @@ -490,7 +491,7 @@ gs_to_ps (url doc, url ps, bool landscape, double paper_h, double paper_w) { // so we add some PS code to override the PS document title with // the name of the PS file. - lolly::system (cmd); + lolly::system::call (cmd); if (DEBUG_CONVERT) debug_convert << cmd << LF << "ps generated? " << exists (ps) << LF; } @@ -500,7 +501,7 @@ tm_gs (url image) { string cmd= gs_prefix (); cmd << "-q -sDEVICE=x11alpha -dBATCH -dNOPAUSE -dSAFER -dNOEPS "; cmd << sys_concretize (image); - lolly::system (cmd); + lolly::system::call (cmd); } bool diff --git a/src/Plugins/LaTeX_Preview/latex_preview.cpp b/src/Plugins/LaTeX_Preview/latex_preview.cpp index 13d876b17b..1c397e3ee8 100644 --- a/src/Plugins/LaTeX_Preview/latex_preview.cpp +++ b/src/Plugins/LaTeX_Preview/latex_preview.cpp @@ -18,6 +18,7 @@ #include "tm_file.hpp" #include "sys_utils.hpp" #include "tree_helper.hpp" +#include "lolly/system/subprocess.hpp" static inline void dbg (string s) { @@ -168,7 +169,7 @@ latex_load_preview (url wdir, bool dvips= false) { << "-dLanguageLevel=3 -sOutputFile=temp%d.eps temp.pdf"; } dbg ("GS command: " * cmdln); - if (lolly::system (cmdln)) { + if (lolly::system::call (cmdln)) { dbg ("Could not extract pictures from LaTeX document"); return array (); } @@ -213,7 +214,7 @@ latex_preview (string s, tree t) { << " -output-directory \"" << as_string (wdir) << "\" \"" << as_string (wdir) << "/temp.tex\""; dbg ("LaTeX command: " * cmdln); - if (lolly::system (cmdln)) { + if (lolly::system::call (cmdln)) { dbg ("Could not compile LaTeX document using " * latex_command); dbg ("Try to fallback on LaTeX"); dvips= true; @@ -224,7 +225,7 @@ latex_preview (string s, tree t) { << " -output-directory \"" << as_string (wdir) << "\" \"" << as_string (wdir) << "/temp.tex\""; dbg ("LaTeX command: " * cmdln); - if (lolly::system (cmdln)) { + if (lolly::system::call (cmdln)) { dbg ("Could not compile LaTeX document"); latex_clean_tmp_directory (wdir); return array (); diff --git a/src/Plugins/Metafont/tex_files.cpp b/src/Plugins/Metafont/tex_files.cpp index a5869192f5..9760e30233 100644 --- a/src/Plugins/Metafont/tex_files.cpp +++ b/src/Plugins/Metafont/tex_files.cpp @@ -19,6 +19,7 @@ #include "analyze.hpp" #include "tm_timer.hpp" #include "data_cache.hpp" +#include "lolly/system/subprocess.hpp" static url the_tfm_path= url_none (); static url the_pk_path = url_none (); @@ -129,7 +130,7 @@ make_tex_tfm (string name) { if (get_setting ("MAKETFM") == "MakeTeXTFM") { s= "MakeTeXTFM " * name; if (DEBUG_VERBOSE) debug_fonts << "Executing " << s << "\n"; - r= lolly::system (s); + r= lolly::system::call (s); } if (get_setting ("MAKETFM") == "mktextfm") { url tfm_dir ("$TEXMACS_HOME_PATH/fonts/tfm"); @@ -137,7 +138,7 @@ make_tex_tfm (string name) { string ("--destdir ") * as_string (tfm_dir) * " " * name; if (DEBUG_VERBOSE) debug_fonts << "Executing " << s << "\n"; - r= lolly::system (s); + r= lolly::system::call (s); string superfluous= name * ".600pk"; if (ends (name, ".tfm")) superfluous= name (0, N(name)-4) * ".600pk"; remove (tfm_dir * superfluous); @@ -148,7 +149,7 @@ make_tex_tfm (string name) { s = "maketfm --dest-dir \"" * get_env("$TEXMACS_HOME_PATH") * "\\fonts\\tfm\" " * name; if (DEBUG_VERBOSE) debug_fonts << "Executing " << s << "\n"; - r= lolly::system (s); + r= lolly::system::call (s); } if (r) cout << "TeXmacs] system command failed: " << s << "\n"; } @@ -162,7 +163,7 @@ make_tex_pk (string name, int dpi, int design_dpi) { as_string (dpi) * " " * as_string (design_dpi) * " " * as_string (dpi) * "/" * as_string (design_dpi) * " localfont"; if (DEBUG_VERBOSE) debug_fonts << "Executing " << s << "\n"; - r= lolly::system (s); + r= lolly::system::call (s); } if (get_setting ("MAKEPK") == "mktexpk") { url pk_dir ("$TEXMACS_HOME_PATH/fonts/pk"); @@ -173,7 +174,7 @@ make_tex_pk (string name, int dpi, int design_dpi) { string ("--destdir ") * as_string (pk_dir) * " " * name; if (DEBUG_VERBOSE) debug_fonts << "Executing " << s << "\n"; - r= lolly::system (s); + r= lolly::system::call (s); } if (get_setting ("MAKEPK") == "makepk") { #ifdef OS_WIN @@ -188,7 +189,7 @@ make_tex_pk (string name, int dpi, int design_dpi) { * " " * as_string(dpi) * "/" * as_string(design_dpi); #endif if (DEBUG_VERBOSE) debug_fonts << "Executing " << s << "\n"; - r= lolly::system (s); + r= lolly::system::call (s); } if (r) cout << "TeXmacs] system command failed: " << s << "\n"; } diff --git a/src/Plugins/Qt/qt_printer_widget.cpp b/src/Plugins/Qt/qt_printer_widget.cpp index 3856c2bf66..6f58482357 100644 --- a/src/Plugins/Qt/qt_printer_widget.cpp +++ b/src/Plugins/Qt/qt_printer_widget.cpp @@ -15,6 +15,7 @@ #include "qt_printer_widget.hpp" #include "qt_utilities.hpp" // check_type #include "message.hpp" // slot definitions +#include "lolly/system/subprocess.hpp" #include "QTMPrintDialog.hpp" #include "QTMPrinterSettings.hpp" @@ -92,7 +93,7 @@ qt_printer_widget_rep::showDialog () { // Send the document to the printer if (DEBUG_QT_WIDGETS) debug_widgets << "Running print command: " << from_qstring(_cmd) << "\n"; - lolly::system(from_qstring(_cmd)); // FIXME? qt_system is synchronous (blocking!) + lolly::system::call (from_qstring (_cmd)); // FIXME? qt_system is synchronous (blocking!) // execute the scheme closure if (!is_nil (commandAfterExecution)) diff --git a/src/Plugins/Tex/latex_recover.cpp b/src/Plugins/Tex/latex_recover.cpp index 2c4ef26b36..33028182ca 100644 --- a/src/Plugins/Tex/latex_recover.cpp +++ b/src/Plugins/Tex/latex_recover.cpp @@ -18,6 +18,7 @@ #include "sys_utils.hpp" #include "scheme.hpp" #include "tree_label.hpp" +#include "lolly/system/subprocess.hpp" tree latex_expand (tree doc, url name); bool tracked_tree_to_latex_document (tree, object, string&, string&); @@ -278,7 +279,7 @@ try_latex_export (tree doc, object opts, url src, url dest) { "cd " * sys_concretize (head (dest)) * "; pdflatex -interaction=batchmode " * as_system_string (tail (dest)); //cout << cmd << LF; - lolly::system (cmd); + lolly::system::call (cmd); url log= glue (unglue (dest, N (suffix (dest))), "log"); tree errs= get_latex_errors (log); tree r (TUPLE); diff --git a/src/Scheme/L2/glue_lolly.lua b/src/Scheme/L2/glue_lolly.lua index e3e972844e..2058a25d2a 100644 --- a/src/Scheme/L2/glue_lolly.lua +++ b/src/Scheme/L2/glue_lolly.lua @@ -483,7 +483,7 @@ function main() }, { scm_name = "system", - cpp_name = "lolly::system", + cpp_name = "lolly::system::call", ret_type = "void", arg_list = { "string", diff --git a/src/Scheme/L2/init_glue_l2.cpp b/src/Scheme/L2/init_glue_l2.cpp index ca8ee16796..acddbad3d9 100644 --- a/src/Scheme/L2/init_glue_l2.cpp +++ b/src/Scheme/L2/init_glue_l2.cpp @@ -18,6 +18,7 @@ #include "base64.hpp" #include "file.hpp" #include "locale.hpp" +#include "lolly/system/subprocess.hpp" #include "sys_utils.hpp" #include "tree.hpp" diff --git a/src/System/Files/tm_file.cpp b/src/System/Files/tm_file.cpp index 5c1facab38..a195556bff 100644 --- a/src/System/Files/tm_file.cpp +++ b/src/System/Files/tm_file.cpp @@ -22,6 +22,7 @@ #include "tree_label.hpp" #include "tree_helper.hpp" #include "sys_utils.hpp" +#include "lolly/system/subprocess.hpp" #include #include @@ -48,13 +49,13 @@ #include "data_cache.hpp" void system (string which, url u1) { - lolly::system (which * " " * sys_concretize (u1)); } + lolly::system::call (which * " " * sys_concretize (u1)); } void system (string which, url u1, url u2) { - lolly::system (which * " " * sys_concretize (u1) * " " * sys_concretize (u2)); } + lolly::system::call (which * " " * sys_concretize (u1) * " " * sys_concretize (u2)); } void system (string which, url u1, const char* post) { - lolly::system (which * " " * sys_concretize (u1) * " " * post); } + lolly::system::call (which * " " * sys_concretize (u1) * " " * post); } void system (string which, url u1, const char* sep, url u2) { - lolly::system (which * " " * sys_concretize (u1) * " " * sep * + lolly::system::call (which * " " * sys_concretize (u1) * " " * sep * " " * sys_concretize (u2)); } /****************************************************************************** diff --git a/src/System/Misc/tm_sys_utils.cpp b/src/System/Misc/tm_sys_utils.cpp index 20e226f6a5..1f3d6d8b74 100644 --- a/src/System/Misc/tm_sys_utils.cpp +++ b/src/System/Misc/tm_sys_utils.cpp @@ -15,6 +15,7 @@ #include "url.hpp" #include "file.hpp" #include "tm_file.hpp" +#include "lolly/system/subprocess.hpp" #if defined(OS_MINGW) || defined(OS_WIN) #include "Windows/win_sys_utils.hpp" @@ -55,7 +56,7 @@ eval_system (string s) { return ""; #else string result; - (void) lolly::system (s, result); + (void) lolly::system::check_output (s, result); return result; #endif } diff --git a/src/Texmacs/Server/tm_server.cpp b/src/Texmacs/Server/tm_server.cpp index d528d6f948..265aa6e0b3 100644 --- a/src/Texmacs/Server/tm_server.cpp +++ b/src/Texmacs/Server/tm_server.cpp @@ -24,6 +24,7 @@ #include "sys_utils.hpp" #include "tm_link.hpp" #include "tm_sys_utils.hpp" +#include "lolly/system/subprocess.hpp" server* the_server = NULL; bool texmacs_started= false; @@ -296,5 +297,5 @@ tm_server_rep::quit () { void tm_server_rep::shell (string s) { - lolly::system (s); + lolly::system::call (s); } diff --git a/xmake/packages.lua b/xmake/packages.lua index 02bfabee81..371e95366b 100644 --- a/xmake/packages.lua +++ b/xmake/packages.lua @@ -19,8 +19,8 @@ -- [ ] portage powered -- ... -local LOLLY_VERSION = "1.2.12" -local TBOX_VERSION = "1.7.4" +local LOLLY_VERSION = "main" +local TBOX_VERSION = "dev" local CPR_VERSION = "1.10.5" local CURL_VERSION = "8.4.0" @@ -80,12 +80,7 @@ function add_requires_of_mogan() set_configvar("LOLLY_VERSION", LOLLY_VERSION) add_requires("lolly", {system=false}) tbox_configs = {hash=true, ["force-utf8"]=true} - if is_plat("wasm") then - tbox_version = "dev" - else - tbox_version = "v" .. TBOX_VERSION - end - add_requireconfs("lolly.tbox", {version = tbox_version, configs=tbox_configs, system = false, override=true}) + add_requireconfs("lolly.tbox", {version = TBOX_VERSION, configs=tbox_configs, system = false, override=true}) add_requireconfs("lolly.cpr", {version = CPR_VERSION, system = false, override=true}) add_requireconfs("lolly.cpr.libcurl", {version = CURL_VERSION, system = false, override=true})