From f56c49767ca0c0306b8b7200b5e7f0eb1949deed Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Tue, 20 Dec 2016 21:02:20 +0100 Subject: [PATCH] Added script for creating release packages. --- include/MUtils/Global.h | 4 ++-- z_mkpack.bat | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 z_mkpack.bat diff --git a/include/MUtils/Global.h b/include/MUtils/Global.h index 2faaa3b..5f7741f 100644 --- a/include/MUtils/Global.h +++ b/include/MUtils/Global.h @@ -258,7 +258,7 @@ namespace MUtils /** * \brief Clean up a file name string * - * This function ensures that the given string is a valid file (or directory) name. It does so by replacing any illegal characters, i.e. any characters *not* allowed in file names (which explicitly *includes* directory separators). Furthermore, the function will trim/remove specific characters that are *not* allowed directly at the beginning or end of a file name. Finally, the function takes care or special "reserved" file names that are forbidden by the file system. You can use this function to convert user inputs into a valid file name. + * This function ensures that the given string is a valid file (or directory) name. It does so by replacing any illegal characters, i.e. any characters *not* allowed in file names (which explicitly *includes* directory separators). Furthermore, the function will trim/remove specific characters that are *not* allowed directly at the beginning or end of a file name. Finally, the function takes care of special "reserved" file names that are forbidden by the file system. You can use this function to convert user inputs into a valid file name. * * \param list A read-only reference to the QString holding the original, potentially invalid file name. * @@ -269,7 +269,7 @@ namespace MUtils /** * \brief Clean up a file path string * - * This function ensures that the given string is a valid file (or directory) path. It does so by replacing any illegal characters, i.e. any characters *not* allowed in file paths. Directory separators are preserved, but they will be "canonicalized". Furthermore, in each path component, the function will trim/remove specific characters that are *not* allowed directly at the beginning or end of a path component. Finally, the function takes care or special "reserved" file names that are forbidden by the file system. You can use this function to convert user inputs into a valid file path. + * This function ensures that the given string is a valid file (or directory) path. It does so by replacing any illegal characters, i.e. any characters *not* allowed in file paths. Directory separators are preserved, but they will be "canonicalized". Furthermore, in each path component, the function will trim/remove specific characters that are *not* allowed directly at the beginning or end of a path component. Finally, the function takes care of special "reserved" file names that are forbidden by the file system. You can use this function to convert user inputs into a valid file path. * * \param list A read-only reference to the QString holding the original, potentially invalid file path. * diff --git a/z_mkpack.bat b/z_mkpack.bat new file mode 100644 index 0000000..b2361e5 --- /dev/null +++ b/z_mkpack.bat @@ -0,0 +1,31 @@ +@echo off +set "GIT_PATH=c:\Program Files\Git" +set "PATH=%GIT_PATH%;%GIT_PATH%\mingw64\bin;%GIT_PATH%\usr\bin;%PATH%" +set "OUT_PATH=%TEMP%\~%RANDOM%%RANDOM%.tmp" + +mkdir "%OUT_PATH%" +mkdir "%OUT_PATH%\MUtilities" + +call::git_export "%~dp0\." MUtilities + +pushd "%OUT_PATH%" +tar -cvf ./sources.tar * +"%~dp0\..\Prerequisites\SevenZip\7za.exe" a -txz "%~dp0\~sources.tar.xz" "sources.tar" +popd + +pushd "%~dp0" +rmdir /S /Q "%OUT_PATH%" + +pause +exit + + +:git_export +pushd "%~1" +git archive --verbose --output "%OUT_PATH%\%~2.tar" MASTER +popd +pushd "%OUT_PATH%\%~2" +tar -xvf "../%~2.tar" +del "%OUT_PATH%\%~2.tar" +popd +goto:eof -- 2.11.4.GIT