From 5d48c3fcd8545ab4cd566ffc255ac7ae9cfe0c40 Mon Sep 17 00:00:00 2001 From: mazzol_a Date: Fri, 23 May 2025 11:41:56 +0200 Subject: [PATCH] adresses review comments --- slsDetectorServers/compileAllServers.sh | 16 ++++++++++------ slsDetectorServers/compileEigerServer.sh | 15 +++++++++------ slsDetectorServers/ctbDetectorServer/Makefile | 3 +-- slsSupportLib/include/sls/Version.h | 2 +- slsSupportLib/src/Version.cpp | 2 +- updateAPIVersion.py | 2 +- 6 files changed, 23 insertions(+), 17 deletions(-) diff --git a/slsDetectorServers/compileAllServers.sh b/slsDetectorServers/compileAllServers.sh index 489c6be92..005c0d623 100755 --- a/slsDetectorServers/compileAllServers.sh +++ b/slsDetectorServers/compileAllServers.sh @@ -11,8 +11,11 @@ det_list=("ctbDetectorServer ) usage="\nUsage: compileAllServers.sh [server|all(opt)] [update_api(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tupdate_api if true updates the api to version in VERSION file" -update_api=false -target=clean +update_api=true +target=version + + + # arguments if [ $# -eq 0 ]; then # no argument, all servers @@ -38,9 +41,8 @@ elif [ $# -eq 1 ] || [ $# -eq 2 ]; then if [ $# -eq 2 ]; then update_api=$2 - if $update_api ; then - target=version - echo "updating api to $(cat ../VERSION)" + if not $update_api ; then + target=clean fi fi else @@ -52,6 +54,9 @@ declare -a deterror=("OK" "OK" "OK" "OK" "OK" "OK") echo -e "list is ${det[@]}" +if $update_api; then + echo "updating api to $(cat ../VERSION)" +fi # compile each server idet=0 for i in ${det[@]} @@ -68,7 +73,6 @@ do fi mv bin/$dir bin/$file git add -f bin/$file - cp bin/$file /tftpboot/ cd .. echo -e "\n\n" ((++idet)) diff --git a/slsDetectorServers/compileEigerServer.sh b/slsDetectorServers/compileEigerServer.sh index 37aefee6a..f5873dff8 100755 --- a/slsDetectorServers/compileEigerServer.sh +++ b/slsDetectorServers/compileEigerServer.sh @@ -6,21 +6,25 @@ file="${dir}_developer" usage="\nUsage: compileAllServers.sh [update_api(opt)]. \n\t update_api if true updates the api to version in VERSION file" -update_api=false -target=clean +update_api=true +target=version # arguments if [ $# -eq 1 ]; then update_api=$1 - if $update_api ; then - target=version - echo "updating api to $(cat ../VERSION)" + if not $update_api ; then + target=clean + fi elif [ ! $# -eq 0 ]; then echo -e "Only one optional argument allowed for update_api." return -1 fi +if $update_api; then + echo "updating api to $(cat ../VERSION)" +fi + echo -e "Compiling $dir [$file]" cd $dir if make $target; then @@ -31,7 +35,6 @@ fi mv bin/$dir bin/$file git add -f bin/$file -cp bin/$file /tftpboot/ cd .. echo -e "\n\n" printf "Result:\t\t= %s\n" "${deterror}" diff --git a/slsDetectorServers/ctbDetectorServer/Makefile b/slsDetectorServers/ctbDetectorServer/Makefile index 22547fdc5..0b56dd825 100755 --- a/slsDetectorServers/ctbDetectorServer/Makefile +++ b/slsDetectorServers/ctbDetectorServer/Makefile @@ -33,7 +33,6 @@ versioning: $(PROGS): $(OBJS) # echo $(OBJS) - cd $(current_dir) mkdir -p $(DESTDIR) $(CC) -o $@ $^ $(CFLAGS) $(LDLIBS) mv $(PROGS) $(DESTDIR) @@ -41,7 +40,7 @@ $(PROGS): $(OBJS) rm $(main_src)*.o $(md5_dir)*.o clean: - cd $(current_dir) && rm -rf $(DESTDIR)/$(PROGS) *.o *.gdb $(main_src)*.o $(md5_dir)*.o + rm -rf $(DESTDIR)/$(PROGS) *.o *.gdb $(main_src)*.o $(md5_dir)*.o diff --git a/slsSupportLib/include/sls/Version.h b/slsSupportLib/include/sls/Version.h index e4ec31631..6e97873e4 100644 --- a/slsSupportLib/include/sls/Version.h +++ b/slsSupportLib/include/sls/Version.h @@ -11,7 +11,7 @@ class Version { private: std::string version_; std::string date_; - inline static const std::string defaultBranch_[] = {"developer", "0.0.0"}; + inline static const std::string defaultVersion_[] = {"developer", "0.0.0"}; public: explicit Version(const std::string &s); diff --git a/slsSupportLib/src/Version.cpp b/slsSupportLib/src/Version.cpp index 3ace46217..03aeb5339 100644 --- a/slsSupportLib/src/Version.cpp +++ b/slsSupportLib/src/Version.cpp @@ -22,7 +22,7 @@ Version::Version(const std::string &s) { bool Version::hasSemanticVersioning() const { - return (version_ != defaultBranch_[0]) && (version_ != defaultBranch_[1]); + return (version_ != defaultVersion_[0]) && (version_ != defaultVersion_[1]); } std::string Version::getVersion() const { return version_; } diff --git a/updateAPIVersion.py b/updateAPIVersion.py index 934df081d..4d0cf7ccf 100644 --- a/updateAPIVersion.py +++ b/updateAPIVersion.py @@ -20,7 +20,7 @@ VERSION_FILE = SCRIPT_DIR + "/VERSION" parser = argparse.ArgumentParser(description = 'updates API version') parser.add_argument('api_module_name', choices=["APILIB", "APIRECEIVER", "APICTB", "APIGOTTHARD2", "APIMOENCH", "APIEIGER", "APIXILINXCTB", "APIJUNGFRAU", "APIMYTHEN3"], help = 'module name to change api version options are: ["APILIB", "APIRECEIVER", "APICTB", "APIGOTTHARD2", "APIMOENCH", "APIEIGER", "APIXILINXCTB", "APIJUNGFRAU", "APIMYTHEN3"]') -parser.add_argument('api_dir', help = 'Relative or absolut path to the module code') +parser.add_argument('api_dir', help = 'Relative or absolute path to the module code') def update_api_file(new_api : str, api_module_name : str, api_file_name : str):