diff --git a/LCG_Interfaces/Boost/CMakeLists.txt b/LCG_Interfaces/Boost/CMakeLists.txt deleted file mode 100644 index f845ed33f5842c42a1b9337d5bdf3b2098cdab5d..0000000000000000000000000000000000000000 --- a/LCG_Interfaces/Boost/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -################################################################################ -# Package: Boost -################################################################################ - -# Declare the package name: -atlas_subdir( Boost ) - -# External dependencies: -find_package( PythonLibs ) - diff --git a/LCG_Interfaces/Boost/cmt/fragments/nmake/pythonmodulebuilder b/LCG_Interfaces/Boost/cmt/fragments/nmake/pythonmodulebuilder deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/LCG_Interfaces/Boost/cmt/fragments/pythonmodulebuilder b/LCG_Interfaces/Boost/cmt/fragments/pythonmodulebuilder deleted file mode 100755 index f995ba0b9737ede903efee58e3915437ef6bb0cc..0000000000000000000000000000000000000000 --- a/LCG_Interfaces/Boost/cmt/fragments/pythonmodulebuilder +++ /dev/null @@ -1,7 +0,0 @@ -${CONSTITUENT} :: ${FILEPATH}$(library_prefix)${NAME}${FILESUFFIX} - cp $? ${FILEPATH}`echo ${NAME} | cut -c4-`${FILESUFFIX} - - -${CONSTITUENT}clean :: - /bin/rm -f ${FILEPATH}`echo ${NAME} | cut -c4-`${FILESUFFIX} - diff --git a/LCG_Interfaces/Boost/cmt/requirements b/LCG_Interfaces/Boost/cmt/requirements deleted file mode 100755 index 6578c4c381058f3565c6c6eeb5c4245ca680057b..0000000000000000000000000000000000000000 --- a/LCG_Interfaces/Boost/cmt/requirements +++ /dev/null @@ -1,94 +0,0 @@ -package Boost - -use LCG_Configuration v* -use LCG_Settings v* -use Python v* LCG_Interfaces -no_auto_imports - -macro Boost_native_version "$(Boost_config_version)_python$(Python_config_version_twodigit)" -# 'sed' is not available on windows, I've moved this macro to the LCG_Configuration -# macro Boost_file_version "`echo $(Boost_native_version) | sed 's/\./_/g'`" - -#handle debug builds properly -macro Boost_debug "" \ - target-dbg "d-" - -macro Boost_home $(LCG_external)/Boost/$(Boost_native_version)/$(LCG_system) - -include_path none -macro Boost_include $(Boost_home)/include/boost-$(Boost_file_version) - -# silence warnings from gcc48 and later -macro Boost_pp_cppflags "-isystem $(Boost_home)/include/boost-$(Boost_file_version) " - -macro Boost_compiler_version "$(LCG_compiler)" \ - target-icc "$(gcc2icc)" \ - target-clang "$(gcc2clang)" \ - target-gccmax "$(gcc2max)" \ - target-g11max "$(gcc2g11)" \ - target-gcc42&target-darwin "xgcc42" \ - target-llvm42&target-darwin "xgcc42" \ - target-gcc40&target-darwin "xgcc40" \ - target-vc9 "vc90" - -macro Boost_linkopts "-L$(Boost_home)/lib " \ - target-win "/LIBPATH:$(Boost_home)/lib " - -macro Boost_linkopts_python " -lboost_python-$(Boost_compiler_version)-mt-$(Boost_debug)$(Boost_file_version) " \ - target-win " boost_python-$(Boost_compiler_version)-mt-$(Boost_file_version).lib " - -macro Boost_linkopts_system " -lboost_system-$(Boost_compiler_version)-mt-$(Boost_debug)$(Boost_file_version) " \ - target-win " boost_system-$(Boost_compiler_version)-mt-$(Boost_file_version).lib " - -macro Boost_linkopts_filesystem " -lboost_filesystem-$(Boost_compiler_version)-mt-$(Boost_debug)$(Boost_file_version) " \ - target-win " boost_filesystem-$(Boost_compiler_version)-mt-$(Boost_file_version).lib " - -macro Boost_linkopts_filesystem_mt " -lboost_filesystem-$(Boost_compiler_version)-mt-$(Boost_debug)$(Boost_file_version) " \ - target-win " boost_filesystem-$(Boost_compiler_version)-mt-$(Boost_file_version).lib " - -macro Boost_linkopts_iostreams " -lboost_iostreams-$(Boost_compiler_version)-mt-$(Boost_debug)$(Boost_file_version) " \ - target-win " boost_iostreams-$(Boost_compiler_version)-mt-$(Boost_file_version).lib " - -macro Boost_linkopts_regex " -lboost_regex-$(Boost_compiler_version)-mt-$(Boost_debug)$(Boost_file_version) " \ - target-win " boost_regex-$(Boost_compiler_version)-mt-$(Boost_file_version).lib " - -macro Boost_linkopts_thread " -lboost_thread-$(Boost_compiler_version)-mt-$(Boost_debug)$(Boost_file_version) " \ - target-win " boost_thread-$(Boost_compiler_version)-mt-$(Boost_file_version).lib " - -macro Boost_linkopts_program_options " -lboost_program_options-$(Boost_compiler_version)-mt-$(Boost_debug)$(Boost_file_version) " \ - target-win " boost_program_options-$(Boost_compiler_version)-mt-$(Boost_file_version).lib " - -macro Boost_linkopts_serialization " -lboost_serialization-$(Boost_compiler_version)-mt-$(Boost_debug)$(Boost_file_version) " \ - target-win " boost_serialization-$(Boost_compiler_version)-mt-$(Boost_file_version).lib " - -macro Boost_linkopts_date_time " -lboost_date_time-$(Boost_compiler_version)-mt-$(Boost_debug)$(Boost_file_version) " \ - target-win " boost_date_time-$(Boost_compiler_version)-mt-$(Boost_file_version).lib " - -macro Boost_linkopts_graph " -lboost_graph-$(Boost_compiler_version)-mt-$(Boost_debug)$(Boost_file_version) " \ - target-win " boost_graph-$(Boost_compiler_version)-mt-$(Boost_file_version).lib " - -# Setup CMT dependency optimization macros -macro Boost_header_file_filter $(Boost_home)/include/boost-$(Boost_file_version) -macro Boost_header_file_stamp $(Boost_home)/include/boost-$(Boost_file_version)/boost/any.hpp - -apply_pattern set_lib_path -apply_pattern set_root_include_path - -macro_append cppflags "" target-win " /DBOOST_ALL_DYN_LINK /wd4275 /wd4251 " - -# Special tag for using date_time with nano sec resolution -macro_append cppflags "" USE_BOOST_TIME_WITH_NSEC_RESOLUTION " -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG " -macro_append Boost_linkopts "" USE_BOOST_TIME_WITH_NSEC_RESOLUTION " $(Boost_linkopts_date_time) " - -make_fragment pythonmodulebuilder - -pattern lcg_python_module \ - library <name> -import=Python -import=Boost <files> ;\ - macro <name>_shlibflags "$(libraryshr_linkopts) $(use_linkopts)" ;\ - document pythonmodulebuilder pymodule $(bin)<name>.so ;\ - macro_remove constituents "" target-win "pymodule" ;\ - macro_append <name>_cppflags " -ftemplate-depth-64" target-win "" ;\ - path_remove PYTHONPATH "/<package>/" target-win "\<package>\" ;\ - path_append PYTHONPATH $(<PACKAGE>ROOT)/$(tag) - -macro Boost_export_paths "$(Boost_home)" - diff --git a/LCG_Interfaces/CLHEP/CMakeLists.txt b/LCG_Interfaces/CLHEP/CMakeLists.txt deleted file mode 100644 index 1329eeee2f0dbe1f33efd6c7f2b73c576438000f..0000000000000000000000000000000000000000 --- a/LCG_Interfaces/CLHEP/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -################################################################################ -# Package: CLHEP -################################################################################ - -# Declare the package name: -atlas_subdir( CLHEP ) - -# this line failed automatic conversion in cmt2cmake : -# macro CLHEP_linkopts "-L$(CLHEP_home)/lib -lCLHEP-$(CLHEP_native_version) - diff --git a/LCG_Interfaces/CLHEP/cmt/requirements b/LCG_Interfaces/CLHEP/cmt/requirements deleted file mode 100644 index 5cd3d19000e7e12c0908b7420708d3891f6afdf4..0000000000000000000000000000000000000000 --- a/LCG_Interfaces/CLHEP/cmt/requirements +++ /dev/null @@ -1,23 +0,0 @@ -package CLHEP - -use LCG_Configuration v* -use LCG_Settings v* - -# Use CLHEP 2.2.0.4 -macro CLHEP_native_version "2.2.0.4" - -# overwrite with fixed location, needed for newer LCGs -macro CLHEP_home "${SITEROOT}/sw/lcg/external/clhep/$(CLHEP_native_version)/$(LCG_system)" -macro CLHEP_include "$(CLHEP_home)/include" - -include_path none -include_dirs $(CLHEP_home)/include - -macro CLHEP_linkopts "-L$(CLHEP_home)/lib \ - -lCLHEP-$(CLHEP_native_version) - -macro CLHEP_name "clhep" -apply_pattern set_lib_path -apply_pattern set_root_include_path - -macro CLHEP_export_paths "$(CLHEP_home)/include $(CLHEP_home)/lib" diff --git a/PackDist/CMakeLists.txt b/PackDist/CMakeLists.txt deleted file mode 100644 index 8da3a1343637f9f86fb1414591b36c86deb1a0c5..0000000000000000000000000000000000000000 --- a/PackDist/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -################################################################################ -# Package: PackDist -################################################################################ - -# Declare the package name: -atlas_subdir( PackDist ) diff --git a/PackDist/cmt/fragments/help2doc b/PackDist/cmt/fragments/help2doc deleted file mode 100644 index bbcb2d1491d2acc29f97a4e135632eb3841aa8aa..0000000000000000000000000000000000000000 --- a/PackDist/cmt/fragments/help2doc +++ /dev/null @@ -1,17 +0,0 @@ -# File: PackDist/cmt/fragments/help2doc -# Author: Grigori Rybkine <Grigori.Rybkine@cern.ch> - -MAN_${NAME}_${FILEEXTENSION} = ../man/man1/${FILENAME}.1 -HTML_${NAME}_${FILEEXTENSION} = ../doc/html/${FILENAME}.html - -$(MAN_${NAME}_${FILEEXTENSION}) : ${FULLNAME} - mkdir -p $(@D) - help2man -o $@ -n "$(doc_${NAME}_${FILEEXTENSION})" \ - -m "Packaging and Distribution Tools" -N -h -h -v -v $< - -$(HTML_${NAME}_${FILEEXTENSION}) : $(MAN_${NAME}_${FILEEXTENSION}) - mkdir -p $(@D) - man2html $< >|$@ - -MAN += $(MAN_${NAME}_${FILEEXTENSION}) -HTML += $(HTML_${NAME}_${FILEEXTENSION}) diff --git a/PackDist/cmt/fragments/help2doc_header b/PackDist/cmt/fragments/help2doc_header deleted file mode 100644 index 93d2ba068c62b0bfef5352c787014d64f50e2387..0000000000000000000000000000000000000000 --- a/PackDist/cmt/fragments/help2doc_header +++ /dev/null @@ -1,5 +0,0 @@ -# File: PackDist/cmt/fragments/help2doc_header -# Author: Grigori Rybkine <Grigori.Rybkine@cern.ch> - -# This file is left empty on purpose - diff --git a/PackDist/cmt/fragments/help2doc_trailer b/PackDist/cmt/fragments/help2doc_trailer deleted file mode 100644 index 1c0a3acf2200fb45a92e15396c1aa90f724657d7..0000000000000000000000000000000000000000 --- a/PackDist/cmt/fragments/help2doc_trailer +++ /dev/null @@ -1,9 +0,0 @@ -# File: PackDist/cmt/fragments/help2doc_trailer -# Author: Grigori Rybkine <Grigori.Rybkine@cern.ch> - -${CONSTITUENT} :: $(MAN) $(HTML) - $(echo) ${CONSTITUENT} done - -${CONSTITUENT}clean :: - $(cleanup_echo) $(MAN) $(HTML) - $(cleanup_silent) \rm -f $(MAN) $(HTML) diff --git a/PackDist/cmt/fragments/pack_install b/PackDist/cmt/fragments/pack_install deleted file mode 100755 index 5d66c2ef2ae5687c419f3e1fe258e101f8104839..0000000000000000000000000000000000000000 --- a/PackDist/cmt/fragments/pack_install +++ /dev/null @@ -1,56 +0,0 @@ -# File: PackDist/cmt/fragments/pack_install -# Author: Grigori Rybkine <Grigori.Rybkine@cern.ch> - -# Install the most recently modified (binary, if available) package -# from repository PACKREPO in directory PACKINSTALL - -PKG = $(PACKINSTALL)/pkg -UNPACK = $(PACKINSTALL)/pacman -DOWNLOAD = $(PACKINSTALL)/pacman-latest.tar.gz -URL = http://atlas-computing.web.cern.ch/atlas-computing/links/monolith -#URL = http://physics.bu.edu/pacman/sample_cache/tarballs - -.PHONY: ${CONSTITUENT} ${CONSTITUENT}clean -.PHONY: get $(PKG) - -${CONSTITUENT} :: get - -get : $(PKG) $(UNPACK) - cd $(UNPACK); . ./setup.sh; cd -; \ - cd $(<D); \ - pacman -allow trust-all-caches tar-overwrite; \ - pacman -get `cat $(<F)` -ask none; retval=$$?; \ - rm -f $(<F); exit $$retval - -$(PKG) : $(PACKREPO) - @find $(<) -type f -name "*.pacman" >$(bin)pkglist - @test -s $(bin)pkglist || { echo Empty repository: $<; exit 1; } - @rm -f $(bin)pkg - @ls -1t `cat $(bin)pkglist` | grep '\(opt\|dbg\)[^/]*\.pacman' | head -n 1 | \ - sed -e 's!\(.*\)/\([^/]\{1,\}\)!\1:\2!' -e 's!\.pacman!!' >$(bin)pkg - @test -s $(bin)pkg || { echo No binary packages in repository: $<; \ - rm -f $(bin)pkg; \ - ls -1t `cat $(bin)pkglist` | head -n 1 | \ - sed -e 's!\(.*\)/\([^/]\{1,\}\)!\1:\2!' -e 's!\.pacman!!' >$(bin)pkg; } - @mkdir -p $(@D) - @cp -p $(bin)pkg $@ - @echo Package: `cat $@` - -$(PACKREPO) : - @echo No such repository: $@; exit 1 - -$(UNPACK) : $(DOWNLOAD) - rm -f $@ - mkdir -p $(@D) - cd $(@D); tar zxf $< - @top=`ls -1dt \`find $(@D) -maxdepth 1 -type d -name "pacman-*"\`|head -n 1`; \ - test -d "$$top" || { echo Cannot find pacman: $(@D); ls -ltr; exit 1; }; \ - ln -sfnv `basename $$top` $@ - -$(DOWNLOAD) : - mkdir -p $(@D) - cd $(@D); $(urlget) $(URL)/$(@F) - -${CONSTITUENT}clean :: - $(cleanup_echo) $(PACKINSTALL)/* - $(cleanup_silent) \rm -rf $(PACKINSTALL)/* diff --git a/PackDist/cmt/fragments/pack_install_header b/PackDist/cmt/fragments/pack_install_header deleted file mode 100755 index 20da337252e9ca730803965c5d0898a9ed6b19f2..0000000000000000000000000000000000000000 --- a/PackDist/cmt/fragments/pack_install_header +++ /dev/null @@ -1,8 +0,0 @@ -# File: PackDist/cmt/fragments/pack_install_header -# Author: Grigori Rybkine <Grigori.Rybkine@cern.ch> - -${CONSTITUENT} :: - @\printf "\n%s\n\n" \ - "$(version_info)" - -# End of file: PackDist/cmt/fragments/pack_install_header diff --git a/PackDist/cmt/fragments/pack_run b/PackDist/cmt/fragments/pack_run deleted file mode 100755 index 07e8fe956126a11a2fcfcca5bb7c58470ab154a2..0000000000000000000000000000000000000000 --- a/PackDist/cmt/fragments/pack_run +++ /dev/null @@ -1,22 +0,0 @@ -# File: PackDist/cmt/fragments/pack_run -# Author: Grigori Rybkine <Grigori.Rybkine@cern.ch> - -# Pack... - -.PHONY: ${CONSTITUENT} ${CONSTITUENT}clean - -${CONSTITUENT} :: $(PACKREPO) - test -d $(PACKREPO) || mkdir $(PACKREPO) - if [ -n "`printenv PACKCFG`" ]; then \ - $(FULLNAME) $(PACKOPTS) -C $(PACKREPO) -L $(bin) $(PACKEXTRAOPTS);\ - else \ - $(FULLNAME) -c $(PACKCFG) $(PACKOPTS) -C $(PACKREPO) -L $(bin) $(PACKEXTRAOPTS); fi - -$(PACKREPO) : - mkdir $(PACKREPO) - -${CONSTITUENT}clean :: - $(cleanup_echo) $(PACKREPO)/* - $(cleanup_silent) \rm -rf $(PACKREPO)/* - $(cleanup_echo) ../run - $(cleanup_silent) test ! -d ../run || \rm -rf ../run diff --git a/PackDist/cmt/fragments/pack_run_header b/PackDist/cmt/fragments/pack_run_header deleted file mode 100755 index b11690832d038e4365f2bf1f9a8672aad84b7655..0000000000000000000000000000000000000000 --- a/PackDist/cmt/fragments/pack_run_header +++ /dev/null @@ -1,5 +0,0 @@ -# File: PackDist/cmt/fragments/pack_run_header -# Author: Grigori Rybkine <Grigori.Rybkine@cern.ch> - -# This file is left empty on purpose - diff --git a/PackDist/config/pack-nightly-bugfix.cfg b/PackDist/config/pack-nightly-bugfix.cfg deleted file mode 100755 index da342f5da33a927935926d944d051829fad1f3e8..0000000000000000000000000000000000000000 --- a/PackDist/config/pack-nightly-bugfix.cfg +++ /dev/null @@ -1,34 +0,0 @@ -# This is a configuration file for the pack-run.sh script. -# -# The configuration files read by the script are defaults.cfg, -# ~/.pack.cfg, the file specified in the environment variable PACKCFG, -# the file specified with the -c command line option -# (values from "earlier" files are overridden by "later" files). -# -# The format is: option = value # comments -# or: option : value # comments -# -# (Command line options override values from the configuration files.) -# -# Report bugs to <Grigori.Rybkine@cern.ch>. -# - -#cmthome = ${HOME}/cmthome-v1r18p20060301 -cmthome = /afs/cern.ch/user/a/alibrari/cmthome -#logdir = /afs/cern.ch/atlas/software/builds/kitrel/bugfix/log -logdir = ../run -pacmancache= /afs/cern.ch/atlas/software/builds/kitrel/bugfix -#patchdir = $HOME/Kit/patches3 -patchdir = /afs/cern.ch/user/a/alibrari/Kit/patches3 - -#overwrite : Nope -#overwrite : yep -#upgrade: yeah - -projbase=/afs/cern.ch/atlas/software/builds/nightlies/bugfix - -release= -project = AtlasProduction -builddir = /build/atnight -#recursive = Yep -cmtcache = http://cern.ch/atlas-computing/links/kitsDirectory/CMT/pacman/cache diff --git a/PackDist/doc/Makefile b/PackDist/doc/Makefile deleted file mode 100755 index 8ab395ce689e72cfe899c86ae99c0322a655d103..0000000000000000000000000000000000000000 --- a/PackDist/doc/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# File: PackDist/doc/Makefile -# Author: Grigori Rybkine <Grigori.Rybkine@cern.ch> - -# Build documentation: man page and in html format - -name = proj-run.sh -script = ../scripts/$(name) -man = ../man/man1/$(name).1 -html = ../doc/html/$(name).html - -.PHONY: all - -all : $(man) $(html) - -$(man) : $(script) ../ChangeLog - @mkdir -p $(@D) - help2man -o $@ -n "pack project(s), external package(s)" \ - -m "Packaging and Distribution Tools" -N -h -h -v -v $< - -$(html) : $(man) - @mkdir -p $(@D) - @rm -f $@ - man2html $< >$@ diff --git a/PackDist/doc/html/pack-relocate.sh.html b/PackDist/doc/html/pack-relocate.sh.html deleted file mode 100644 index c6f21ba364dfd7e099ab347832c958e39181efec..0000000000000000000000000000000000000000 --- a/PackDist/doc/html/pack-relocate.sh.html +++ /dev/null @@ -1,67 +0,0 @@ -Content-type: text/html - -<HTML><HEAD><TITLE>Manpage of PACK-RELOCATE.SH</TITLE> -</HEAD><BODY> -<H1>PACK-RELOCATE.SH</H1> -Section: Packaging and Distribution Tools (1)<BR>Updated: August 2013<BR><A HREF="#index">Index</A> -<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -pack-relocate.sh - relocate or transform distribution kit -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - -<B>pack-relocate.sh</B> - -[<I>OPTION</I>]... <I>SOURCE DEST</I> -<BR> - -<B>pack-relocate.sh</B> - -[<I>OPTION</I>]... <I>-t PATH</I>... -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -In first form, relocate the ATLAS distribution kit from SOURCE to DEST. -In second form, locate the ATLAS distribution kit in PATH and transform -as described for <B>-t</B> option (implies <B>-i</B> option). -<DL COMPACT> -<DT><B>-i</B><DD> -edit files in-place, without moving them from SOURCE to DEST -<DT><B>-c</B><DD> -only relocate files in cmtsite -<DT><B>-t</B><DD> -transform setup scripts so that full paths in them may be changed by setting ATLAS_RELEASE_BASE environment variable -<DT><B>-h</B><DD> -display this help and exit -<DT><B>-v</B><DD> -output version information and exit -</DL> -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -Written by Grigori Rybkine. -<A NAME="lbAF"> </A> -<H2>REPORTING BUGS</H2> - -Report bugs to <<A HREF="mailto:Grigori.Rybkine@cern.ch">Grigori.Rybkine@cern.ch</A>>. -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -<DT><A HREF="#lbAF">REPORTING BUGS</A><DD> -</DL> -<HR> -This document was created by -<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 14:57:23 GMT, August 20, 2013 -</BODY> -</HTML> diff --git a/PackDist/doc/html/proj-run.sh.html b/PackDist/doc/html/proj-run.sh.html deleted file mode 100755 index 074f641189d20ae1fb78c32410be8bb3a00c31c6..0000000000000000000000000000000000000000 --- a/PackDist/doc/html/proj-run.sh.html +++ /dev/null @@ -1,117 +0,0 @@ -Content-type: text/html - -<HTML><HEAD><TITLE>Manpage of PROJ-RUN.SH</TITLE> -</HEAD><BODY> -<H1>PROJ-RUN.SH</H1> -Section: Packaging and Distribution Tools (1)<BR>Updated: August 2013<BR><A HREF="#index">Index</A> -<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR> - -<A NAME="lbAB"> </A> -<H2>NAME</H2> - -proj-run.sh - pack project(s), external package(s) -<A NAME="lbAC"> </A> -<H2>SYNOPSIS</H2> - -<B>proj-run.sh</B> - -[<I>OPTION</I>]... -<A NAME="lbAD"> </A> -<H2>DESCRIPTION</H2> - -Pack project with external packages it depends upon, or only external package(s). -<DL COMPACT> -<DT><B>-L</B> <path><DD> -create log file in directory <path> -<DT><B>-C</B> <path><DD> -create packages in directory <path> -<DT><B>-X</B> <path><DD> -create external packages in directory <path> -(takes precedence over <B>-C</B> value) -<DT><B>-J</B> <path><DD> -create project packages in directory <path> -(takes precedence over <B>-C</B> value) -<DT><B>-o</B> <path><DD> -create RPMs in directory <path> -<DT><B>-x</B> <path><DD> -create external RPMs in directory <path> -(takes precedence over <B>-o</B> value) -<DT><B>-j</B> <path><DD> -create project RPMs in directory <path> -(takes precedence over <B>-o</B> value) -<DT><B>-b</B> <path><DD> -pack project located in project base directory <path> -<DT><B>-P</B> <project><DD> -pack project <project> -<DT><B>-r</B> <id><DD> -pack project release <id> -<DT><B>-p</B> <package><DD> -pack external package <package> (may be multiple) -<DT><B>-D</B><DD> -pack debug build -<DT><B>-I</B><DD> -create debug information packages (for not debug build) -<DT><B>-S</B> <suffix><DD> -suffix of debug information files (for not debug build) -<DT><B>-t</B> <tag>[,<tag>...]<DD> -use additional tag(s) for setup (may be multiple) -<DT><B>-T</B> <cmtconfig><DD> -force CMTCONFIG <cmtconfig> (platform tag) for setup -<DT><B>-d</B><DD> -pack documentation files also -<DT><B>-F</B><DD> -overwrite existing tarballs of external packages -<DT><B>-U</B><DD> -overwrite existing tarballs of project packages -<DT><B>-k</B><DD> -keep existing tarballs of settings packages -(default is overwrite if their versions differ from those in use) -<DT><B>-R</B><DD> -recursively pack projects required by the project being packed -<DT><B>-V</B><DD> -verify that existing tarballs (of project and/or external packages) are up-to-date -<DT><B>-w</B><DD> -wait until packing completion -<DT><B>-q</B><DD> -do not write anything to standard output -<DT><B>-n</B><DD> -do not execute, only dump configuration -<DT><B>-B</B> <path><DD> -use directory <path> for temporary files -<DT><B>-c</B> <path><DD> -use configuration file <path> -<DT><B>-h</B><DD> -display this help and exit -<DT><B>-v</B><DD> -output version information and exit -</DL> -<P> - -The PACKOPTS environment variable specifies a space separated list of default options -to be placed in front of any explicit options. -<A NAME="lbAE"> </A> -<H2>AUTHOR</H2> - -Written by Grigori Rybkine. -<A NAME="lbAF"> </A> -<H2>REPORTING BUGS</H2> - -Report bugs to <<A HREF="mailto:Grigori.Rybkine@cern.ch">Grigori.Rybkine@cern.ch</A>>. -<P> - -<HR> -<A NAME="index"> </A><H2>Index</H2> -<DL> -<DT><A HREF="#lbAB">NAME</A><DD> -<DT><A HREF="#lbAC">SYNOPSIS</A><DD> -<DT><A HREF="#lbAD">DESCRIPTION</A><DD> -<DT><A HREF="#lbAE">AUTHOR</A><DD> -<DT><A HREF="#lbAF">REPORTING BUGS</A><DD> -</DL> -<HR> -This document was created by -<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>, -using the manual pages.<BR> -Time: 15:16:06 GMT, August 20, 2013 -</BODY> -</HTML> diff --git a/PackDist/hscript.py b/PackDist/hscript.py deleted file mode 100644 index 3916380c9a617ace35c018d33bdba4aeb30dc32f..0000000000000000000000000000000000000000 --- a/PackDist/hscript.py +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -## -*- python -*- -## automatically generated from a hscript -## do NOT edit. - -## waf imports -import waflib.Logs as msg - -PACKAGE = { - "name": "PackDist", - "authors": ["Grigori Rybkine <Grigori.Rybkine@cern.ch>", "Christian Arnault <arnault@lal.in2p3.fr>"], - - -} - -### --------------------------------------------------------------------------- -def pkg_deps(ctx): - - ## no public dependencies - ## no private dependencies - ## no runtime dependencies - return # pkg_deps - - -### --------------------------------------------------------------------------- -def options(ctx): - - return # options - - -### --------------------------------------------------------------------------- -def configure(ctx): - - - - #### set &{{PACKCFG [{default [../config/pack-nightly-bugfix.cfg]}]}} - ctx.hwaf_declare_macro("PACKCFG", ( - {"default": "../config/pack-nightly-bugfix.cfg"}, - )) - ctx.hwaf_declare_runtime_env("PACKCFG") - #### set &{{PACKOPTS [{default [${PACKOPTS}]}]}} - ctx.hwaf_declare_macro("PACKOPTS", ( - {"default": "${PACKOPTS}"}, - )) - ctx.hwaf_declare_runtime_env("PACKOPTS") - #### set_remove &{{PACKOPTS [{default [-w]}]}} - ctx.hwaf_macro_remove("PACKOPTS", ( - {"default": "-w"}, - )) - ##### **** statement *hlib.SetAppendStmt (&{{PACKOPTS [{default [-w]}]}}) - #### macro &{{PACKREPO [{default [../run]}]}} - ctx.hwaf_declare_macro("PACKREPO", ( - {"default": "../run"}, - )) - #### macro &{{PACKINSTALL [{default [../installation]}]}} - ctx.hwaf_declare_macro("PACKINSTALL", ( - {"default": "../installation"}, - )) - #### macro &{{urlget [{default [wget]} {Darwin [curl -L -O]}]}} - ctx.hwaf_declare_macro("urlget", ( - {"default": "wget"}, - {"Darwin": ["curl", "-L", "-O"]}, - )) - #### macro &{{main [{default [${PACKAGE_ROOT}/scripts/proj-run.sh]}]}} - ctx.hwaf_declare_macro("main", ( - {"default": "${PACKAGE_ROOT}/scripts/proj-run.sh"}, - )) - #### macro &{{version_info [{default [`${main} -v`]}]}} - ctx.hwaf_declare_macro("version_info", ( - {"default": ["`${main}", "-v`"]}, - )) - #### macro &{{doc_proj-run_sh [{default [pack project(s}, external package(s}]}]}} - ctx.hwaf_declare_macro("doc_proj-run_sh", ( - {"default": ["pack", "project(s},", "external", "package(s}"]}, - )) - #### macro &{{doc_pack-relocate_sh [{default [relocate or transform distribution kit]}]}} - ctx.hwaf_declare_macro("doc_pack-relocate_sh", ( - {"default": ["relocate", "or", "transform", "distribution", "kit"]}, - )) - ##### **** statement *hlib.MakeFragmentStmt (&{pack_run}) - ##### **** statement *hlib.MakeFragmentStmt (&{pack_install}) - ##### **** statement *hlib.MakeFragmentStmt (&{help2doc}) - - return # configure - - -### --------------------------------------------------------------------------- -def build(ctx): - - - ##### **** statement *hlib.DocumentStmt (&{pack_run [Run -group=run $(main)]}) - ##### **** statement *hlib.DocumentStmt (&{pack_install [Installation -group=installation -s=. $(PACKREPO)]}) - ##### **** statement *hlib.DocumentStmt (&{help2doc [Doc -group=doc $(main) ../share/pack-relocate.sh]}) - - - return # build - -## EOF ## diff --git a/PackDist/man/man1/pack-relocate.sh.1 b/PackDist/man/man1/pack-relocate.sh.1 deleted file mode 100644 index 99de09bca584a590c3748c9d962ece2f06e6025e..0000000000000000000000000000000000000000 --- a/PackDist/man/man1/pack-relocate.sh.1 +++ /dev/null @@ -1,33 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. -.TH PACK-RELOCATE.SH "1" "August 2013" "pack-relocate.sh (PackDist) 0.6.1" "Packaging and Distribution Tools" -.SH NAME -pack-relocate.sh \- relocate or transform distribution kit -.SH SYNOPSIS -.B pack-relocate.sh -[\fIOPTION\fR]... \fISOURCE DEST\fR -.br -.B pack-relocate.sh -[\fIOPTION\fR]... \fI-t PATH\fR... -.SH DESCRIPTION -In first form, relocate the ATLAS distribution kit from SOURCE to DEST. -In second form, locate the ATLAS distribution kit in PATH and transform -as described for \fB\-t\fR option (implies \fB\-i\fR option). -.TP -\fB\-i\fR -edit files in\-place, without moving them from SOURCE to DEST -.TP -\fB\-c\fR -only relocate files in cmtsite -.TP -\fB\-t\fR -transform setup scripts so that full paths in them may be changed by setting ATLAS_RELEASE_BASE environment variable -.TP -\fB\-h\fR -display this help and exit -.TP -\fB\-v\fR -output version information and exit -.SH AUTHOR -Written by Grigori Rybkine. -.SH "REPORTING BUGS" -Report bugs to <Grigori.Rybkine@cern.ch>. diff --git a/PackDist/man/man1/proj-run.sh.1 b/PackDist/man/man1/proj-run.sh.1 deleted file mode 100755 index f09233bbcea44bda88f7e9eebb93b5be810818db..0000000000000000000000000000000000000000 --- a/PackDist/man/man1/proj-run.sh.1 +++ /dev/null @@ -1,108 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. -.TH PROJ-RUN.SH "1" "August 2013" "proj-run.sh (PackDist) 00-12-00" "Packaging and Distribution Tools" -.SH NAME -proj-run.sh \- pack project(s), external package(s) -.SH SYNOPSIS -.B proj-run.sh -[\fIOPTION\fR]... -.SH DESCRIPTION -Pack project with external packages it depends upon, or only external package(s). -.TP -\fB\-L\fR <path> -create log file in directory <path> -.TP -\fB\-C\fR <path> -create packages in directory <path> -.TP -\fB\-X\fR <path> -create external packages in directory <path> -(takes precedence over \fB\-C\fR value) -.TP -\fB\-J\fR <path> -create project packages in directory <path> -(takes precedence over \fB\-C\fR value) -.TP -\fB\-o\fR <path> -create RPMs in directory <path> -.TP -\fB\-x\fR <path> -create external RPMs in directory <path> -(takes precedence over \fB\-o\fR value) -.TP -\fB\-j\fR <path> -create project RPMs in directory <path> -(takes precedence over \fB\-o\fR value) -.TP -\fB\-b\fR <path> -pack project located in project base directory <path> -.TP -\fB\-P\fR <project> -pack project <project> -.TP -\fB\-r\fR <id> -pack project release <id> -.TP -\fB\-p\fR <package> -pack external package <package> (may be multiple) -.TP -\fB\-D\fR -pack debug build -.TP -\fB\-I\fR -create debug information packages (for not debug build) -.TP -\fB\-S\fR <suffix> -suffix of debug information files (for not debug build) -.TP -\fB\-t\fR <tag>[,<tag>...] -use additional tag(s) for setup (may be multiple) -.TP -\fB\-T\fR <cmtconfig> -force CMTCONFIG <cmtconfig> (platform tag) for setup -.TP -\fB\-d\fR -pack documentation files also -.TP -\fB\-F\fR -overwrite existing tarballs of external packages -.TP -\fB\-U\fR -overwrite existing tarballs of project packages -.TP -\fB\-k\fR -keep existing tarballs of settings packages -(default is overwrite if their versions differ from those in use) -.TP -\fB\-R\fR -recursively pack projects required by the project being packed -.TP -\fB\-V\fR -verify that existing tarballs (of project and/or external packages) are up\-to\-date -.TP -\fB\-w\fR -wait until packing completion -.TP -\fB\-q\fR -do not write anything to standard output -.TP -\fB\-n\fR -do not execute, only dump configuration -.TP -\fB\-B\fR <path> -use directory <path> for temporary files -.TP -\fB\-c\fR <path> -use configuration file <path> -.TP -\fB\-h\fR -display this help and exit -.TP -\fB\-v\fR -output version information and exit -.PP -The PACKOPTS environment variable specifies a space separated list of default options -to be placed in front of any explicit options. -.SH AUTHOR -Written by Grigori Rybkine. -.SH "REPORTING BUGS" -Report bugs to <Grigori.Rybkine@cern.ch>. diff --git a/PackDist/scripts/basic-requirements.template b/PackDist/scripts/basic-requirements.template deleted file mode 100644 index a866b8aadc34d7607434d2e382e2fc7cf427cebd..0000000000000000000000000000000000000000 --- a/PackDist/scripts/basic-requirements.template +++ /dev/null @@ -1,13 +0,0 @@ -# -# !!! DO NOT EDIT - GENERATED AUTOMATICALLY FOR USE AT KIT INSTALLATION TIME !!! -# - -set CMTSITE STANDALONE -set SITEROOT @INSTALL_PREFIX@ - -path_prepend CMTPROJECTPATH ${SITEROOT} - -path CMTPATH - -set CMTEXTRATAGS ${CMTEXTRATAGS} -set_prepend CMTEXTRATAGS ATLAS, diff --git a/PackDist/scripts/defaults.cfg b/PackDist/scripts/defaults.cfg deleted file mode 100755 index e2dce8dcf412f1a00fb36fee366ea0e7b55c3c54..0000000000000000000000000000000000000000 --- a/PackDist/scripts/defaults.cfg +++ /dev/null @@ -1,40 +0,0 @@ -# File: defaults.cfg -# -# This is the configuration file for the pack-run.sh script with default settings. -# Do not edit!!! -# To override the settings and/or add those without default values use -# ~/.pack.cfg, the file specified in the environment variable PACKCFG, -# the file specified with the -c command line option -# (values from "earlier" files are overridden by "later" files). -# -# The format is: option = value # comments -# or: option : value # comments -# -# (Command line options override values from the configuration files.) -# -# Report bugs to <Grigori.Rybkine@cern.ch>. -# - -cmthome = ${HOME}/cmthome -logdir = $HOME -pacmancache= . -patchdir = ${HOME} - -# overwrite (yes) or not (no) existing tarballs of external packages -overwrite : no - -# projbase=/afs/cern.ch/atlas/software/builds -# projbase=/afs/cern.ch/atlas/software/dist - mainpkg=AtlasRelease - -project = AtlasOffline -# release= 10.5.0 - -mode = opt # opt, dbg - -cmtcache: http://www.cmtsite.org/pacman/cache - -setuproot = /afs/cern.ch/atlas/software/dist/AtlasSetup -tags = builds,noruntime -debuginfo = no -debuginfosuffix = .debug diff --git a/PackDist/scripts/doc.ptn b/PackDist/scripts/doc.ptn deleted file mode 100755 index e4bcea6b537b25764effb68476b3015a9ce50016..0000000000000000000000000000000000000000 --- a/PackDist/scripts/doc.ptn +++ /dev/null @@ -1,9 +0,0 @@ -doc -doc/* -docs -docs/* -doc-files -doc-files/* -ChangeLog -README -*.doc diff --git a/PackDist/scripts/extern-junk.ptn b/PackDist/scripts/extern-junk.ptn deleted file mode 100755 index 40fe6aaec5e192e5387ef1bf9cf13248857951fc..0000000000000000000000000000000000000000 --- a/PackDist/scripts/extern-junk.ptn +++ /dev/null @@ -1,9 +0,0 @@ -CVS -*~ -*.pyc -*.pyo -*.stamp -*.shstamp -*.cmtref -.svn -.__afs* diff --git a/PackDist/scripts/junk.ptn b/PackDist/scripts/junk.ptn deleted file mode 100755 index d857e8ddb0ea69b887c82048d0961affeaf50a83..0000000000000000000000000000000000000000 --- a/PackDist/scripts/junk.ptn +++ /dev/null @@ -1,20 +0,0 @@ -CVS -CVS/* -cmt/setup.* -cmt/cleanup.* -cmt/*make* -cmt/*.log -cmt/.cvsignore -run/* -*.BAK -*~ -src/*.g -temp -temp/* -NICOS_* -*.cmtref -*.pyc -*.pyo -.svn -.svn/* -.__afs* diff --git a/PackDist/scripts/pack-common.sh b/PackDist/scripts/pack-common.sh deleted file mode 100755 index 7a7a9044bf71429565c8735f16ae796b0e320ac1..0000000000000000000000000000000000000000 --- a/PackDist/scripts/pack-common.sh +++ /dev/null @@ -1,217 +0,0 @@ -# File: pack-common.sh -# -# Functions used by all scripts. -# -# Author: Grigori Rybkine <Grigori.Rybkine@cern.ch>. -# - -# -# Usage: info|warn|error [message [location]] -# -info () { echo -e ${scriptname:=`basename $0`}: ${2:+$2:} INFO: "$1" 1>&2; } -#info () { echo -e "${scriptname:=`basename $0`}: ${2:+$2: }INFO:" "$1" 1>&2; } -#info () { echo -e "`basename $0`: ${2:+$2: }INFO:" "$1"; } -warn () { echo -e "${scriptname:=`basename $0`}: ${2:+$2: }WARNING:" "$1" 1>&2; } -error () { echo -e "${scriptname:=`basename $0`}: ${2:+$2: }ERROR:" "$1" 1>&2; } - -abspath () -{ -# -# Usage: abspath FILEPATH -# -# if FILEPATH is invalid or empty, -# the result is an empty string -# -[ $# -eq 1 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -if [ -f "$1" ]; then - local d=`dirname $1` - d=`cd $d || exit; pwd -P` || - { error "Cannot resolve path: $1" $FUNCNAME; return 1; } - echo $d/`basename $1` -elif [ -d "$1" ]; then - (cd $1 || exit; pwd -P) || - { error "Cannot resolve path: $1" $FUNCNAME; return 1; } -# (cd $1; /bin/pwd) -else - error "No such file or directory: $1" $FUNCNAME; return 1 -fi -} - -duf () -{ -# -# Usage: duf [OPTION]... [FILE]... -# Show information about the filesystem on which the current directory resides, -# display the total amount of disk space required for FILEs, or standard input, -# or the current directory by default. -# -# -p PATH show information about the filesystem on which PATH resides -# -local path -OPTIND=1 -while getopts "p:" opt; do - case $opt in - p) path=${OPTARG} ;; - \?) error "Invalid usage" $FUNCNAME; return 1 ;; - esac -done - -shift $(($OPTIND - 1)) - -[ "$path" ] || path=$PWD - -#local fstype=$(df -P -T $path|tail -n 1|awk '{print $2}') -# use POSIX output (and options) -local -a fsinfo=(`df -kP $path|tail -n 1|awk '{print $1, $2, $4}'`) || -{ error "awk" $FUNCNAME; return 1; } -[ "${fsinfo[0]}" ] || { error "Cannot determine filesystem type: $path" $FUNCNAME; return 1; } -#[ "$fstype" ] || { error "Cannot determine filesystem type: $path" $FUNCNAME; return 1; } - -if [[ ${fsinfo[0]} == [Aa][Ff][Ss] ]]; then - fsinfo=(`fs lq $path|tail -n 1|awk '{print $1, $2, $2 - $3}'`) -fi -# local -a fsinfo=(` -# case $fstype in -# afs) fs lq $path|tail -n 1|awk '{print $1, $2, $2 - $3}' ;; -# *) df -P $path|tail -n 1|awk '{print $1, $2, $4}' ;; -# esac -# `) - -# use POSIX options of du -ksL (c - grand total, not POSIX) -case $# in - 0) local reqspace=$(xargs du -k -s -c -L | - awk '$2 == "total" { sum += $1 }; END{ print sum }') ;; - *) local reqspace=$(du -k -s -c -L "$@" | - awk '$2 == "total" { sum += $1 }; END{ print sum }') ;; -esac - -local fmt="%-20s %15s %15s %15s\n" -printf "$fmt" "Filesystem" "1024-blocks" "Available" "Required" -printf "$fmt" ${fsinfo[0]} ${fsinfo[1]} ${fsinfo[2]} ${reqspace} -} - -newer () -{ -# -# Usage: newer -p PATH [OPTION]... [FILE]... -# -# -L dereference all symbolic links -# - -local path follow - -OPTIND=1 -while getopts "p:L" opt; do - case $opt in - p) path=${OPTARG} ;; - L) follow=yes ;; - \?) error "Invalid usage" $FUNCNAME; return 1 ;; - esac -done - -shift $(($OPTIND - 1)) - -[ "$path" ] || { error "PATH must be supplied with '-p'" $FUNCNAME; return 1; } - -local tmpnew=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } - -case $# in -# 0) xargs findnewer -p $path ${follow:+-L} ;; - 0) xargs -r sh -c "findnewer -p $path ${follow:+-L} \$0 \$@" >>$tmpnew ;; - *) findnewer -p $path ${follow:+-L} "$@" >|$tmpnew ;; -esac - -local retval=$? - -[ -s $tmpnew ] && { warn "$path: Newer files available:" $FUNCNAME; cat $tmpnew >&2; } -rm -f $tmpnew - -case $retval in - 123|124) error "findnewer" $FUNCNAME; return 1 ;; - 125|126|127|1) error "xargs" $FUNCNAME; return 1 ;; - 2) error "findnewer" $FUNCNAME; return 2 ;; -esac -} - -findnewer () -{ -# -# Usage: findnewer -p PATH [OPTION]... [FILE]... -# -# -L dereference all symbolic links -# - -local path follow - -OPTIND=1 -while getopts "p:L" opt; do - case $opt in - p) path=${OPTARG} ;; - L) follow=yes ;; - \?) error "Invalid usage" $FUNCNAME; return 2 ;; - esac -done - -shift $(($OPTIND - 1)) - -[ "$path" ] || { error "PATH must be supplied with '-p'" $FUNCNAME; return 2; } - -[ ${uname} != Linux ] || noleaf=yes -find $(echo_F "$@") ${noleaf:+-noleaf} ${follow:+-follow} -newer $path -ls || -#find ${follow:+-L} $(echo_F "$@") ${noleaf:+-noleaf} -newer $path -ls || -{ error "find" $FUNCNAME; return 2; } -} - -echo_F () -{ -# -# Usage: echo_F [FILE]... -# Append forward slash (/) to the names of FILEs that are symbolic links to existing directories. -# Print the names of the other FILEs unchanged. -# -local s first=y -for s; do - if [ "$first" ]; then - echo -n "$s"; unset first - else - echo -n " $s" - fi - if [ -h "$s" -a -d "$s" ]; then - [[ $s == ?*/ ]] || echo -n / - fi -done -} - -export -f findnewer error echo_F -#export scriptname - -path_prepend () -{ -# -# Usage: path_prepend PATHVARIABLE PATH -# -[ $# -eq 2 ] || return 0 -[ "$1" ] && [ "$2" ] || return 0 - -local val=$2 -for p in $(eval echo \$$1 | tr -s ':' ' '); do - [ $p = $2 ] || val=${val}:$p -done -eval $1=$val -} - -path_append () -{ -# -# Usage: path_append PATHVARIABLE PATH -# -[ $# -eq 2 ] || return 0 -[ "$1" ] && [ "$2" ] || return 0 - -local val -for p in $(eval echo \$$1 | tr -s ':' ' '); do - [ $p = $2 ] || if [ -n "${val}" ]; then val=${val}:$p; else val=$p; fi -done -if [ -n "${val}" ]; then val=${val}:$2; else val=$2; fi -eval $1=$val -} diff --git a/PackDist/scripts/pack-extern.sh b/PackDist/scripts/pack-extern.sh deleted file mode 100755 index 6e0189763775f80395cfaa2eac4faa3408972f38..0000000000000000000000000000000000000000 --- a/PackDist/scripts/pack-extern.sh +++ /dev/null @@ -1,703 +0,0 @@ -#!/bin/bash -# File: pack-extern.sh -# -# Pack external software interfaced to by a cmt package. -# -# Author: Christian Arnault <arnault@lal.in2p3.fr> -# Author: Grigori Rybkine <Grigori.Rybkine@cern.ch>. -# - -[ "$PACKEXTERNDBG" ] && set -x - -: ${externcache:?} ${patchdir:?} ${overwrite:?} - -: ${scriptdir:?} -. $scriptdir/pack-common.sh - -: ${CMTCONFIG:?} -: ${SITEROOT:?} -#: ${tmpdir:?} -#: ${tmppatch:?} - -##################################### functions ##################################### -_patch () -{ -# -# Parameters: 'project' 'release' 'package' -# Create a patched requirements file, install it -# in the right place in the directory tree under tmppatch and -# print its path on the standard output: 'patch-path' -# -# Return status: 0 if a patched file is created, 1 otherwise -# -[ -d "${patchdir}" ] || -{ warn "patchdir=$patchdir: No such directory" $FUNCNAME; return 1; } - -# Check for patches -if [ -f ${patchdir}/${1}/${2}/requirements -o \ - -f ${patchdir}/${1}/${2}/${3}/requirements ]; then - -local projpatch=${patchdir}/${1}/${2}/requirements pkgpatch=${patchdir}/${1}/${2}/${3}/requirements -local reqpatch=$(mktemp -d -t tmp.XXXXXXXXXX)/requirements || { error "mktemp" $FUNCNAME; return 1; } ->|${reqpatch} - -if [ -f $pkgpatch ]; then - if head -n 1 $pkgpatch | grep -q '^#!'; then - $pkgpatch <requirements >>${reqpatch} - else - cat requirements $pkgpatch >>${reqpatch} - fi - [ $? -eq 0 ] || { error "Cannot apply: $pkgpatch" $FUNCNAME; } -fi - -if [ -f $projpatch ]; then -# echo >>${reqpatch} - cat $projpatch >>${reqpatch} || { error "Cannot apply: $projpatch" $FUNCNAME; } -fi - -[ -s ${reqpatch} ] || { rm -rf $(dirname $reqpatch) -warn "Empty patch(es) provided: $1 $2 $3" $FUNCNAME; return 1; } - -# if _install_patched $1 $2 $3 ${reqpatch}; then -# rm -rf $(dirname $reqpatch) || return 0 -# else echo ${reqpatch} -# fi -_install_patched $1 $2 $3 ${reqpatch} >/dev/null -echo ${reqpatch} - -else return 1 -fi -} - -_install_patched () -{ -# -# Parameters: 'project' 'release' 'package' 'patched-path' -# Install patched requirements file 'patched-path' -# in the right place in the directory tree under tmppatch and -# print its path on the standard output: 'installed-path' -# -[ $# -eq 4 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -[ -d "${tmppatch}" ] || -{ error "tmppatch=$tmppatch: No such directory" $FUNCNAME; return 1; } -local reqdir=$(pwd | sed -n 's#^.*\('$1/$2'\)#\1#p') -[ "$reqdir" ] || { error "$(pwd): $1 $2 $3" $FUNCNAME; return 1; } -mkdir -p ${tmppatch}/$reqdir || { error "mkdir" $FUNCNAME; return 1; } -info "Writing patched requirements: $1 $2 $3" $FUNCNAME -[ "$PACKEXTERNDBG" ] && cat $4 >&2 -cp -p $4 ${tmppatch}/$reqdir/requirements || -{ error "cp" $FUNCNAME; return 1; } -echo ${tmppatch}/$reqdir/requirements -} - -_mkname () -{ -# -# Parameters: 'package' 'version' ['platform'] -# (bin noarch debuginfo) -# -[ $# -eq 2 -o $# -eq 3 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } - -if [ $# -eq 2 -o "$3" == bin ]; then - sed -e 's/[-.]/_/g' -e "s/${1}_${1}/${1}/" <<<${1}_${2}_${CMTCONFIG} || { error "sed" $FUNCNAME; return 1; } -elif [ $3 = debuginfo ]; then - sed -e 's/[-.]/_/g' -e "s/${1}_${1}/${1}/" <<<${1}_${2}_${CMTCONFIG}_debuginfo || { error "sed" $FUNCNAME; return 1; } -else - sed -e 's/[-.]/_/g' -e "s/${1}_${1}/${1}/" <<<${1}_${2}_${3} || { error "sed" $FUNCNAME; return 1; } -fi -} - -_bad_symlinks () -{ -# -# Parameters: [FILE...] -# Print on the standard output broken symlinks paths (format: 'path:' 'error message') -# The error message format is different at least with find (GNU findutils) 4.4.2 (SLC6), -# e.g, -# find: File system loop detected; `dst/l_cur' is part of the same file system loop as `dst'. - -# better not to rely on it -# -find "$@" -follow 2>&1 >/dev/null | sed 's/^find:[ ]*//' -# -L option is not supported by GNU find version 4.1.20 (SL4) -# but supported by GNU find version 4.2.27 (SL5) and find on Mac OS X 10.5, 10.6 -# -follow supported by all (is deprecated on Mac OS X 10.5) -#find -L "$@" 2>&1 >/dev/null | sed 's/^find:[ ]*//' -# -#find "$@" -follow -fprint /dev/null 2>&1 | sed 's/^find:[ ]*//' -#find $* -follow -fprint /dev/null 2>&1 | sed 's/^find:[ ]*//' -# [ -d $_s ] && symlinks -rv $_s | grep ^dangling >|$tmperr -# if [ -s $tmperr ]; then -# [ "$PACKEXTERNDBG" ] && cat $tmperr -# { error "Symlinks below cannot be followed:" $FUNCNAME; cat $tmperr 1>&2; } -# # does not work - bug in symlinks -# #symlinks -rv $_d | grep ^dangling | cut -d' ' -f2 >|$tmperr -# find $_d/ -noleaf | xargs file | grep broken | cut -d: -f1 >|$tmperr -# [ "$PACKEXTERNDBG" ] && cat $tmperr -# fi -} - -_chk_links () -{ -[ -d "$1" ] || return 0 -local tmperr=$(mktemp -t tmp.XXXXXXXXXX) || return 1 - -type symlinks >/dev/null || { warn "type" $FUNCNAME; return 0; } -symlinks -rv $1 | - awk -v tmperr=$tmperr ' - /^absolute|^other_fs|^dangling|^messy/ { print >tmperr; next } - { print } -' | -while read line; do - -grep -q $(abspath $1) <<<"$( - abspath $( - awk ' - { - if (substr($4, 1, 1) == "/") print $4 - else { n = split($2, a, "/") - print substr($2, 1, length($2) - length(a[n])) $4 } - } - ' <<<$line - ) -)" || echo $line >>$tmperr - -done - -[ -s $tmperr ] && { warn "Symlinks will not be followed:" $FUNCNAME; cat $tmperr >&2; } - -rm -f $tmperr || return 0 -} - -_tar_extern () -{ -# -# Parameters: 'name' -# -[ $# -eq 1 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } - -local n=${#src[*]} -[ $n -gt 0 ] || return 0 -if [ ${uname} = Linux ]; then - local tar_basic_opts="-v --owner=root --group=root --mode=u=rwX,go=rX --no-anchored --wildcards" - noleaf=yes -# group=yes -else - local tar_basic_opts="-v" - unset noleaf -# unset group -fi - -local tar_cmd=tar -#local tar_basic_opts="-v --owner=root ${group:+--group=root} --mode=u=rwX,go=rX --no-anchored --wildcards" -#local tar_basic_opts="-v --owner=root --group=root --mode=u=rwX,go=rX --no-anchored --wildcards" -#local tar_basic_opts="-v --owner=root --group=root --mode=u=rwX,go=rX" - -local fpath=${externcache}/kits/${1}.tar - -# create an empty archive to append to -${tar_cmd} ${tar_basic_opts} -cf ${fpath} -T /dev/null 1>&2 || -{ error "${tar_cmd}" $FUNCNAME; return 1; } - -local empty_sum=$(sha1sum ${fpath}) || { error "sha1sum" $FUNCNAME; return 1; } - -cd ${tempcopydir} || { error "cd" $FUNCNAME; return 1; } -#local n=${#src[*]} - -[ "${mode:-}" != dbg ] || unset debuginfo_suffix - -for (( i=0 ; i!=n ; i++ )) ; do - #s=$(echo ${src[$i]} | sed 's#/\+$##') - local s=$(sed 's#/\+$##' <<<${src[$i]}) || { error "sed" $FUNCNAME; return 1; } - local d=$(sed 's#/\+$##' <<<${dst[$i]}) || { error "sed" $FUNCNAME; return 1; } - - rm -rf ${tempcopydir}/* - [ -f $s -o -d $s ] || { error "$(stat -L $s 2>&1)" $FUNCNAME; continue; } - - if [ "${follow_symlinks}" ]; then - warn "Following symlinks to pack '$s' as '$d'" $FUNCNAME - mkdir -p $(dirname $d) || { error "mkdir" $FUNCNAME; continue; } - ln -sf $s $d || { error "ln" $FUNCNAME; continue; } - - local tmperr=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; continue; } - _bad_symlinks $s >|$tmperr - if [ -s $tmperr ]; then - { error "Symlinks cannot be followed:" $FUNCNAME; cat $tmperr 1>&2; } - _bad_symlinks $d | cut -d: -f1 >|$tmperr - [ "$PACKEXTERNDBG" ] && cat $tmperr 1>&2 - fi - - ${tar_cmd} ${tar_basic_opts} -hrf ${fpath} \ - -X $tmperr \ - -X $scriptdir/extern-junk.ptn ${exclude_objfiles:+--exclude='*.o'} \ - ${debuginfo_suffix:+--exclude='*'${debuginfo_suffix}} \ - $d 1>&2 || { error "${tar_cmd}" $FUNCNAME; continue; } - - rm -f $tmperr - elif [ . == $(dirname $d) ]; then - [ -f $s ] && \ - { error "Cowardly refusing to pack '$s' as '$d' - no top directory" $FUNCNAME; continue; } - ln -sf $s $d || { error "ln" $FUNCNAME; continue; } - ${tar_cmd} ${tar_basic_opts} --no-recursion -hrf ${fpath} \ - -X $scriptdir/extern-junk.ptn ${exclude_objfiles:+--exclude='*.o'} \ - ${debuginfo_suffix:+--exclude='*'${debuginfo_suffix}} \ - $d 1>&2 || { error "${tar_cmd}" $FUNCNAME; continue; } - find $d/ ${noleaf:+-noleaf} -mindepth 1 -maxdepth 1 | \ - ${tar_cmd} ${tar_basic_opts} -rf ${fpath} -T - \ - -X $scriptdir/extern-junk.ptn ${exclude_objfiles:+--exclude='*.o'} \ - ${debuginfo_suffix:+--exclude='*'${debuginfo_suffix}} \ - 1>&2 || { error "${tar_cmd}" $FUNCNAME; continue; } -# find $d/ ${noleaf:+-noleaf} -mindepth 1 -maxdepth 1 | xargs \ -# ${tar_cmd} ${tar_basic_opts} -rf ${fpath} \ -# -X $scriptdir/extern-junk.ptn ${exclude_objfiles:+--exclude='*.o'} \ -# 1>&2 # || { error "${tar_cmd}" $FUNCNAME; return 1; } -# case $? in -# 123|124) error "${tar_cmd}" $FUNCNAME; continue ;; -# 125|126|127|1) error "xargs" $FUNCNAME; continue ;; -# esac - [ ${uname} != Linux ] || _chk_links $s - elif [ -f $s ]; then - mkdir -p $(dirname $(dirname $d)) || { error "mkdir" $FUNCNAME; continue; } - ln -sf $(dirname $s) $(dirname $d) || { error "ln" $FUNCNAME; continue; } - ${tar_cmd} ${tar_basic_opts} -rf ${fpath} \ - -X $scriptdir/extern-junk.ptn ${exclude_objfiles:+--exclude='*.o'} \ - ${debuginfo_suffix:+--exclude='*'${debuginfo_suffix}} \ - $d 1>&2 || { error "${tar_cmd}" $FUNCNAME; continue; } - - [ -h $s ] && - warn "Symlink $s -> $(readlink $s) packed as '$d'" $FUNCNAME - else -# [ -h $s ] && - if [ -h $s ]; then - warn "Following symlink $s -> $(readlink $s) to pack as '$d'" $FUNCNAME - follow=yes - else - unset follow - fi - mkdir -p $(dirname $d) || { error "mkdir" $FUNCNAME; continue; } - ln -sf $s $d || { error "ln" $FUNCNAME; continue; } - ${tar_cmd} ${tar_basic_opts} --no-recursion -hrf ${fpath} \ - -X $scriptdir/extern-junk.ptn ${exclude_objfiles:+--exclude='*.o'} \ - ${debuginfo_suffix:+--exclude='*'${debuginfo_suffix}} \ - $d 1>&2 || { error "${tar_cmd}" $FUNCNAME; continue; } - find $d/ ${noleaf:+-noleaf} ${follow:+-follow} -mindepth 1 -maxdepth 1 | \ - ${tar_cmd} ${tar_basic_opts} -rf ${fpath} -T - \ - -X $scriptdir/extern-junk.ptn ${exclude_objfiles:+--exclude='*.o'} \ - ${debuginfo_suffix:+--exclude='*'${debuginfo_suffix}} \ - 1>&2 || { error "${tar_cmd}" $FUNCNAME; continue; } -# find $d/ ${noleaf:+-noleaf} -mindepth 1 -maxdepth 1 | xargs \ -# ${tar_cmd} ${tar_basic_opts} -rf ${fpath} \ -# -X $scriptdir/extern-junk.ptn ${exclude_objfiles:+--exclude='*.o'} \ -# 1>&2 #|| { error "${tar_cmd}" $FUNCNAME; return 1; } -# case $? in -# 123|124) error "${tar_cmd}" $FUNCNAME; continue ;; -# 125|126|127|1) error "xargs" $FUNCNAME; continue ;; -# esac - [ ${uname} != Linux ] || _chk_links $s -# _chk_links $s - fi - -done -cd $OLDPWD - -local payload_sum=$(sha1sum ${fpath}) || { error "sha1sum" $FUNCNAME; return 1; } -if [ "$empty_sum" = "$payload_sum" ]; then - info "Nothing to include: $fpath" $FUNCNAME - rm -f ${fpath} || { error "rm" $FUNCNAME; return 1; } - return 0 -fi - -gzip -vf ${fpath} >&2 || { -rm -f ${fpath} -error "gzip" $FUNCNAME; return 1; } -} - -_tar_extern_debuginfo () -{ -# -# Parameters: 'name' -# -[ $# -eq 1 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } - -[ -n "${debuginfo_suffix-}" ] || return 0 - -local n=${#src[*]} -[ $n -gt 0 ] || return 0 -if [ ${uname} = Linux ]; then - local tar_basic_opts="-v --owner=root --group=root --mode=u=rwX,go=rX --no-anchored --wildcards" - noleaf=yes -# group=yes -else - local tar_basic_opts="-v" - unset noleaf -# unset group -fi - -local tar_cmd=tar -#local tar_basic_opts="-v --owner=root ${group:+--group=root} --mode=u=rwX,go=rX --no-anchored --wildcards" -#local tar_basic_opts="-v --owner=root --group=root --mode=u=rwX,go=rX --no-anchored --wildcards" -#local tar_basic_opts="-v --owner=root --group=root --mode=u=rwX,go=rX" - -local fpath=${externcache}/kits/${1}.tar - -# create an empty archive to append to -${tar_cmd} ${tar_basic_opts} -cf ${fpath} -T /dev/null 1>&2 || -{ error "${tar_cmd}" $FUNCNAME; return 1; } - -local empty_sum=$(sha1sum ${fpath}) || { error "sha1sum" $FUNCNAME; return 1; } - -cd ${tempcopydir} || { error "cd" $FUNCNAME; return 1; } -#local n=${#src[*]} - -rm -rf ${tempcopydir}/* -for (( i=0 ; i!=n ; i++ )) ; do - #s=$(echo ${src[$i]} | sed 's#/\+$##') - local s=$(sed 's#/\+$##' <<<${src[$i]}) || { error "sed" $FUNCNAME; return 1; } - local d=$(sed 's#/\+$##' <<<${dst[$i]}) || { error "sed" $FUNCNAME; return 1; } - - [ -f $s -o -d $s ] || { error "$(stat -L $s 2>&1)" $FUNCNAME; continue; } - - if [ "${follow_symlinks}" ]; then - warn "Following symlinks to pack '$s' as '$d'" $FUNCNAME - mkdir -p $(dirname $d) || { error "mkdir" $FUNCNAME; continue; } - ln -sfn $s $d || { error "ln" $FUNCNAME; continue; } - - local tmperr=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; continue; } - _bad_symlinks $s >|$tmperr - if [ -s $tmperr ]; then - { error "Symlinks cannot be followed:" $FUNCNAME; cat $tmperr 1>&2; } - fi - - local tmplist=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; continue; } - find -L $d ${noleaf:+-noleaf} -name "*$debuginfo_suffix" -fprint $tmplist 2>/dev/null - ${tar_cmd} ${tar_basic_opts} -hrf ${fpath} -T $tmplist 1>&2 || - { error "${tar_cmd}" $FUNCNAME; continue; } - - if [ "$PACKEXTERNDBG" ]; then - echo "extern_debuginfo:" >&2 - cat $tmplist >&2 - fi - rm -f $tmperr $tmplist - elif [ -f $s ]; then - [[ $d == *$debuginfo_suffix ]] || continue - [ . != $(dirname $d) ] || - { error "Cowardly refusing to pack '$s' as '$d' - no top directory" $FUNCNAME; continue; } - - mkdir -p $(dirname $(dirname $d)) || { error "mkdir" $FUNCNAME; continue; } - ln -sfn $(dirname $s) $(dirname $d) || { error "ln" $FUNCNAME; continue; } - ${tar_cmd} ${tar_basic_opts} -rf ${fpath} \ - $d 1>&2 || { error "${tar_cmd}" $FUNCNAME; continue; } - - [ -h $s ] && - warn "Symlink $s -> $(readlink $s) packed as '$d'" $FUNCNAME - else - if [ -h $s ]; then - warn "Following symlink $s -> $(readlink $s) to pack as '$d'" $FUNCNAME - fi - mkdir -p $(dirname $d) || { error "mkdir" $FUNCNAME; continue; } - ln -sfn $s $d || { error "ln" $FUNCNAME; continue; } - - local tmplist=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; continue; } - find -H $d ${noleaf:+-noleaf} -name "*$debuginfo_suffix" -fprint $tmplist || - { error "find" $FUNCNAME; continue; } - ${tar_cmd} ${tar_basic_opts} -rf ${fpath} -T $tmplist 1>&2 || - { error "${tar_cmd}" $FUNCNAME; continue; } - - if [ "$PACKEXTERNDBG" ]; then - echo "extern_debuginfo:" >&2 - cat $tmplist >&2 - fi - rm -f $tmplist - fi - -done -cd $OLDPWD - -local payload_sum=$(sha1sum ${fpath}) || { error "sha1sum" $FUNCNAME; return 1; } -if [ "$empty_sum" = "$payload_sum" ]; then - info "Nothing to include: $fpath" $FUNCNAME - rm -f ${fpath} || { error "rm" $FUNCNAME; return 1; } - return 0 -fi - -gzip -vf ${fpath} >&2 || { -rm -f ${fpath} -error "gzip" $FUNCNAME; return 1; } -} - -_getver () -{ -# -# Determine package version and print on the standard output -# (empty if cannot be determined ) -# -# Parameters: 'name' -# -local fpath=${externcache}/cache/${1}.pacman - -if [ -f $fpath ]; then -sed -e '/^[ \t]*version(.*)[ \t]*$/!d' -e 's/version(//' -e 's/)[ \t]*$//' -e "s/['\"]//g" ${fpath} || { error "sed" $FUNCNAME; return 1; } -fi -} - -_pacman () -{ -# -# Write pacman file -# -# Parameters: 'name' ['requires-file' ['postinstall-script' ['preinstall-script' ['version']]]] -# -local reqs fpath ver _ver - -fpath=${externcache}/cache/${1}.pacman - -if [ "$5" ]; then - ver=$5 -else - _ver=$(_getver ${1}) || { _ver=; warn "${fpath}: Version reset" $FUNCNAME; } - ver=$(expr ${_ver:-0} + 1) || - { ver=1; warn "${fpath}: Version set to ${ver}" $FUNCNAME; } -fi - -info "Writing ${fpath}, version ${ver}" $FUNCNAME - -# add dependencies -if [ -s "$2" ]; then - -while read req rest; do - reqs="${reqs} -package('${req}')" -done <${2} - -fi - -# write pacman file -cat <<EOF >|${fpath} - -description('External Package ${1}') -version('${ver}') -${reqs} - -EOF - -# add preinstall-script -if [ -s "$4" ]; then - echo "shell('$(sed s/@INSTALL_PREFIX@/\$PACMAN_INSTALLATION/g $4)')" >>${fpath} -fi - -if [ -f ${externcache}/kits/${1}.tar.gz ]; then - -cat <<EOF >>${fpath} - -downloadUntar('../kits/${1}.tar.gz') - -EOF -else - warn "${externcache}/kits/${1}.tar.gz: No such file" $FUNCNAME -fi - -# add postinstall-script -if [ -s "$3" ]; then - echo "shell(\"$(sed s/@INSTALL_PREFIX@/\$PACMAN_INSTALLATION/g $3)\")" >>${fpath} - #echo "shell('$(sed s/@INSTALL_PREFIX@/\$PACMAN_INSTALLATION/g $3)')" >>${fpath} -fi -} - -_add_opt_dep () -{ -# -# for external dbg package -# add dependency on opt mode package -# as the former contains dbg mode ONLY -# (to aviod files conflicts with the latter) -# -# Parameters: 'name' ['requires-file'] -# - local name_opt=$(sed "s/dbg/opt/" <<<${1}) || { error "sed" $FUNCNAME; return 1; } - if [ ${1} != "${name_opt}" ]; then - if [ -f "${2:-}" ] && ! grep -q "${name_opt}" ${2}; then - echo "${name_opt}" >>${2} || { error "echo" $FUNCNAME; return 1; } - elif [ ! -f "${2:-}" ]; then - echo "${name_opt}" - fi - [ -f ${externcache}/cache/${name_opt}.pacman ] && - [ -f ${externcache}/kits/${name_opt}.tar.gz ] || - warn "Not packed: ${name_opt}" $FUNCNAME - fi -} - -##################################### main ########################################## -#info "$(date)" $FUNCNAME - -package=`cmt show macro_value package` -project=`cmt show macro_value ${package}_project` -release=`cmt show macro_value ${package}_project_release` - -if reqpatch=$(_patch ${project} ${release} ${package}); then - export CMTUSERCONTEXT=$(dirname $reqpatch) -else unset reqpatch -fi - -# Check if there are external packages required -for pkg in `cmt -q -tag_add=ATLAS show macro_value ${package}_requires`; do - [ -f "${tmpreq:-}" ] || tmpreq=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; exit 1; } - echo "$pkg" >>$tmpreq || { error "echo" $FUNCNAME; exit 1; } -done - -# Check if there is external software to pack -export_paths=`cmt -q -tag_add=ATLAS show macro_value ${package}_export_paths` -# Remove leading and trailing whitespace (to make the value empty if it was whitespace) -src=(${export_paths}) - -[ ${#src[*]} -gt 0 ] || [ -s "${tmpreq:-}" ] || exit 0 -#[ "$export_paths" ] || [ -s "$tmpreq" ] || exit 0 - -export_paths=${src[*]} - -if [ -n "$export_paths" ]; then - -dst=($(cmt -q -tag_add=ATLAS,STANDALONE show macro_value ${package}_export_paths)) -dst=(${dst[*]#${SITEROOT}/}) - -info "source:\n'${src[*]}'" $FUNCNAME -info "destination:\n'${dst[*]}'" $FUNCNAME - -[ ${#src[*]} -eq ${#dst[*]} ] || -{ error "source # ${#src[*]}, destination # ${#dst[*]}" $FUNCNAME; exit 1; } - -debuginfo_suffix=$(cmt -q -tag_add=PACK,ATLAS show macro_value ${package}_debuginfo_suffix) - -if [ $# -eq 1 ] && [ -f "${1}" ]; then - n=${#src[*]} - for (( i=0 ; i!=n ; i++ )) ; do - printf '%s\0%s\0%s\n' "${src[$i]}" "${dst[$i]}" "${debuginfo_suffix}" >>"${1}" -# echo ${src[$i]} ${dst[$i]} >>"${1}" - done -fi - -fi - -if [ -s "${tmpreq:-}" ]; then -info "requires:\n'$(<$tmpreq)'" $FUNCNAME -fi - -native_version=`cmt -q -tag_add=PACK show macro_value ${package}_native_version` -if [ -n "$native_version" ]; then - if [ LCG_Interfaces = "$(cmt -q show macro_value ${package}_offset)" ] || \ - cmt -q show uses|grep -q -F -w LCG_Interfaces; then - LCG_config_version=$(cmt -q show macro_value LCG_config_version) - _LCG_config_version=$(echo ${LCG_config_version}|sed -n 's/^\([[:digit:]]\{1,\}\).*/\1/p') - if [ -n "${_LCG_config_version}" ] && [ ${_LCG_config_version} -ge 68 ] && \ - [ -n "$export_paths" ] && echo "${dst[*]}"|grep -q -F "/LCG_${LCG_config_version}/" && \ - ! echo "$native_version"|grep -q -F "_lcgcmt${LCG_config_version}"; then - version=${native_version}_lcgcmt${LCG_config_version} - fi - fi - [ -z ${version+t} ] && version=$native_version -else -version=`cmt show macro_value version` -[ "${version}" = "v*" ] && -{ warn "Invalid CMT package version: $version: $project $release $package" $FUNCNAME; -version=v1; } - warn "Macro ${package}_native_version unspecified: $project $release $package $version" $FUNCNAME -fi - -platform=`cmt -q -tag_add=PACK show macro_value ${package}_platform` - -# -# Need to handle dbg mode -# -if [ -n "$export_paths" ] && [[ ${CMTCONFIG} == *dbg* ]] && [[ "${dst[*]}" != *dbg* ]] && [ -z $platform ]; then -#if [[ ${CMTCONFIG} == *dbg* ]] && [[ "${export_paths}" != *dbg* ]] && [ -z $platform ]; then - info "No debug build available, using optimised" $FUNCNAME - platform=$(sed 's/dbg/opt/' <<<${CMTCONFIG}) || - { error "sed" $FUNCNAME; exit 1; } -fi - -if [ -n "$export_paths" ] && [[ ${CMTCONFIG} == *dbg* ]] && [ -z ${platform} ]; then - n=${#src[*]} - for (( i=0 ; i!=n ; i++ )) ; do - if [[ ${dst[$i]} != *dbg* ]]; then - # - # Pack dbg mode ONLY into external dbg tarball - # - [ -f "${tmpreq:-}" ] || tmpreq=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; exit 1; } - _add_opt_dep $(_mkname $package $version $platform) ${tmpreq} || exit 1 - # _add_opt_dep ${name} ${tmpreq} || exit 1 - info "Skipped non-debug path: ${dst[$i]}" $FUNCNAME - unset src[$i] dst[$i] - fi - done - # After possibly unsetting some array member(s) with path(s) to skip - # still want array members to be indexed contiguously - src=(${src[*]}) - dst=(${dst[*]}) -fi - -follow_symlinks=`cmt -q -tag_add=PACK show macro_value ${package}_follow_symlinks` -include_objfiles=`cmt -q -tag_add=PACK show macro_value ${package}_include_objfiles` -if [ -n "$include_objfiles" ]; then - unset exclude_objfiles -else - exclude_objfiles=yes -fi -if [ -n "$export_paths" ] && - [ "${debuginfo}" = yes ] && [ -n "${debuginfo_suffix}" ] && [[ ${CMTCONFIG} != *dbg* ]]; then - do_debuginfo=yes -else - unset do_debuginfo -fi - -if [ "${do_debuginfo:-}" = yes ]; then -# name=`_mkname $package $version $platform` - if [ -n "${platform:-}" ]; then - platform_debuginfo=${platform}_debuginfo - [ "${platform}" != noarch ] || - warn "${package}_platform set to noarch and ${package}_debuginfo_suffix to non-empty" $FUNCNAME - fi - echo "$(_mkname $package $version $platform)" "$package" "$version" "$(_mkname $package $version ${platform_debuginfo:-${CMTCONFIG}_debuginfo})" || exit 1 - # echo "$(_mkname $package $version $platform)" "$package" "$version" "$(_mkname $package $version ${platform_debuginfo:-debuginfo})" || exit 1 -else - echo "$(_mkname $package $version $platform)" "$package" "$version" || exit 1 -fi - -for pltfm in bin debuginfo; do - [ ${pltfm} = debuginfo ] && [ "${do_debuginfo:-}" != yes ] && continue - - if [ ${pltfm} = bin ]; then - name=$(_mkname $package $version $platform) || exit 1 - elif [ ${pltfm} = debuginfo ]; then - name=$(_mkname $package $version ${platform_debuginfo:-${CMTCONFIG}_debuginfo}) || exit 1 - # name=$(_mkname $package $version ${platform_debuginfo:-debuginfo}) || exit 1 - fi - - fpath=${externcache}/cache/$name.pacman - if [ -f $fpath -a "${overwrite}" != yes ]; then - - info "Existing $fpath will not be overwritten" $FUNCNAME - - if [ "${verify}" = yes ]; then - spath=${externcache}/kits/$name.tar.gz - if [ -f $spath -a -n "${src[*]}" ]; then - newer ${follow_symlinks:+-L} -p $spath ${src[*]} - elif [ -f $spath -a -z "${src[*]}" ]; then - warn "$spath: No 'export_paths' to verify" $FUNCNAME - elif [ ! -f $spath -a -n "${src[*]}" ]; then - error "$spath: No such file" $FUNCNAME - fi - fi - - else - - tempcopydir=$(mktemp -d -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; exit 1; } - if [ ${pltfm} = bin ]; then - _tar_extern $name || { \rm -rf $tempcopydir; exit 1; } - elif [ ${pltfm} = debuginfo ]; then - _tar_extern_debuginfo ${name} || { \rm -rf $tempcopydir; exit 1; } - fi - _pacman ${name} ${tmpreq:-} || { \rm -rf $tempcopydir; exit 1; } - \rm -rf $tempcopydir - - fi - [ ! -f $PACKRPM/bin/pack-rpm-extern.sh ] || . $PACKRPM/bin/pack-rpm-extern.sh || exit 1 -done diff --git a/PackDist/scripts/pack-find.py b/PackDist/scripts/pack-find.py deleted file mode 100755 index adf612ca913373d96cc3342063c52f8490b79976..0000000000000000000000000000000000000000 --- a/PackDist/scripts/pack-find.py +++ /dev/null @@ -1,195 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -"""File: pack-find.py - -Usage: pack-find.py [OPTION]... PATH... -Search directory tree rooted at each filename PATH for ${CMTCONFIG} directories, -pathnames matching any of shell patterns, supplied in files 'src.ptn', 'doc.ptn' -in directory ${scriptdir}, excluding any other directories listed in file -'platforms' or pathnames matching any of shell patterns in file 'junk.ptn' and -writing pathnames into files specified with relevant options or on standard output, -followed by a newline. - - --bin-file=BINFILE file for CMTCONFIG value binary directories pathnames - --src-file=SRCFILE file for source code pathnames matching list of patterns in src.ptn - --doc-file=DOCFILE file for documentation pathnames matching list of patterns in doc.ptn - --noarch-file=NOARCHFILE file for any other pathnames except for directories - --dirs-file=DIRSFILE file for any other directories - -d, --debug print lots of debugging information - -h, --help display this help and exit - --version output version information and exit - -Report bugs to <Grigori.Rybkine@cern.ch>. -""" - -__version__ = '0.1.0' -__date__ = 'Sat Feb 06 2010' -__author__ = 'Grigory Rybkin' - -import sys, os -import getopt -from os.path import join, islink, basename -from fnmatch import fnmatch -import logging - -class ProjectFiles(object): - def __init__(self): - self.cmtconfig = os.environ['CMTCONFIG'] - self.scriptdir = os.environ['scriptdir'] - self.types = ['bin', 'src', 'doc', 'noarch', 'dirs'] - for t in self.types: - setattr(self, t, list()) - setattr(self, 'f' + t, None) - - def _init(self): - platforms = open(join(self.scriptdir, 'platforms')) - # platforms to skip - all but ${CMTCONFIG} - self.platforms = [p for p in [p.strip() for p in platforms.readlines()] - if p != self.cmtconfig] - platforms.close() - logger.debug(self.platforms) - - def gen_expr(s): - ptn = [] - for l in s.splitlines(): - ptn.append(l) - if not l.startswith('*'): - ptn.append(join('*', l)) - logger.debug(ptn) - return ptn - def init_ptn(obj, name): - f = open(join(obj.scriptdir, name + '.ptn')) - setattr(obj, name + '_ptn', gen_expr(f.read())) - f.close() - - for name in ['junk', 'src', 'doc']: - init_ptn(self, name) - - def walk(self, top): - self._init() - - def onerror(e): - logger.error(e) - Errno.set(e.errno) - - for root, dirs, files in os.walk(top, onerror = onerror): - for n in dirs + files: - p = join(root, n) - # platforms to skip - all but ${CMTCONFIG} - if n in self.platforms: - if n in dirs and not islink(p): dirs.remove(n) - continue - # platform to pack - ${CMTCONFIG} - if n == self.cmtconfig: - self.bin.append(p) - if n in dirs and not islink(p): dirs.remove(n) -# if n in dirs: dirs.remove(n) - continue - # exclude junk (print nothing) - m = False - for ptn in self.junk_ptn: - if fnmatch(p, ptn): - m = True - break - if m: continue - if n in files or islink(p): - # source code - for ptn in self.src_ptn: - if fnmatch(p, ptn): - m = True - self.src.append(p) - break - if m: continue - # documentation files - for ptn in self.doc_ptn: - if fnmatch(p, ptn): - m = True - self.doc.append(p) - break - if m: continue - # anything else - noarch files - self.noarch.append(p) - else: - # ALL directories - self.dirs.append(p) - return Errno.errno - - def fprint(self): - def write(obj, name): - try: - if getattr(obj, 'f' + name): - f = open(getattr(obj, 'f' + name), 'w') - for line in getattr(obj, name): - f.write(line + '\n') - f.close() - else: - for line in getattr(obj, name): - sys.stdout.write(line + '\n') - except IOError, e: - logger.error(e) - Errno.set(e.errno) - - for t in self.types: - write(self, t) - -class Errno: - def set(code): - Errno.errno = code - set = staticmethod(set) - errno = 0 - -def help(): - print sys.modules[__name__].__doc__ - -def main(argv=[__name__]): - self = basename(argv[0]) - try: - opts, args = getopt.getopt(argv[1:], - "hd", - ["bin-file=", "src-file=", "doc-file=", - "noarch-file=", "dirs-file=", - "help", "version", "debug"]) - except getopt.error, e: - print >>sys.stderr, '%s: %s' % (self, str(e)) - print >>sys.stderr, "Try '%s --help' for more information." % self - return 1 - - global logger - logging.basicConfig() - logger = logging.getLogger(self) - logger.setLevel(logging.INFO) - - pfs = ProjectFiles() - - for o, v in opts: - if o in ("-h", "--help"): - print sys.modules[__name__].__doc__ - return 0 - elif o in ("--version",): - print '%s %s (%s)' % (self, __version__, __date__) - print '%sWritten by %s.' % (os.linesep, __author__) - return 0 - elif o in ("-d", "--debug"): - logger.setLevel(logging.DEBUG) - else: - for type in pfs.types: - if o == '--' + type + '-file': - setattr(pfs, 'f' + type, v) - logger.debug('set %r to %r' % (o, v)) - - if not args: - args = [os.curdir] -# print >>sys.stderr, '%s: missing path argument' % self -# print >>sys.stderr, "Try '%s --help' for more information." % self -# return 1 - - for arg in args: - pfs.walk(arg) -# if 0 != Errno.errno: return 1 - pfs.fprint() - if 0 != Errno.errno: return 1 - else: return 0 - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/PackDist/scripts/pack-proj.sh b/PackDist/scripts/pack-proj.sh deleted file mode 100755 index 3af67c9b4c4cbfebdf9f950656acb01eb1172411..0000000000000000000000000000000000000000 --- a/PackDist/scripts/pack-proj.sh +++ /dev/null @@ -1,1700 +0,0 @@ -#!/bin/bash -# File: pack-proj.sh -# -# Pack project in five parts: -# binary platform - corresponds to CMTCONFIG value -# debuginfo files (for not debug build) -# source code -# documentation files -# other architecture independent files -# -# Author: Grigori Rybkine <Grigori.Rybkine@cern.ch>. -# - -[ "$PACKPROJDEBUG" ] && set -x - -: ${projbase:?} -: ${project:?} ${release:?} -#: ${platform:?} -: ${projcache:?} # ${upgrade:?} #${patchdir:?} ${overwrite:?} - -: ${scriptdir:?} -. $scriptdir/pack-common.sh - -: ${cmthome:?} -: ${cmtcache:?} - -# : ${requires:?} -#[ -f "$requires" ] || requires=$(mktemp) || return 1 - -: ${externcache:?} ${patchdir:?} ${overwrite:?} - -: ${CMTCONFIG:?} - -##################################### functions ##################################### -_mktmpdir () -{ -# -# Make temporary directory, set 'tmpdir' and, -# if possible, the TMPDIR environment variable to it -# -# (the latter allows to call mktemp(1) with specifying no template -# and have all temporary files rooted in 'tmpdir') -# -# Parameters: ['directory' in which to place the temporary directory] -# - -#: ${builddir:?} -#[ -d "$builddir" ] || builddir=$(mktemp -d) || return 1 -if [ -d "${1}" ]; then - tmpdir=$(mktemp -d ${1}/pack.$$.XXXXXXXXXX) || return 1 -else # make temp dir in TMPDIR, if set, or in /tmp - tmpdir=$(mktemp -dt pack.$$.XXXXXXXXXX) || return 1 -fi - -#trap 'rm -rf $tmpdir; exit 1' 1 2 15 -trap 'rm -rf $tmpdir; exit 1' 2 15 - -# want all temp files in 'tmpdir' -export TMPDIR=$tmpdir || -warn "Temporary directory may not be cleaned up on completion: $TMPDIR" $FUNCNAME -tmppatch=$tmpdir/patch -mkdir $tmppatch || { error "mkdir" $FUNCNAME; return 1; } -if [ -n "${PACKRPM:-}" ]; then - builddir=$tmpdir/BUILD - mkdir ${builddir} || { error "mkdir" $FUNCNAME; return 1; } - export builddir || { error "export" $FUNCNAME; return 1; } - buildrootdir=$tmpdir/BUILDROOT - mkdir ${buildrootdir} || { error "mkdir" $FUNCNAME; return 1; } - export buildrootdir || { error "export" $FUNCNAME; return 1; } - if [ -z "${specdir+T}" ]; then # specdir is unset - specdir=$tmpdir/SPECS - mkdir ${specdir} || { error "mkdir" $FUNCNAME; return 1; } - export specdir || { error "export" $FUNCNAME; return 1; } - fi -fi -} - -_mkname () -{ -# -# Parameters: 'project' 'release' 'platform' -# (bin src doc noarch debuginfo) -# -if [ $3 == bin ]; then - sed 's/[-.]/_/g' <<<${1}_${2}_${CMTCONFIG} || { error "sed" $FUNCNAME; return 1; } -elif [ $3 == debuginfo ]; then - sed 's/[-.]/_/g' <<<${1}_${2}_${CMTCONFIG}_debuginfo || { error "sed" $FUNCNAME; return 1; } -else - sed 's/[-.]/_/g' <<<${1}_${2}_${3} || { error "sed" $FUNCNAME; return 1; } -fi -} - -_mkver () -{ -# -# Make package version and print on the standard output -# -# Parameters: ['version'] -# -local ver - -ver=$(awk ' -{ n=split($0, a, /[-vrp.]/) -for (i=1; i<=n; i++) { - if (a[i] ~ /[[:digit:]]+/) - if (v != "") v=v"."a[i] - else v=a[i] -} -print v } -' <<<"$1") -echo ${ver:-0} -} - -_getver () -{ -# -# Determine package version and print on the standard output -# (empty if cannot be determined ) -# -# Parameters: 'name' -# -local fpath - -fpath=${projcache}/cache/${1}.pacman - -#[ -f $fpath ] || { echo 0; return; } -[ -f $fpath ] || return 0 -sed -e '/^[ \t]*version(.*)[ \t]*$/!d' -e 's/version(//' -e 's/)[ \t]*$//' -e "s/['\"]//g" $fpath || { error "sed" $FUNCNAME; return 1; } -# [ "$_ver" ] && { echo $_ver; return; } -# echo 0 -} - -_mkcntnr () -{ -# -# Parameters: 'project' -# Print on the standard output: 'container' (container-name [access-path]) -# -[ $# -eq 1 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -case $1 in - LCGCMT) echo LCG_Release ;; - Gaudi) echo Gaudi ;; - Atlas?*) echo ${1}Release ;; - tdaq-common) echo TDAQCRelease ;; - dqm-common) echo DQMCRelease ;; - *) error "Unknown project: $1" $FUNCNAME; return 1 ;; -esac -} - -_getcntnr () -{ -# -# Parameters: 'project-release-directory' 'project' 'release' -# Print on the standard output: 'container' (container-name [access-path]) -# -[ $# -eq 3 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -local -a cntnr -if [ -f $1/cmt/project.cmt ]; then -# determine which package is container -cntnr=($(awk '$1 == "container" && $2 ~ /./ { print $2, $4; exit }' $1/cmt/project.cmt)) -case ${#cntnr[*]} in - 0) warn "No container specification: $1/cmt/project.cmt" $FUNCNAME; return 1 ;; - 1) : ;; - 2) cntnr[1]=$(sed 's#/*$#/#' <<<${cntnr[1]}) ;; - *) error "Invalid container specification: ${cntnr[*]}: $1/cmt/project.cmt" $FUNCNAME - return 1 ;; -esac -echo ${cntnr[*]} -# case ${#cntnr[*]} in -# 0) warn "Cannot determine container package of $2 $3 ($1)" $FUNCNAME -# cntnr=($(_mkcntnr $2)) || return 1 ;; -# 1) : ;; -# # 1) cntnr[1]=. ;; -# 2) cntnr[1]=$(sed 's#/*$#/#' <<<${cntnr[1]}) ;; -# *) error "Wrong container package specification for $2 $3 ($1): ${cntnr[*]}" $FUNCNAME -# return 1 ;; -# esac -local proj=$(awk '$1 == "project" && $2 ~ /./ { print $2; exit }' $1/cmt/project.cmt) -[ "$proj" ] || warn "No project specification: $1/cmt/project.cmt" $FUNCNAME -else - error "$1/cmt/project.cmt: No such file" $FUNCNAME; return 1 -fi -} - -_gen_expr () -{ -# -# Parameters: 'patterns-file'... -# Print on the standard output `find' expression which is true for any pathname matching -# any of the patterns in 'patterns-file'... -# -[ $# -ge 1 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -awk ' -BEGIN { expr = " (" } -{ if (NR != 1) expr = expr " -o" - if (substr($1, 1, 1) != "*") expr = expr " -path */"$1 - else expr = expr " -path "$1 -} -END { print expr " )" } -' "$@" || { error "awk" $FUNCNAME; return 1; } -} - -_prep_lists () -{ -# -# Parameters: 'project-release-directory' 'project' 'release' -# 'bin-file' 'src-file' 'doc-file' 'noarch-file' -# 'dirs-file' 'debuginfo-file' -# -[ $# -eq 9 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } - -if [ ${uname} = Linux ]; then - -local tmppltfms=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -cp $scriptdir/platforms $tmppltfms || { error "cp" $FUNCNAME; return 1; } -sed '\%^'${CMTCONFIG}'$%d' ${tmppltfms} >${tmppltfms}.tmp || -{ error "sed" $FUNCNAME; return 1; } -mv -f ${tmppltfms}.tmp ${tmppltfms} || { error "mv" $FUNCNAME; return 1; } -#sed -i '\%^'${CMTCONFIG}'$%d' ${tmppltfms} || { error "sed" $FUNCNAME; return 1; } - -local opts=-noleaf -local _expr - -# platforms to skip - all but ${CMTCONFIG} -_expr="$opts $( -awk ' -BEGIN { expr = "(" } -{ if (NR != 1) expr = expr " -o" - expr = expr " -name "$1 -} -END { print expr " ) -prune" } -' $tmppltfms -)" || { error "awk" $FUNCNAME; return 1; } - -# platform to pack - ${CMTCONFIG} -_expr="$_expr -o -name $CMTCONFIG -prune -fprint $4" - -# exclude junk (print nothing) -_expr="$_expr -o $(_gen_expr $scriptdir/junk.ptn)" || return 1 - -# source code -_expr="$_expr -o ! -type d $(_gen_expr $scriptdir/src.ptn) -fprint $5" || return 1 - -# documentation files -_expr="$_expr -o ! -type d $(_gen_expr $scriptdir/doc.ptn) -fprint $6" || return 1 - -# anything else - noarch files and ALL directories -_expr="$_expr -o ! -type d -fprint $7 -o -fprint $8" -# anything else - after a cleanup - noarch files -#_expr="$_expr -o ( ! -type d -o -empty ) -fprint $7" - -fi # end Linux - -cd $(dirname $(dirname $1)) || { error "cd" $FUNCNAME; return 1; } - -local projdir -if [ $2 == AtlasRelease ]; then -# projdir=dist - projdir=$(basename $(dirname $1)) -else - projdir=$2 -fi - -if [ ${uname} = Linux ]; then - -set -f - find ${projdir}/$3/ $_expr || { error "find" $FUNCNAME; return 1; } -set +f - -else - -$scriptdir/pack-find.py --bin-file=$4 --src-file=$5 --doc-file=$6 --noarch-file=$7 --dirs-file=$8 ${projdir}/$3/ || return 1 - -fi # end Linux - -if [ -n "${debuginfosuffix:-}" ] && [ "${mode:-}" != dbg ]; then - if [ -s $4 ]; then - xargs sh -c 'find "$@" -name "*$debuginfosuffix"' find <$4 >>$9 - #xargs -I % find % -name "*$debuginfosuffix" <$4 >>$9 - case $? in - 123|124) error "find" $FUNCNAME; return 1 ;; - 125|126|127|1) error "xargs" $FUNCNAME; return 1 ;; - esac - fi -fi - -cd $OLDPWD || { error "cd" $FUNCNAME; return 1; } - -[ -s $4 ] || warn "No binaries: $1 $2 $3" $FUNCNAME -[ -s $5 ] || warn "No source code: $1 $2 $3" $FUNCNAME -[ -s $6 ] || warn "No documentation: $1 $2 $3" $FUNCNAME -[ -s $7 ] || warn "No noarch: $1 $2 $3" $FUNCNAME -[ -s $8 ] || warn "No directories: $1 $2 $3" $FUNCNAME -if [ "${debuginfo:-}" = yes ] && [ "${mode:-}" != dbg ]; then - [ -s $9 ] || warn "No debuginfo: $1 $2 $3" $FUNCNAME -fi - -if [ "$PACKPROJDEBUG" ]; then - echo "binaries:" >&2 - cat $4 >&2 - echo "source code:" >&2 - cat $5 >&2 - echo "documentation:" >&2 - cat $6 >&2 - echo "noarch:" >&2 - cat $7 >&2 - echo "directories:" >&2 - cat $8 >&2 - echo "debuginfo:" >&2 - cat $9 >&2 -fi - -rm -f $tmppltfms || return 0 -} - -_prep_lists_ () -{ -# -# Parameters: 'project-release-directory' 'project' 'release' -# 'bin-file' 'src-file' 'doc-file' 'noarch-file' -# 'dirs-file' -# -[ $# -eq 8 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } - -local tmppltfms=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -cp $scriptdir/platforms $tmppltfms || { error "cp" $FUNCNAME; return 1; } -sed -i '\%^'${CMTCONFIG}'$%d' ${tmppltfms} || { error "sed" $FUNCNAME; return 1; } - -local opts=-noleaf -local _expr - -# platforms to skip - all but ${CMTCONFIG} -_expr="$opts $( -awk ' -BEGIN { expr = "(" } -{ if (NR != 1) expr = expr " -o" - expr = expr " -name "$1 -} -END { print expr " ) -prune" } -' $tmppltfms -)" - -# platform to pack - ${CMTCONFIG} -_expr="$_expr -o -name $CMTCONFIG -prune -fprint $4" - -# exclude junk -_expr="$_expr -o $( -awk ' -BEGIN { expr = " (" } -{ if (NR != 1) expr = expr " -o" - if (substr($1, 1, 1) != "*") expr = expr " -path */"$1 - else expr = expr " -path "$1 -} -END { print expr " )" } -' $scriptdir/junk.ptn -)" -# print nothing - -# source code -_expr="$_expr -o $( -awk ' -BEGIN { expr = "! -type d (" } -{ if (NR != 1) expr = expr " -o" - if (substr($1, 1, 1) != "*") expr = expr " -path */"$1 - else expr = expr " -path "$1 -} -END { print expr " )" } -' $scriptdir/src.ptn -)" -_expr="$_expr -fprint $5" -#_expr="$_expr -fprint $5 -fprintf $8 %h\n" # file's directory - -# documentation files -_expr="$_expr -o $( -awk ' -BEGIN { expr = "! -type d (" } -{ if (NR != 1) expr = expr " -o" - if (substr($1, 1, 1) != "*") expr = expr " -path */"$1 - else expr = expr " -path "$1 -} -END { print expr " )" } -' $scriptdir/doc.ptn -)" -_expr="$_expr -fprint $6" - -# anything else - after a cleanup - noarch files and ALL directories -_expr="$_expr -o ! -type d -fprint $7 -o -fprint $8" -# anything else - after a cleanup - noarch files -#_expr="$_expr -o ( ! -type d -o -empty ) -fprint $7" - -cd $1/../.. || { error "cd" $FUNCNAME; return 1; } -set -f -if [ $2 == AtlasRelease ]; then -# find dist/$3 $_expr || return 1 - find $(basename $(dirname $1))/$3 $_expr || { error "find" $FUNCNAME; return 1; } -else - find $2/$3 $_expr || { error "find" $FUNCNAME; return 1; } -fi -set +f -cd $OLDPWD || { error "cd" $FUNCNAME; return 1; } - -[ -s $5 ] || warn "No source code: $1 $2 $3" $FUNCNAME -[ -s $6 ] || warn "No documentation: $1 $2 $3" $FUNCNAME - -[ "$PACKPROJDEBUG" ] && cat $8 >&2 - -rm -f $tmppltfms || return 0 -} - -_prep_extern_debuginfo_list () -{ -# -# Parameters: 'project-release-directory' 'project' 'release' 'exps-file' -# 'debuginfo-file' -# -[ $# -eq 5 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } - -local tmpptns=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -awk ' -BEGIN { FS = "\0" } -{ if ($3 != "") sfxs[$3] = 1 } -END { for (sfx in sfxs) print "*"sfx } -' "$4" <&- >> $tmpptns || { error "awk" $FUNCNAME; return 1; } - -[ -s $tmpptns ] || { >| $5; return 0; } - -local _expr -_expr="${noleaf:+-noleaf} $(_gen_expr $tmpptns) -fprint $5" || return 1 - -cd $1/${cntnr[1]}${cntnr[0]}/${verdir}cmt || { error "cd" $FUNCNAME; return 1; } -local installarea_prefix -installarea_prefix=$(cmt show macro_value ${2}_installarea_prefix) || { error "cmt" $FUNCNAME; return 1; } -cd $OLDPWD || { error "cd" $FUNCNAME; return 1; } - -cd $(dirname $(dirname $1)) || { error "cd" $FUNCNAME; return 1; } -local projdir -if [ $2 == AtlasRelease ]; then -# projdir=dist - projdir=$(basename $(dirname $1)) -else - projdir=$2 -fi -set -f - find ${projdir}/$3/${installarea_prefix} $_expr || { error "find" $FUNCNAME; return 1; } -set +f -cd $OLDPWD || { error "cd" $FUNCNAME; return 1; } - -[ -s $5 ] || info "No extern_debuginfo: $1 $2 $3" $FUNCNAME - -if [ "$PACKPROJDEBUG" ]; then - echo "extern_debuginfo:" >&2 - cat $5 >&2 -fi - -rm -f $tmpptns || return 0 -} - -_clean () -{ -# -# Parameters: 'project-release-directory' 'project' 'release' -# -[ $# -eq 3 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -local projdir - -if [ $2 == AtlasRelease ]; then -# projdir=dist - projdir=$(basename $(dirname $1)) -else - projdir=$2 -fi - -rm -rf $tmpdir/${projdir}/$3 || { error "rm" $FUNCNAME; return 1; } -} - -_copy () -{ -# -# Usage: _copy [OPTION]... 'project-release-directory' 'project' 'release' 'names-file'... -# -# -n do not recursively descend directories -# -r recursively descend directories (the default) -# -x PATTERN exclude files that match PATTERN -# -X FILE exclude files that match any pattern in FILE -# -local opts exclude exclude_from -OPTIND=1 -while getopts "nrx:X:" opt; do - case $opt in - n) opts=--no-recursion ;; - r) opts=--recursion ;; - x) exclude="${OPTARG}" ;; - X) exclude_from="${OPTARG}" ;; - \?) error "Invalid option: -${OPTARG}" $FUNCNAME; return 1 ;; - :) error "Argument required for option: -${OPTARG}" $FUNCNAME; return 1 ;; - esac -done - -shift $(($OPTIND - 1)) -[ $# -ge 4 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } - -cd $(dirname $(dirname $1)) || { error "cd" $FUNCNAME; return 1; } -shift 3 - -#local tmperr=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } - -local list sc -for list; do -[ -s $list ] || continue - -# want to check exit status of the first tar in the pipe -exec 3>&1 || { error "exec" $FUNCNAME; return 1; } -sc=`((tar ${tar_basic_opts} ${opts} -cf - \ - -X $scriptdir/pltfm-junk.ptn \ - -X $scriptdir/extern-junk.ptn \ - ${exclude_from:+-X "${exclude_from}"} \ - ${exclude:+--exclude="${exclude}"} \ - -T $list 3>&- 4>&-; echo $? >&4) | \ - tar ${opts} -C $tmpdir -xf - >&3 3>&- 4>&-) 4>&1 >&-` || -{ warn "Disk space on the filesystem of $tmpdir: -$(cat $list|duf -p $tmpdir)" $FUNCNAME -exec 3>&- -error "tar" $FUNCNAME; return 1; } -exec 3>&- -[ $sc -eq 0 ] || { error "tar" $FUNCNAME; return 1; } - -# BSDTAR issues on stderr -# tar: getpwuid(XXXXX) failed: No such file or directory -# if no matching entry for user uid XXXXX is found in password database -# GNUTAR does NOT -done - -#rm -f $tmperr -cd $OLDPWD || { error "cd" $FUNCNAME; return 1; } -} - -_copy_ () -{ -# -# Parameters: 'project-release-directory' 'project' 'release' 'names-file' -# -[ $# -eq 4 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } - -if [ $2 == AtlasRelease ]; then -# rm -rf $tmpdir/dist/$3 || return 1 - rm -rf $tmpdir/$(basename $(dirname $1))/$3 || return 1 -else - rm -rf $tmpdir/$2/$3 || return 1 -fi - -cd $1/../.. || { error "cd" $FUNCNAME; return 1; } - -local tmperr=$(mktemp -t tmp.XXXXXXXXXX) || return 1 -tar ${tar_basic_opts} -cf - -X $scriptdir/junk.ptn -X $scriptdir/pltfm-junk.ptn \ - -T $4 2>|$tmperr | (cd $tmpdir; tar -xf -) || { - -warn "Disk space on the filesystem of $tmpdir: -$(cat $4|duf -p $tmpdir)" $FUNCNAME - -error "tar" $FUNCNAME; return 1; } - -# cannot check exit status -[ -s $tmperr ] && { error "\n$(<$tmperr)" $FUNCNAME; return 1; } - -rm -f $tmperr -cd $OLDPWD || { error "cd" $FUNCNAME; return 1; } -} - -_install_dirs () -{ -# -# Parameters: ['directories-file'...] -# -cd $tmpdir || { error "cd" $FUNCNAME; return 1; } -local list -for list; do - [ -s $list ] || continue - xargs install -d <$list -# xargs mkdir -p <$list - case $? in - 123|124) error "install" $FUNCNAME; return 1 ;; -# 123|124) error "mkdir" $FUNCNAME; return 1 ;; - 125|126|127|1) error "xargs" $FUNCNAME; return 1 ;; - esac -done -cd $OLDPWD || { error "cd" $FUNCNAME; return 1; } -} - -_symlinks () -{ -# -# Usage: _symlinks [OPTION]... 'project-release-directory' 'project' 'release' ['exps-file'] -# -# -I relink symbolic links to external debuginfo files -# -local debuginfo -OPTIND=1 -while getopts "I" opt; do - case $opt in - I) debuginfo=yes ;; - \?) error "Invalid option: -${OPTARG}" $FUNCNAME; return 1 ;; - :) error "Argument required for option: -${OPTARG}" $FUNCNAME; return 1 ;; - esac -done - -shift $(($OPTIND - 1)) -[ $# -eq 3 -o $# -eq 4 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -local tmperr=$(mktemp -t tmp.XXXXXXXXXX) || return 1 -local projdir - -if [ $2 == AtlasRelease ]; then -# projdir=dist - projdir=$(basename $(dirname $1)) -else - projdir=$2 -fi - -[ -d $tmpdir/${projdir}/$3 ] || return 0 - -$scriptdir/relink.py -S $1 -H ${projdir}/$3 ${4:+-X ${4}} ${debuginfo:+-I} $tmpdir/${projdir}/$3 >/dev/null 2>|$tmperr || -{ [ -s $tmperr ] && cat $tmperr >&2 -error "$scriptdir/relink.py" $FUNCNAME; return 1; } - -[ -s $tmperr ] && warn "\n$(<$tmperr)" $FUNCNAME - -if [ -z "${4:-}" ]; then -# check symlinks left -type symlinks >/dev/null || { warn "type" $FUNCNAME; return 0; } -symlinks -r $tmpdir/${projdir}/$3 | grep '^absolute\|^other_fs\|^dangling\|^messy' >|$tmperr - -# check exit status instead? -[ -s $tmperr ] && warn "Suspicious symlinks left:\n$(<$tmperr)" $FUNCNAME -fi - -rm -f $tmperr || return 0 -} - -_tar () -{ -# -# Parameters: 'project' 'release' 'name' -# -[ $# -eq 3 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -#cd $tmpdir || { error "cd" $FUNCNAME; return 1; } -local reldir - -if [ $1 == AtlasRelease ]; then -# reldir=dist/$2 - reldir=$(basename ${projbase})/$2 -else - reldir=$1/$2 -fi - -local fpath=${projcache}/kits/${3}.tar.gz - -rm -f ${fpath} || { error "rm" $FUNCNAME; return 1; } - -[ -d $tmpdir/$reldir ] || -{ info "Nothing to include: $fpath" $FUNCNAME; return 0; } -# { install -d $reldir && info "Created directory '$reldir'" $FUNCNAME; } || -# { error "install" $FUNCNAME; return 1; } - -info "Writing $fpath" $FUNCNAME - -# -z -v --remove-files \ - -tar ${tar_basic_opts} -C $tmpdir -cf $fpath \ - -z -v \ - $reldir >&2 || -{ warn "Disk space on the filesystem of `dirname $fpath`: -$(duf -p `dirname $fpath` $tmpdir/$reldir)" $FUNCNAME -rm -f $fpath -error "tar" $FUNCNAME; return 1; } - -#cd $OLDPWD -rm -rf $tmpdir/$reldir || return 0 -} - -_patch () -{ -# -# Parameters: 'project' 'release' 'name' -# -[ $# -eq 3 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -local reldir=$1/$2 -[ -d "$tmppatch/$reldir" ] || return 0 - -local tmplist=$(mktemp -t tmp.XXXXXXXXXX) || return 1 - -cd $tmppatch || { error "cd" $FUNCNAME; return 1; } -#find $reldir -noleaf -type f -fprint $tmplist || -find $reldir ${noleaf:+-noleaf} -type f >>$tmplist || -{ error "find" $FUNCNAME; cd $OLDPWD; return 1; } -cd $OLDPWD - -local fpath=${projcache}/kits/${3}.tar - -gunzip -t ${fpath}.gz || { error "gunzip" $FUNCNAME; return 1; } -gunzip -f ${fpath}.gz || { error "gunzip" $FUNCNAME; return 1; } - -info "Appending to ${fpath}.gz" $FUNCNAME - -#tar -v ${tar_basic_opts} -rf $fpath -C $tmppatch $reldir >&2 || -tar -v ${tar_basic_opts} -rf $fpath -C $tmppatch -T $tmplist >&2 || -{ rm -rf $fpath; error "tar" $FUNCNAME; return 1; } -rm -f $tmplist -gzip -f ${fpath} || { error "gzip" $FUNCNAME; return 1; } -} - -_settings () -{ -# -# Pack AtlasSettings, AtlasLogin packages -# Pack AtlasSetup package -# Print on the standard output information on them (format: 'name' 'package' 'version') -# -local tmppre=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -local name fpath curver nver -local -a pkg - -cd ${cmthome} || { error "cd" $FUNCNAME; return 1; } -cmt show uses | awk ' -$1 == "use" && $2 ~ /Atlas(Settings|Login)/ { gsub(/[()]/, "", $4); print $2, $3, $4} -' | -while read -a pkg; do - #name=$(sed "s/${pkg[0]}-${pkg[0]}/${pkg[0]}/" <<<${pkg[0]}-${pkg[1]}) - name=${pkg[0]} - -# echo $name ${pkg[0]} ${pkg[1]} - - fpath=${projcache}/kits/$name.tar.gz - curver=$(_mkver ${pkg[1]}) - if [ ${curver} == "$(_getver $name)" ]; then - if [ -f ${fpath} ]; then - info "Existing ${fpath} will not be overwritten" $FUNCNAME - else - error "${fpath}: No such file" $FUNCNAME - fi - elif [ -f ${fpath} -a -f ${projcache}/cache/$name.pacman -a "${keep}" == yes ]; then - warn "Keeping ${fpath} ($(_getver $name)) while using different version: ${pkg[0]} ${pkg[1]} ${pkg[2]}" $FUNCNAME - nver=$(tar -ztf ${fpath}|sed -n 's!^'${pkg[0]}'/\([^/]\+\)/*$!\1!p') || - { error "sed" $FUNCNAME; } - if [ "$nver" ]; then - pkg[1]=$nver - else - error "Cannot determine native version: ${fpath}" $FUNCNAME - fi - else - info "Writing ${fpath}" $FUNCNAME - - tar -v ${tar_basic_opts} -cf ${fpath} -z \ - -X $scriptdir/junk.ptn \ - -C ${pkg[2]} ${pkg[0]}/${pkg[1]} 1>&2 || - { rm -f ${fpath}; error "tar" $FUNCNAME; } - _pre ${pkg[2]}/${pkg[0]}/${pkg[1]} ${pkg[0]} ${pkg[1]} >|${tmppre} - _pacman $name "" "" ${tmppre} ${curver} - fi - - echo $name ${pkg[0]} ${pkg[1]} - - [ ! -f $PACKRPM/bin/pack-rpm-settings.sh ] || . $PACKRPM/bin/pack-rpm-settings.sh - -done # || return 1 -cd $OLDPWD - -if [ -d "${setuproot:-}" ]; then - cd ${setuproot}/cmt || { error "cd" $FUNCNAME; return 1; } - pkg[0]=$(basename ${setuproot}) - #pkg[0]=$(cmt show macro_value package) - pkg[1]=$(cmt show macro_value version) - pkg[2]=$(dirname ${setuproot}) - - name=${pkg[0]} - - fpath=${projcache}/kits/$name.tar.gz - curver=$(_mkver ${pkg[1]}) - if [ ${curver} == "$(_getver $name)" ]; then - if [ -f ${fpath} ]; then - info "Existing ${fpath} will not be overwritten" $FUNCNAME - else - error "${fpath}: No such file" $FUNCNAME - fi - elif [ -f ${fpath} -a -f ${projcache}/cache/$name.pacman -a "${keep}" == yes ]; then - warn "Keeping ${fpath} ($(_getver $name)) while using different version: ${pkg[0]} ${pkg[1]} ${pkg[2]}" $FUNCNAME - # determine native version in the tarball - nver=$(tar -O -zxf ${fpath} ${pkg[0]}/cmt/version.cmt) || - { error "tar" $FUNCNAME; } - if [ "$nver" ]; then - pkg[1]=$nver - else - error "Cannot determine native version: ${fpath}" $FUNCNAME - fi - else - info "Writing ${fpath}" $FUNCNAME - - tar -v ${tar_basic_opts} -cf ${fpath} -z \ - -X $scriptdir/junk.ptn \ - -C ${pkg[2]} ${pkg[0]} 1>&2 || - { rm -f ${fpath}; error "tar" $FUNCNAME; } - _pre ${pkg[2]}/${pkg[0]} ${pkg[0]} ${pkg[1]} >|${tmppre} - _pacman $name "" "" ${tmppre} ${curver} - fi - - echo $name ${pkg[0]} ${pkg[1]} - - [ ! -f $PACKRPM/bin/pack-rpm-settings.sh ] || . $PACKRPM/bin/pack-rpm-settings.sh - - cd $OLDPWD -fi - -rm -f $tmppre || return 0 -} - -_pre () -{ -# -# Print on the standard output pre-install script -# -# Parameters: 'project-release-directory' 'project'|'package' 'release'|'version' -# -if [ $2 == AtlasSettings ]; then -awk ' -BEGIN { printf "mkdir -p @INSTALL_PREFIX@/.cmtsite; if [ -f @INSTALL_PREFIX@/.cmtsite/requirements ]; then mv -f @INSTALL_PREFIX@/.cmtsite/requirements @INSTALL_PREFIX@/.cmtsite/requirements.orig; cmtconfig_=`awk \"/^macro cmtconfig_default/{print \\\\\\$3}\" @INSTALL_PREFIX@/.cmtsite/requirements.orig`; fi; printf \""} -{ gsub(/\$/,"\\$"); printf "%s\\n", $0 } -END { printf "\" >@INSTALL_PREFIX@/.cmtsite/requirements; if [ \"${cmtconfig_:-}\" ]; then sed \"s/^macro cmtconfig_default.*/macro cmtconfig_default ${cmtconfig_}/g\" @INSTALL_PREFIX@/.cmtsite/requirements >@INSTALL_PREFIX@/.cmtsite/requirements.$$ && mv -f @INSTALL_PREFIX@/.cmtsite/requirements.$$ @INSTALL_PREFIX@/.cmtsite/requirements; fi" } -' $scriptdir/basic-requirements.template - -[ $? -eq 0 ] || { error "awk" $FUNCNAME; return 1; } - -elif [ $2 == AtlasLogin ]; then -awk ' -BEGIN { printf "mkdir -p @INSTALL_PREFIX@/cmtsite; if [ -f @INSTALL_PREFIX@/cmtsite/requirements ]; then mv -f @INSTALL_PREFIX@/cmtsite/requirements @INSTALL_PREFIX@/cmtsite/requirements.orig; cmtconfig_=`awk \"/^macro cmtconfig_default/{print \\\\\\$3}\" @INSTALL_PREFIX@/cmtsite/requirements.orig`; fi; printf \""} -FILENAME == "'$scriptdir/requirements.template'" { gsub(/\$/,"\\$"); if (NR != 1) printf "\\n%s", $0; else printf "%s", $0 } -FILENAME == "'$scriptdir/platforms'" { printf "\\t%s %s", $1, $1 } -END { printf "\\n\" >@INSTALL_PREFIX@/cmtsite/requirements; if [ \"${cmtconfig_:-}\" ]; then sed \"s/^macro cmtconfig_default.*/macro cmtconfig_default ${cmtconfig_}/g\" @INSTALL_PREFIX@/cmtsite/requirements >@INSTALL_PREFIX@/cmtsite/requirements.$$ && mv -f @INSTALL_PREFIX@/cmtsite/requirements.$$ @INSTALL_PREFIX@/cmtsite/requirements; fi" } -' $scriptdir/requirements.template $scriptdir/platforms - -[ $? -eq 0 ] || { error "awk" $FUNCNAME; return 1; } - -elif [ $2 == AtlasSetup ]; then -cat <<\EOF -mkdir -p @INSTALL_PREFIX@/cmtsite; if [ -f @INSTALL_PREFIX@/cmtsite/asetup.sh ]; then mv -f @INSTALL_PREFIX@/cmtsite/asetup.sh @INSTALL_PREFIX@/cmtsite/asetup.sh.orig; fi; printf "export AtlasSetup=@INSTALL_PREFIX@/AtlasSetup\nsource @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.sh \$*\nalias asetup=\'source @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.sh\'\n" >@INSTALL_PREFIX@/cmtsite/asetup.sh; if [ -f @INSTALL_PREFIX@/cmtsite/asetup.csh ]; then mv -f @INSTALL_PREFIX@/cmtsite/asetup.csh @INSTALL_PREFIX@/cmtsite/asetup.csh.orig; fi; printf "setenv AtlasSetup @INSTALL_PREFIX@/AtlasSetup\nsource @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.csh \$*\nalias asetup \'source @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.csh\'\n" >@INSTALL_PREFIX@/cmtsite/asetup.csh; asetup_defaults="standalone = True\nreleasesarea = @INSTALL_PREFIX@ `dirname @INSTALL_PREFIX@` $(dirname $(dirname @INSTALL_PREFIX@))/\${CMTCONFIG}\n"; if [ ! -f @INSTALL_PREFIX@/cmtsite/asetup_defaults ]; then printf "${asetup_defaults}" >@INSTALL_PREFIX@/cmtsite/asetup_defaults; elif ! printf "${asetup_defaults}" | cmp -s @INSTALL_PREFIX@/cmtsite/asetup_defaults -; then printf "${asetup_defaults}" >@INSTALL_PREFIX@/cmtsite/asetup_defaults.new; fi -EOF - -#mkdir -p @INSTALL_PREFIX@/cmtsite; if [ -f @INSTALL_PREFIX@/cmtsite/asetup.sh ]; then mv -f @INSTALL_PREFIX@/cmtsite/asetup.sh @INSTALL_PREFIX@/cmtsite/asetup.sh.orig; fi; printf "export AtlasSetup=@INSTALL_PREFIX@/AtlasSetup\nsource @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.sh \$*\nalias asetup=\'source @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.sh\'\n" >@INSTALL_PREFIX@/cmtsite/asetup.sh; if [ -f @INSTALL_PREFIX@/cmtsite/asetup.csh ]; then mv -f @INSTALL_PREFIX@/cmtsite/asetup.csh @INSTALL_PREFIX@/cmtsite/asetup.csh.orig; fi; printf "setenv AtlasSetup @INSTALL_PREFIX@/AtlasSetup\nsource @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.csh \$*\nalias asetup \'source @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.csh\'\n" >@INSTALL_PREFIX@/cmtsite/asetup.csh; asetup_defaults="standalone = True\nreleasesarea = @INSTALL_PREFIX@ `dirname @INSTALL_PREFIX@`\n"; if [ ! -f @INSTALL_PREFIX@/cmtsite/asetup_defaults ]; then printf "${asetup_defaults}" >@INSTALL_PREFIX@/cmtsite/asetup_defaults; elif ! printf "${asetup_defaults}" | cmp -s @INSTALL_PREFIX@/cmtsite/asetup_defaults -; then printf "${asetup_defaults}" >@INSTALL_PREFIX@/cmtsite/asetup_defaults.new; fi - -#mkdir -p @INSTALL_PREFIX@/cmtsite; if [ -f @INSTALL_PREFIX@/cmtsite/asetup.sh ]; then mv -f @INSTALL_PREFIX@/cmtsite/asetup.sh @INSTALL_PREFIX@/cmtsite/asetup.sh.orig; fi; printf "export AtlasSetup=@INSTALL_PREFIX@/AtlasSetup\nsource @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.sh \$*\nalias asetup=\'source @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.sh\'\n" >@INSTALL_PREFIX@/cmtsite/asetup.sh; if [ -f @INSTALL_PREFIX@/cmtsite/asetup.csh ]; then mv -f @INSTALL_PREFIX@/cmtsite/asetup.csh @INSTALL_PREFIX@/cmtsite/asetup.csh.orig; fi; printf "setenv AtlasSetup @INSTALL_PREFIX@/AtlasSetup\nsource @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.csh \$*\nalias asetup \'source @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.csh\'\n" >@INSTALL_PREFIX@/cmtsite/asetup.csh; if [ -f @INSTALL_PREFIX@/cmtsite/asetup_defaults ]; then mv -f @INSTALL_PREFIX@/cmtsite/asetup_defaults @INSTALL_PREFIX@/cmtsite/asetup_defaults.orig; fi; printf "standalone = True\nreleasesarea = @INSTALL_PREFIX@ `dirname @INSTALL_PREFIX@`\n" >@INSTALL_PREFIX@/cmtsite/asetup_defaults - -#mkdir -p @INSTALL_PREFIX@/cmtsite; if [ -f @INSTALL_PREFIX@/cmtsite/asetup.sh ]; then mv -f @INSTALL_PREFIX@/cmtsite/asetup.sh @INSTALL_PREFIX@/cmtsite/asetup.sh.orig; fi; printf "export AtlasSetup=@INSTALL_PREFIX@/AtlasSetup\nif [ -z \\\"\${AtlasSetupSite:-}\\\" ]; then\n export AtlasSetupSite=@INSTALL_PREFIX@/cmtsite/defaults\nfi\nsource @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.sh --releasesarea=@INSTALL_PREFIX@ standalone \$*\nalias asetup=\'source @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.sh --releasesarea=@INSTALL_PREFIX@ standalone\'\n" >@INSTALL_PREFIX@/cmtsite/asetup.sh; if [ -f @INSTALL_PREFIX@/cmtsite/asetup.csh ]; then mv -f @INSTALL_PREFIX@/cmtsite/asetup.csh @INSTALL_PREFIX@/cmtsite/asetup.csh.orig; fi; printf "setenv AtlasSetup @INSTALL_PREFIX@/AtlasSetup\nif ( \$?AtlasSetupSite == 0 ) then\n setenv AtlasSetupSite @INSTALL_PREFIX@/cmtsite/defaults\nendif\nsource @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.csh --releasesarea=@INSTALL_PREFIX@ standalone \$*\nalias asetup \'source @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.csh --releasesarea=@INSTALL_PREFIX@ standalone\'\n" >@INSTALL_PREFIX@/cmtsite/asetup.csh; if [ -f @INSTALL_PREFIX@/cmtsite/defaults ]; then mv -f @INSTALL_PREFIX@/cmtsite/defaults @INSTALL_PREFIX@/cmtsite/defaults.orig; fi; printf "releasesarea = `dirname @INSTALL_PREFIX@`\n" >@INSTALL_PREFIX@/cmtsite/defaults - -#mkdir -p @INSTALL_PREFIX@/cmtsite; if [ -f @INSTALL_PREFIX@/cmtsite/asetup.sh ]; then mv -f @INSTALL_PREFIX@/cmtsite/asetup.sh @INSTALL_PREFIX@/cmtsite/asetup.sh.orig; fi; printf "export AtlasSetup=@INSTALL_PREFIX@/AtlasSetup\nsource @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.sh --input=@INSTALL_PREFIX@/cmtsite/defaults \$*\nalias asetup=\'source @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.sh --input=@INSTALL_PREFIX@/cmtsite/defaults\'\n" >@INSTALL_PREFIX@/cmtsite/asetup.sh; if [ -f @INSTALL_PREFIX@/cmtsite/asetup.csh ]; then mv -f @INSTALL_PREFIX@/cmtsite/asetup.csh @INSTALL_PREFIX@/cmtsite/asetup.csh.orig; fi; printf "setenv AtlasSetup @INSTALL_PREFIX@/AtlasSetup\nsource @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.csh --input=@INSTALL_PREFIX@/cmtsite/defaults \$*\nalias asetup \'source @INSTALL_PREFIX@/AtlasSetup/scripts/asetup.csh --input=@INSTALL_PREFIX@/cmtsite/defaults\'\n" >@INSTALL_PREFIX@/cmtsite/asetup.csh; if [ -f @INSTALL_PREFIX@/cmtsite/defaults ]; then mv -f @INSTALL_PREFIX@/cmtsite/defaults @INSTALL_PREFIX@/cmtsite/defaults.orig; fi; printf "standalone = True\nreleasesarea = @INSTALL_PREFIX@ `dirname @INSTALL_PREFIX@`\n" >@INSTALL_PREFIX@/cmtsite/defaults -[ $? -eq 0 ] || { error "cat" $FUNCNAME; return 1; } - -#awk ' -#BEGIN { printf "; printf \""} -#{ printf "\\t%s \\\"%s\\\"", $1, $1 } -#END { printf "\" >>@INSTALL_PREFIX@/cmtsite/requirements" } -#' $scriptdir/platforms -# awk ' -# BEGIN { printf "PATH=/bin:/usr/bin; mkdir -p @INSTALL_PREFIX@/cmtsite; if [ -f @INSTALL_PREFIX@/cmtsite/requirements ]; then mv -f @INSTALL_PREFIX@/cmtsite/requirements @INSTALL_PREFIX@/cmtsite/requirements.orig; cmtconfig_=`awk \"/^set CMTCONFIG/{print \\$3}\" @INSTALL_PREFIX@/cmtsite/requirements.orig`; fi; printf \""} -# { gsub(/\$/,"\\$"); printf "%s\\n", $0 } -# END { printf "\" >@INSTALL_PREFIX@/cmtsite/requirements; if [ \"$cmtconfig_\" ]; then sed -i \"/^set CMTCONFIG/d\" @INSTALL_PREFIX@/cmtsite/requirements; sed -n \"/^set CMTCONFIG/,\\$p\" @INSTALL_PREFIX@/cmtsite/requirements.orig >>@INSTALL_PREFIX@/cmtsite/requirements; fi" } -# ' $scriptdir/requirements.template -#[ $? -eq 0 ] || { error "awk" $FUNCNAME; return 1; } - -#elif [ $2 == AtlasCore ]; then -#elif [[ $2 == Atlas?* || $2 == LCGCMT ]]; then -else -: ${cmtver:?} -: ${CMTCONFIG:?} -if [ "${relocate:-}" = yes ]; then -cat <<EOF -sed "s/^macro cmtconfig_default.*$/macro cmtconfig_default $CMTCONFIG/g" @INSTALL_PREFIX@/cmtsite/requirements >@INSTALL_PREFIX@/cmtsite/requirements.\$\$ && mv -f @INSTALL_PREFIX@/cmtsite/requirements.\$\$ @INSTALL_PREFIX@/cmtsite/requirements; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/CMT/${cmtver}/mgr/setup.sh; cmt config -EOF -else -cat <<EOF -sed "s/^set CMTCONFIG.*$/set CMTCONFIG $CMTCONFIG/g" @INSTALL_PREFIX@/cmtsite/requirements >@INSTALL_PREFIX@/cmtsite/requirements.\$\$ && mv -f @INSTALL_PREFIX@/cmtsite/requirements.\$\$ @INSTALL_PREFIX@/cmtsite/requirements; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/CMT/${cmtver}/mgr/setup.sh; cmt config -EOF -fi -#PATH=/bin:/usr/bin; sed -i "s/^set CMTCONFIG.*$/set CMTCONFIG $CMTCONFIG/g" @INSTALL_PREFIX@/cmtsite/requirements; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/CMT/${cmtver}/mgr/setup.sh; cmt -quiet config -[ $? -eq 0 ] || { error "cat" $FUNCNAME; return 1; } -fi -} - -_post () -{ -# -# Print on the standard output post-install script -# -# Parameters: 'project-release-directory' 'project'|'package' 'release'|'version' -# -: ${cmtver:?} -: ${CMTCONFIG:?} -: ${verdir?} ${cntnr[0]:?} #${cntnr[1]:?} -case ${CMTCONFIG} in - *dbg*) local mode=dbg ;; - *) local mode=opt ;; -esac - -local cntnrcmt=${cntnr[1]}${cntnr[0]}/${verdir}cmt - -cd $1/$cntnrcmt || return 1 -[ -f ${tmppatch}/$2/$3/$cntnrcmt/requirements ] && -export CMTUSERCONTEXT=$(echo ${tmppatch}/$2/$3/$cntnrcmt) -local project_post=$(cmt -q -tag_add=PACK show macro_value $(sed 's/[-.]/_/g' <<<${2})_post) -#local project_post=$(cmt -tag_add=PACK show macro_value ${2}_post) -unset CMTUSERCONTEXT -cd $OLDPWD - -if [ "${relocate:-}" = yes ]; then - -if [ $2 == AtlasRelease ]; then -: ${CMTCONFIG:?} -case ${CMTCONFIG} in - *dbg*) local mode=dbg ;; - *) local mode=opt ;; -esac -cat <<EOF -. @INSTALL_PREFIX@/CMT/${cmtver}/mgr/setup.sh; export CMTCONFIG=$CMTCONFIG; cd @INSTALL_PREFIX@/.cmtsite; [ -f ./setup.sh ] || cmt config; . ./setup.sh; cd @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/AtlasRelease/*/cmt; cmt br - cmt -no_cleanup config; ${project_post:+${project_post}; }true -EOF -#unset CMTROOT; cd @INSTALL_PREFIX@/.cmtsite; . ./setup.sh; cd @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/AtlasRelease/*/cmt; cmt br - cmt -no_cleanup config; ${project_post:+${project_post}; }true -else -cat <<EOF -. @INSTALL_PREFIX@/CMT/${cmtver}/mgr/setup.sh; export CMTCONFIG=$CMTCONFIG; cd @INSTALL_PREFIX@/.cmtsite; [ -f ./setup.sh ] || cmt config; . ./setup.sh; cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; cmt br - 'cmt -no_cleanup config'; ${project_post:+${project_post}; }true -EOF -#unset CMTROOT; cd @INSTALL_PREFIX@/.cmtsite; . ./setup.sh; cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; cmt br - 'cmt -no_cleanup config'; ${project_post:+${project_post}; }true -fi - -else - -if [ $2 == AtlasRelease ]; then -: ${CMTCONFIG:?} -case ${CMTCONFIG} in - *dbg*) local mode=dbg ;; - *) local mode=opt ;; -esac -cat <<EOF -unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${3},${mode},noTest; cd @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/AtlasRelease/*/cmt; cmt br - cmt -no_cleanup config; cd @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/Control/AthenaRunTime/*/cmt; . ./setup.sh; cmt build library_links; ${project_post:+cd @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/AtlasRelease/*/cmt; ${project_post}; }true -EOF - -#PATH=/bin:/usr/bin; unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${3},${mode},noTest; cd @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/AtlasRelease/*/cmt; cmt -quiet br - cmt -quiet -no_cleanup config; cd @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/Control/AthenaRunTime/*/cmt; . setup.sh; cmt build library_links; ${project_post:+cd @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/AtlasRelease/*/cmt; ${project_post}; }true -elif [ $2 == LCGCMT ]; then -cat <<EOF -unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${mode},noTest; unset CMTPATH CMTHOME CMTUSERCONTEXT; cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; cmt br - 'cmt -no_cleanup config;cmt build library_links'; ${project_post:+${project_post}; }true -EOF - -#PATH=/bin:/usr/bin; unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${mode},noTest; unset CMTPATH; cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; cmt -quiet br - 'cmt -quiet -no_cleanup config;cmt -quiet build library_links'; ${project_post:+${project_post}; }true -elif [ $2 == Gaudi ]; then -cat <<EOF -unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${mode},noTest; unset CMTPATH CMTHOME CMTUSERCONTEXT; cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; cmt br - 'cmt -no_cleanup config;cmt build library_links'; ${project_post:+${project_post}; }true -EOF - -#PATH=/bin:/usr/bin; unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${mode},noTest; unset CMTPATH; cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; cmt -quiet br - 'cmt -quiet -no_cleanup config;cmt -quiet build library_links'; ${project_post:+${project_post}; }true -elif [[ $2 == Atlas?* ]]; then # Atlas projects -cat <<EOF -unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${2},${3},${mode},noTest; cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; cmt br - 'cmt -no_cleanup config;cmt build library_links'; ${project_post:+${project_post}; }true -EOF - -#PATH=/bin:/usr/bin; unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${2},${3},${mode},noTest; cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; cmt -quiet br - 'cmt -quiet -no_cleanup config;cmt -quiet build library_links'; ${project_post:+${project_post}; }true -else -cat <<EOF -unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${mode},noTest; unset CMTPATH CMTHOME CMTUSERCONTEXT; cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; cmt br - 'cmt -no_cleanup config;cmt build library_links'; ${project_post:+${project_post}; }true -EOF - -#PATH=/bin:/usr/bin; unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; . @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${mode},noTest; unset CMTPATH; cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; cmt -quiet br - 'cmt -quiet -no_cleanup config;cmt -quiet build library_links'; ${project_post:+${project_post}; }true -# cat <<EOF -# PATH=/bin:/usr/bin; unset CMTROOT CMTSITE; . @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${mode},noTest; unset CMTPATH; cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; cmt -quiet br - cmt -quiet -no_cleanup config; ${project_post:+${project_post}; }true -# EOF - -fi - -fi -} - -_preun () -{ -# -# Print on the standard output preun-install script -# -# Parameters: 'project-release-directory' 'project'|'package' 'release'|'version' -# -: ${cmtver:?} -: ${CMTCONFIG:?} -: ${verdir?} ${cntnr[0]:?} #${cntnr[1]:?} -case ${CMTCONFIG} in - *dbg*) local mode=dbg ;; - *) local mode=opt ;; -esac - -local cntnrcmt=${cntnr[1]}${cntnr[0]}/${verdir}cmt - -cd $1/$cntnrcmt || return 1 -[ -f ${tmppatch}/$2/$3/$cntnrcmt/requirements ] && -export CMTUSERCONTEXT=$(echo ${tmppatch}/$2/$3/$cntnrcmt) -local project_preun=$(cmt -q -tag_add=PACK show macro_value $(sed 's/[-.]/_/g' <<<${2})_preun) -#local project_preun=$(cmt -tag_add=PACK show macro_value ${2}_preun) -local installarea=$(cmt -q show macro_value ${2}_installarea_prefix) -unset CMTUSERCONTEXT -cd $OLDPWD - -if [ "${relocate:-}" = yes ]; then - -: ${cmtver:?} -: ${CMTCONFIG:?} -if [ $2 == AtlasRelease ]; then -case ${CMTCONFIG} in - *dbg*) local mode=dbg ;; - *) local mode=opt ;; -esac -if [ "${project_preun:-}" ]; then -# sed -i "s/^macro cmtconfig_default.*$/macro cmtconfig_default $CMTCONFIG/g" @INSTALL_PREFIX@/.cmtsite/requirements -# unset CMTROOT; cd @INSTALL_PREFIX@/.cmtsite; -# (. @INSTALL_PREFIX@/CMT/${cmtver}/mgr/setup.sh; cmt config) -cat <<EOF -if [ \$1 -eq 0 ]; then -shift \$#; -. @INSTALL_PREFIX@/CMT/${cmtver}/mgr/setup.sh -export CMTCONFIG=$CMTCONFIG -cd @INSTALL_PREFIX@/.cmtsite; -[ -f ./setup.sh ] || cmt config -. ./setup.sh; -cd @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/AtlasRelease/*/cmt; -${project_preun} -cd @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/AtlasRelease/*/cmt; -true -fi -EOF -fi -else -if [ "${project_preun:-}" ]; then -# sed -i "s/^macro cmtconfig_default.*$/macro cmtconfig_default $CMTCONFIG/g" @INSTALL_PREFIX@/.cmtsite/requirements -# unset CMTROOT; cd @INSTALL_PREFIX@/.cmtsite; -# (. @INSTALL_PREFIX@/CMT/${cmtver}/mgr/setup.sh; cmt config) -cat <<EOF -if [ \$1 -eq 0 ]; then -shift \$#; -. @INSTALL_PREFIX@/CMT/${cmtver}/mgr/setup.sh -export CMTCONFIG=$CMTCONFIG -cd @INSTALL_PREFIX@/.cmtsite; -[ -f ./setup.sh ] || cmt config -. ./setup.sh; -cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt -${project_preun} -cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; -true -fi -EOF -fi -fi - -else - -if [ $2 == AtlasRelease ]; then -: ${CMTCONFIG:?} -case ${CMTCONFIG} in - *dbg*) local mode=dbg ;; - *) local mode=opt ;; -esac -cat <<EOF -if [ \$1 -eq 0 ]; then -shift \$#; -unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; -. @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${3},${mode},noTest; -${project_preun:+cd @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/AtlasRelease/*/cmt; -${project_preun} -}cd @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/AtlasRelease/*/cmt; -rm -rf @INSTALL_PREFIX@/$(basename $(dirname $1))/$3/$installarea/${CMTCONFIG}/lib; -true -fi -EOF - -#PATH=/bin:/usr/bin; -elif [ $2 == LCGCMT ]; then -cat <<EOF -if [ \$1 -eq 0 ]; then -shift \$#; -unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; -. @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${mode},noTest; -unset CMTPATH CMTHOME CMTUSERCONTEXT; -${project_preun:+cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt -${project_preun} -}cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; -rm -rf @INSTALL_PREFIX@/$2/$3/$installarea/${CMTCONFIG}/lib; -true -fi -EOF - -#PATH=/bin:/usr/bin; -#cmt -quiet br - 'rm -f Makefile setup.sh setup.csh cleanup.sh cleanup.csh'; -#cmt -quiet br - 'cmt -quiet remove library_links; rm -f Makefile setup.sh setup.csh cleanup.sh cleanup.csh'; - -elif [ $2 == Gaudi ]; then -cat <<EOF -if [ \$1 -eq 0 ]; then -shift \$#; -unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; -. @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${mode},noTest; -unset CMTPATH CMTHOME CMTUSERCONTEXT -${project_preun:+cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; -${project_preun} -}cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; -cmt br - 'cmt remove library_links'; -true -fi -EOF - -#PATH=/bin:/usr/bin; -#cmt -quiet br - 'cmt show applied_patterns|grep -q declare_installed_libraries&&cmt -quiet remove library_links; rm -f Makefile setup.sh setup.csh cleanup.sh cleanup.csh'; - -elif [[ $2 == Atlas?* ]]; then # Atlas projects -cat <<EOF -if [ \$1 -eq 0 ]; then -shift \$#; -unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; -. @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${2},${3},${mode},noTest; -${project_preun:+cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; -${project_preun} -}cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; -rm -rf @INSTALL_PREFIX@/$2/$3/$installarea/${CMTCONFIG}/lib; -true -fi -EOF - -#PATH=/bin:/usr/bin; -#cmt -quiet br - 'rm -f Makefile setup.sh setup.csh cleanup.sh cleanup.csh'; - -else -cat <<EOF -if [ \$1 -eq 0 ]; then -shift \$#; -unset CMTROOT CMTSITE; cd @INSTALL_PREFIX@/cmtsite; -. @INSTALL_PREFIX@/cmtsite/setup.sh -tag_add=${mode},noTest; -unset CMTPATH CMTHOME CMTUSERCONTEXT; -${project_preun:+cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; -${project_preun} -}cd @INSTALL_PREFIX@/$2/$3/$cntnrcmt; -cmt br - 'cmt remove library_links'; -true -fi -EOF - -#PATH=/bin:/usr/bin; -#cmt -quiet br - 'cmt -quiet remove library_links; rm -f Makefile setup.sh setup.csh cleanup.sh cleanup.csh'; - -fi - -fi -} - -_pacman () -{ -# -# Write pacman file -# -# Parameters: 'name' ['requires-file' ['postinstall-script' ['preinstall-script' ['version']]]] -# -local reqs fpath ver _ver - -fpath=${projcache}/cache/${1}.pacman - -if [ "$5" ]; then - ver=$5 -else -# ver=$(expr $(_getver ${1}) + 1 2>/dev/null) || - _ver=$(_getver ${1}) || { _ver=; warn "${fpath}: Version reset" $FUNCNAME; } - ver=$(expr ${_ver:-0} + 1) || - { ver=1; warn "${fpath}: Version set to ${ver}" $FUNCNAME; } -fi - -info "Writing ${fpath}, version ${ver}" $FUNCNAME - -# add dependencies -if [ -s "$2" ]; then - -while read req rest; do - reqs="${reqs} -package('${req}')" -done <${2} - -fi - -# write pacman file -cat <<EOF >|${fpath} - -description('Package ${1}') -version('${ver}') -${reqs} - -EOF - -# add preinstall-script -if [ -s "$4" ]; then - echo "shell('$(sed s/@INSTALL_PREFIX@/\$PACMAN_INSTALLATION/g $4)')" >>${fpath} -fi - -if [ -f ${projcache}/kits/${1}.tar.gz ]; then -cat <<EOF >>${fpath} - -downloadUntar('../kits/${1}.tar.gz') - -EOF -else - warn "${projcache}/kits/${1}.tar.gz: No such file" $FUNCNAME -fi - -# add postinstall-script -if [ -s "$3" ]; then - echo "shell(\"$(sed s/@INSTALL_PREFIX@/\$PACMAN_INSTALLATION/g $3)\")" >>${fpath} - #echo "shell('$(sed s/@INSTALL_PREFIX@/\$PACMAN_INSTALLATION/g $3)')" >>${fpath} -fi -} - -_requires () -{ -# -# Print on the standard output project dependencies (format: 'name' 'project' 'release') -# ( -# Atlas proj opt -> externals + CMT + AtlasSettings, AtlasLogin + -# proj dependencies opt + Atlas proj noarch -# Atlas proj src -> Atlas proj noarch -# Atlas proj doc, noarch, debuginfo -# Atlas proj dbg -> externals + CMT + AtlasSettings, AtlasLogin + -# proj dependencies dbg + Atlas proj src -# Gaudi the same as Atlas proj -# ) -# -# Parameters: 'project-release-directory' 'project' 'release' 'platform' -# (bin src doc noarch debuginfo) -# 'container' -# (container-name [access-path]) -# ['exps-file' -# ['binreq-file']] -# -[ $# -eq 5 -o $# -eq 6 -o $# -eq 7 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -#[ $# -eq 4 -o $# -eq 5 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -local name cmtverfile cmtver -local -a proj - -if [ $4 == bin ]; then - -# dependencies on external software -#_extern $1 $2 $3 ${5:+"$5"} || -_extern $1 $2 $3 "${5:-}" ${6:-} || -warn "Cannot pack external software: $1 $2 $3" $FUNCNAME - -# CMT dependency only -# first, try to determine which CMT version the project built with -for f_ in $1/${cntnr[1]}${cntnr[0]}/${verdir}$CMTCONFIG/${cntnr[0]}setup.make \ -$1/${cntnr[1]}${cntnr[0]}/${verdir}$CMTCONFIG/${cntnr[0]}_setup.make \ -$1/${cntnr[1]}${cntnr[0]}/${verdir}$CMTCONFIG/setup.make -do - [ -f "$f_" ] && { cmtverfile=$f_; break; } -done - -if [ -f "${cmtverfile-}" ]; then - cmtver=$(awk '$1 == "use" && $2 == "CMT" { print $3; exit }' $cmtverfile) || - { warn "Cannot determine CMT version: $cmtverfile" $FUNCNAME; unset cmtver; } -elif f_=$1/${cntnr[1]}${cntnr[0]}/${verdir}cmt/setup.sh; [ -f $f_ ]; then - cmtver=$(cd $(dirname $f_) && unset CMTROOT && . $f_ 2>/dev/null && cmt version) || - { warn "Cannot determine CMT version: $f_" $FUNCNAME; unset cmtver; } -fi - -if [ -n "${cmtver-}" ]; then - case $2 in - tdaq-common|dqm-common) - if [ "${cmtver}" != $(cmt version) ]; then - warn "Ignore CMT ${cmtver}: $1 $2 $3 (${CMTCONFIG})" $FUNCNAME - cmtver=$(cmt version) - fi - ;; - esac - _extern_proj "" CMT $cmtver -else - warn "Cannot determine CMT version: $1 $2 $3 (${CMTCONFIG})" $FUNCNAME - # use currently setup CMT version - _extern_proj "" CMT $(cmt version) - # use the CMT version from ${cmthome} -# _extern_proj $(cd ${cmthome}; cmt show uses | awk ' -#$1 == "use" && $2 == "CMT" { gsub(/[()]/, "", $4); print $4, $2, $3; exit } -#') -fi - -# dependencies on AtlasSettings, AtlasLogin -_settings || return 1 - -if [ -f $1/cmt/project.cmt ]; then -# direct project dependencies only -awk '$1 == "use" && $2 ~ /./ { print $2 }' $1/cmt/project.cmt | -while read projname; do - proj=($(cd $1/cmt; cmt show projects | awk ' -$1 == "'${projname}'" && $3 == "(in" { sub(/[)]$/, "", $4); print $1, $2, $4; exit } -')) - case $recursive in - no) - name=$(_mkname ${proj[0]} ${proj[1]} bin) - echo $name ${proj[0]} ${proj[1]} - [ -f ${projcache}/cache/$name.pacman ] || - warn "Not packed: ${proj[0]} ${proj[1]} ${CMTCONFIG}" $FUNCNAME ;; - yes) - if grep "${proj[0]} ${proj[1]}" $tmpdone; then - info "Done already: ${proj[0]} ${proj[1]} ${CMTCONFIG}" $FUNCNAME - else - case ${proj[0]} in - LCGCMT) - _extern_proj ${proj[2]} ${proj[0]} ${proj[1]} >>$tmpdone && - grep "${proj[0]} ${proj[1]}" $tmpdone ;; - *) - _proj ${proj[2]} ${proj[0]} ${proj[1]} >>$tmpdone && - grep "${proj[0]} ${proj[1]}" $tmpdone ;; - esac - fi ;; - *) error "Invalid value: recursive: $recursive" $FUNCNAME; return 1 ;; - esac -done || return 1 - -else warn "$1/cmt/project.cmt: No such file" $FUNCNAME -fi - -# dependencies on other parts of the project - case ${CMTCONFIG} in - *dbg*) echo $(_mkname $2 $3 src) $2 $3 ;; - *) echo $(_mkname $2 $3 noarch) $2 $3 ;; - esac - -elif [ $4 == src ]; then - echo $(_mkname $2 $3 noarch) $2 $3 - -elif [ $4 == debuginfo ]; then - if [ $# -eq 7 ]; then -awk ' -{ if (NF == 4) print $4, $2, $3 } -' "$7" <&- || { error "awk" $FUNCNAME; return 1; } - fi - -fi -} - -_extern () -{ -# -# Pack external software (Boost, Python, ROOT, ...) -# accessible via the glue packages in the current project directory ONLY -# Print on the standard output information on it (format: 'name' 'package' 'version') -# -# Parameters: 'project-release-directory' 'project' 'release' 'container' -# (container-name [access-path]) -# ['exps-file'] -# -[ $# -eq 4 -o $# -eq 5 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -#[ $# -eq 3 -o $# -eq 4 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -#[ $# -eq 4 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -local cmd -local tmpout=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } - -#if [ $# -eq 4 ] && [ "$4" ]; then -if [ $# -ge 4 ] && [ "$4" ]; then - cntnr=($4); [ ${#cntnr[*]} -eq 2 ] && cntnr[1]=$(sed 's#/*$#/#' <<<${cntnr[1]}) -else - cntnr=($(_getcntnr $1 $2 $3)) || cntnr=($(_mkcntnr $2)) || return 1 -fi - -# determine version directory -# (<version-tag>/ - with_version_directory, [empty] - without_version_directory) -# (CMT structure_strategy query not reliable) -if [ -d $1/${cntnr[1]}${cntnr[0]}/cmt ]; then - verdir= -elif [ -d "$(echo $1/${cntnr[1]}${cntnr[0]}/*/cmt)" ]; then - verdir=$(basename $(dirname $1/${cntnr[1]}${cntnr[0]}/*/cmt))/ - #verdir=*/ -else - error "Cannot determine cmt directory: $1/${cntnr[1]}${cntnr[0]}" $FUNCNAME; return 1 -fi - -cd $1/${cntnr[1]}${cntnr[0]}/${verdir}cmt || { error "cd" $FUNCNAME; return 1; } -info "`date`\tdirectory:\n`pwd`" $FUNCNAME - -# cmd="externcache=${externcache} patchdir=${patchdir} overwrite=${overwrite} tmppatch=${tmppatch} cmt -quiet broadcast ${selected:+-select='${selected}'} - ${scriptdir}/pack-extern.sh" - cmd="externcache=${externcache} patchdir=${patchdir} overwrite=${overwrite} verify=$verify tmppatch=${tmppatch} cmt broadcast ${selected:+-select='${selected}'} - ${scriptdir}/pack-extern.sh" - info "$cmd" $FUNCNAME -# time eval $cmd | tee -a $tmpout >&2 - -#if [ $waiting == yes -a $quiet == no ]; then - tail -f $tmpout >&2 & local pid=$! -#fi - - time eval $cmd ${5:-} >>$tmpout; local retval=$? -# time eval $cmd >>$tmpout; local retval=$? - -#if [ $waiting == yes -a $quiet == no ]; then - kill $pid -#else cat $tmpout >&2; fi - - [ $retval -eq 0 ] && ! sed '/^#/d' $tmpout && { error "sed" $FUNCNAME; return 1; } -# [ $retval -eq 0 ] && cat $tmpout | grep -v '^#' - -#info "`date`" $FUNCNAME -cd $OLDPWD || { error "cd" $FUNCNAME; return 1; } -rm -f $tmpout -return $retval -} - -_extern_proj () -{ -# -# Pack external project (Gaudi, LCGCMT, CMT) -# Print on the standard output information on it (format: 'name' 'project' 'release') -# -# Parameters: 'project-release-directory' 'project' 'release' ['container'] -# (container-name [access-path]) -# -[ $# -eq 3 -o $# -eq 4 ] || { error "$#: Wrong number of arguments" $FUNCNAME; return 1; } -#[ $# -eq 4 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } - -local name fpath - -if [ $2 == Gaudi -o $2 == LCGCMT ]; then -#if [ $2 == Gaudi ]; then - - _proj $1 $2 $3 ${4:+"$4"} - -elif [ $2 == LCGCMT ]; then -info "`date`\targuments:\n$*" $FUNCNAME - -local tmpreq=$(mktemp -t tmp.XXXXXXXXXX) || return 1 - -local tmppre=$(mktemp -t tmp.XXXXXXXXXX) || return 1 -local tmppost=$(mktemp -t tmp.XXXXXXXXXX) || return 1 -local tmppreun=$(mktemp -t tmp.XXXXXXXXXX) || return 1 - -#local cmtver requires -local cmtver -local -a cntnr -local verdir - -#if [ -s "$4" ]; then requires=$4; else requires=${tmpreq}; fi - -#_settings >>${requires} - -name=$(_mkname $2 $3 bin) -echo $name $2 $3 -_requires ${1} ${2} ${3} bin "${4:-}" >|${tmpreq} || return 1 -#_requires ${1} ${2} ${3} bin ${4:+"$4"} >|${tmpreq} || return 1 -if [ -f ${projcache}/cache/$name.pacman -a "${upgrade}" != yes ]; then - info "Existing ${projcache}/cache/$name.pacman will not be overwritten" $FUNCNAME -else -# _requires ${1} ${2} ${3} bin ${4:+"$4"} >|${tmpreq} - #_requires ${1} ${2} ${3} bin >>$requires - # need assign the right value to cmtver - cmtver=$(awk '$2 == "CMT" { print $3; exit }' ${tmpreq}) || return 1 - #cmtver=$(awk '$2 == "CMT" { print $3; exit }' $requires) || return 1 - _pre ${1} ${2} ${3} >|${tmppre} || return 1 - _post ${1} ${2} ${3} >|${tmppost} || return 1 - _pacman ${name} ${tmpreq} ${tmppost} ${tmppre} || return 1 - #_pacman ${name} $requires ${tmppost} ${tmppre} -fi -[ ! -f $PACKRPM/bin/pack-rpm-LCGCMT-bin.sh ] || . $PACKRPM/bin/pack-rpm-LCGCMT-bin.sh || return 1 - -name=$(_mkname $2 $3 noarch) -fpath=${projcache}/kits/$name.tar.gz -if [ -f $fpath -a "${upgrade}" != yes ]; then - info "Existing $fpath will not be overwritten" $FUNCNAME -else - info "Writing $fpath" $FUNCNAME - tar -v ${tar_basic_opts} -cf $fpath -z \ - -X $scriptdir/junk.ptn \ - -X $scriptdir/pltfm-junk.ptn \ - --exclude=$(cd $1/${cntnr[1]}${cntnr[0]}/${verdir}cmt; \ - cmt -q show macro_value LCGCMT_installarea_prefix)/'*' \ - -C $1/../.. $2/$3 >&2 || -{ warn "Disk space on the filesystem of `dirname $fpath`: -$(duf -p `dirname $fpath` $1)" $FUNCNAME -rm -f $fpath -error "tar" $FUNCNAME; return 1; } - - _patch ${2} ${3} ${name} || return 1 - _pacman $name || return 1 -fi -[ ! -f $PACKRPM/bin/pack-rpm-LCGCMT-noarch.sh ] || . $PACKRPM/bin/pack-rpm-LCGCMT-noarch.sh || return 1 - -rm -f ${tmpreq} ${tmppost} ${tmppre} ${tmppreun} || return 0 - -elif [ $2 == CMT ]; then -: ${CMTCONFIG:?} - # CMTv1r18p20050901Linux-i686.tar.gz from www.cmtsite.org - name=${2}${3}${uname}-$(cut -d- -f1 <<<$CMTCONFIG) -# name=${2}${3}Linux-$(cut -d- -f1 <<<$CMTCONFIG) - - echo $name $2 $3 - - fpath=${projcache}/cache/$name.pacman -# if [ -f $fpath ]; then - if [ -f $fpath -a "${upgrade}" != yes ]; then - info "Existing $fpath will not be overwritten" $FUNCNAME - else - info "Writing $fpath" $FUNCNAME - -cat >|$fpath <<EOF -# -# CMT from a CMT cache -# -description ('Package $name') - -package('${cmtcache}:CMT | version ("${3}")') -EOF - - fi - -else - error "Unknown external project: $1 $2 $3" $FUNCNAME; return 1 -fi -} - -_proj () -{ -# -# Pack project in five parts: -# binary platform - corresponds to CMTCONFIG value -# debuginfo files (for not debug build) -# source code -# documentation files -# other architecture independent files -# Print on the standard output information on it (format: 'name' 'project' 'release') -# -# Parameters: 'project-release-directory' 'project' 'release' ['container'] -# (container-name [access-path]) -# -### Parameters: 'project-release-directory' 'project' 'release' ['requires-file'] -# -info "`date`\targuments:\n$*" $FUNCNAME -[ $# -eq 3 -o $# -eq 4 ] || { error "Wrong number of arguments: $#" $FUNCNAME; return 1; } -local tmpbin=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -local tmpsrc=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -local tmpdoc=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -local tmpnoarch=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } - -local tmpdirs=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -local tmpdebuginfo=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } - -_prep_lists ${1} ${2} ${3} \ -${tmpbin} ${tmpsrc} ${tmpdoc} ${tmpnoarch} \ -${tmpdirs} ${tmpdebuginfo} || return 1 - -local tmpreq=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -local tmpreqbin=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } - -if [ "${relocate:-}" = yes ]; then - local tmpexps=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } - local tmpexterndebuginfo=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -fi - -local tmppre=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -local tmppost=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -local tmppreun=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } - -#local pltfm name cmtver requires -local pltfm name cmtver -local -a cntnr -local verdir -local do_debuginfo - -if [ "${debuginfo}" = yes ] && [ -n "${debuginfosuffix:-}" ] && [ "${mode:-}" != dbg ]; then - do_debuginfo=yes -else - unset do_debuginfo -fi - -for pltfm in bin src doc noarch debuginfo; do - [ ${pltfm} = doc ] && [ "${docfiles}" != yes ] && continue - [ ${pltfm} = debuginfo ] && [ "${do_debuginfo:-}" != yes ] && continue - - name=$(_mkname ${2} ${3} ${pltfm}) || return 1 - - if [ ${pltfm} = bin ]; then - echo $name $2 $3 - fi - - if [ ${pltfm} != debuginfo ]; then - _requires ${1} ${2} ${3} ${pltfm} "${4:-}" ${tmpexps:-} >|${tmpreq} || return 1 - else - _requires ${1} ${2} ${3} ${pltfm} "${4:-}" "${tmpexps:-}" $tmpreqbin >|${tmpreq} || return 1 - fi - if [ ${pltfm} = bin ] && [ "${do_debuginfo:-}" = yes ]; then - cat $tmpreq >>$tmpreqbin || { error "cat" $FUNCNAME; return 1; } - fi - -# _requires ${1} ${2} ${3} ${pltfm} ${4:+"$4"} >|${tmpreq} || return 1 -#if [ -f "${tmpexps:-}" ]; then -# cat ${tmpexps:-} >&2 || { error "cat" $FUNCNAME; return 1; } -#fi - -# if [ -f ${projcache}/kits/$name.tar.gz -a "${upgrade}" != yes ]; then -# info "Existing ${projcache}/kits/$name.tar.gz will not be overwritten" $FUNCNAME -# else - if [ ${pltfm} = debuginfo ] && [ -f "${tmpexps:-}" ]; then - _prep_extern_debuginfo_list ${1} ${2} ${3} "${tmpexps:-}" ${tmpexterndebuginfo} || return 1 - fi - - if [ -f ${projcache}/cache/$name.pacman -a "${upgrade}" != yes ]; then - info "Existing ${projcache}/cache/$name.pacman will not be overwritten" $FUNCNAME - if [ "${verify}" == yes ]; then - local spath=${projcache}/kits/$name.tar.gz - if [ -f $spath ] && eval [ -s \${tmp${pltfm}} ]; then - eval sed 's#^'$2/$3'#'$1'#' \${tmp${pltfm}} | newer -p $spath - elif [ -f $spath ] && eval [ ! -s \${tmp${pltfm}} ]; then - warn "$spath: Empty file list" $FUNCNAME - elif [ ! -f $spath ] && eval [ -s \${tmp${pltfm}} ]; then - error "$spath: No such file" $FUNCNAME - fi - fi - else - _clean ${1} ${2} ${3} || return 1 - if [ ${pltfm} = bin ]; then - eval _copy -X ${tmpdebuginfo} ${1} ${2} ${3} \${tmp${pltfm}} || return 1 -# eval _copy -x \\*${debuginfosuffix} ${1} ${2} ${3} \${tmp${pltfm}} || return 1 - elif [ ${pltfm} = debuginfo ]; then - eval _copy ${1} ${2} ${3} \${tmp${pltfm}} ${tmpexterndebuginfo} || return 1 - else - eval _copy ${1} ${2} ${3} \${tmp${pltfm}} || return 1 - fi - if [ ${pltfm} == noarch ]; then - _install_dirs ${tmpdirs} || return 1 -# _copy -n ${1} ${2} ${3} ${tmpdirs} || return 1 - fi - if [ ${pltfm} = debuginfo ] || [ "${mode:-}" = dbg ]; then - _symlinks -I ${1} ${2} ${3} ${tmpexps:-} || return 1 - else - _symlinks ${1} ${2} ${3} ${tmpexps:-} || return 1 - fi - _tar ${2} ${3} ${name} || return 1 - if [ ${pltfm} == noarch ]; then - _patch ${2} ${3} ${name} || return 1 - fi - - if [ ${pltfm} == bin ]; then - # need assign the right value to cmtver - cmtver=$(awk '$2 == "CMT" { print $3; exit }' ${tmpreq}) || { error "awk" $FUNCNAME; return 1; } - _pre ${1} ${2} ${3} >|${tmppre} || return 1 - _post ${1} ${2} ${3} >|${tmppost} || return 1 - _pacman ${name} ${tmpreq} ${tmppost} ${tmppre} || return 1 - else - _pacman ${name} ${tmpreq} || return 1 - fi - fi - [ ! -f $PACKRPM/bin/pack-rpm-proj.sh ] || . $PACKRPM/bin/pack-rpm-proj.sh || return 1 -done -rm -f ${tmpbin} ${tmpsrc} ${tmpdoc} ${tmpnoarch} \ -${tmpdirs} ${tmpdebuginfo} \ -${tmpreq} ${tmpexps:-} ${tmppost} ${tmppre} ${tmppreun} \ -${tmpreqbin} ${tmpexterndebuginfo} || return 0 -} - -##################################### main ########################################## -_mktmpdir $builddir || exit 1 - -if [ ${uname} = Linux ]; then - tar_basic_opts="--owner=root --group=root --mode=u=rwX,go=rX --no-anchored --wildcards" - noleaf=yes -# group=yes -else - tar_basic_opts= - unset noleaf -# unset group -fi -#tar_basic_opts="--owner=root ${group:+--group=root} --mode=u=rwX,go=rX --no-anchored --wildcards" -#tar_basic_opts="--owner=root --group=root --mode=u=rwX,go=rX --no-anchored --wildcards" -#tar_basic_opts="--owner=root --group=root --mode=u=rwX,go=rX" - -tmpdone=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; exit 1; } - -if [ "$selected" ]; then - - _extern ${projbase}/${project}/${release} ${project} ${release} "${container:-}" >>$tmpdone - #_extern ${projbase}/${project}/${release} ${project} ${release} ${container:+"$container"} >>$tmpdone - #_extern ${projbase}/${project}/${release} ${project} ${release} "${container}" - -else - -#_settings >>${requires} -if [ $project == AtlasRelease ]; then - #_settings >>${requires} - _proj ${projbase}/${release} ${project} ${release} ${requires} -#elif [ $project == LCGCMT ]; then -elif [ $project == LCGCMT -o $project == CMT ]; then - _extern_proj ${projbase}/${project}/${release} ${project} ${release} ${container:+"$container"} >>$tmpdone -else - _proj ${projbase}/${project}/${release} ${project} ${release} ${container:+"$container"} >>$tmpdone - #_proj ${projbase}/${project}/${release} ${project} ${release} ${requires} -fi - -fi - -retval=$? -[ $retval -eq 0 ] && [ -s "$tmpdone" ] && cat $tmpdone -# [ -s "$tmpdone" ] && cat $tmpdone >&2 -[ -f "$tmpdone" ] && rm -rf $tmpdone - -rm -rf $tmpdir -###rm -rf $requires -exit $retval -##################################################################################### diff --git a/PackDist/scripts/pack.cfg.example b/PackDist/scripts/pack.cfg.example deleted file mode 100755 index 8bdd4fe20a4d6e386b6549642dd06424699714f5..0000000000000000000000000000000000000000 --- a/PackDist/scripts/pack.cfg.example +++ /dev/null @@ -1,145 +0,0 @@ -# This is an example configuration file for the pack-run.sh and proj-run.sh scripts. -# -# The configuration files read by the scripts are defaults.cfg, -# ~/.pack.cfg, the file specified in the environment variable PACKCFG, -# the file specified with the -c command line option -# (values from "earlier" files are overridden by "later" files). -# -# The format is: option = value # comments -# or: option : value # comments -# -# (Command line options override values from the configuration files.) -# -# Report bugs to <Grigori.Rybkine@cern.ch>. -# - -#cmthome: $HOME/cmthome-latest - -# AtlasSetup package root -#setuproot = /afs/cern.ch/atlas/software/dist/AtlasSetup - -# (command line option -L) -#logdir: $HOME/log - -# directory to create packages in (command line option -C) -#pacmancache=/data/pacman - -#patchdir: $HOME/patches - -# (command line option -b) -#projbase=/afs/cern.ch/atlas/software/builds - -# the release to package -# (command line option -r) -#release=10.4.0 - -# this option is only currently used to pack monolithic releases -# as 'AtlasRelease' project -# use the 'container' option for all (other) projects if needed -#mainpkg=AtlasRelease # this is default - -# the packages to pack -# (command line option -p) -# (value accumulates over configuration files and -p command line options) -#packages = AtlasShift oracle - -#mode = dbg - -# overwrite (yes) or not (no) existing tarballs of external packages -# (command line option -F) -#overwrite : yes # (boolean option) - - -# The options ONLY supported by the proj-run.sh script. -# - -# directory to create external packages in, takes precedence over pacmancache value -# (command line option -X) -#externcache = /data/Proj/extern - -# directory to create project packages in, takes precedence over pacmancache value -# (command line option -J) -#projcache = /data/Proj/proj - -# directory to create RPMs in (command line option -o) -#rpmdir=/data/rpms - -# directory to create external RPMs in, takes precedence over rpmdir value -# (command line option -x) -#externdir = /data/Proj/extern - -# directory to create project RPMs in, takes precedence over rpmdir value -# (command line option -j) -#projdir = /data/Proj/proj - -# the project to pack -# (command line option -P) -#project = AtlasSimulation #AtlasCore #AtlasConditions - -# container package specification for the project to pack -# this option is useful if the cmt/project.cmt file -# does not specify the container package -#container: container-name [access-path] - -# additional tag(s) for setup -# (command line option -t) -# the value may be a space or comma separated list -#tags: 32 # to pack 32-bit build on 64-bit machine - -# CMTCONFIG (platform tag) for setup -# (command line option -T) -# the value shall be a CMTCONFIG value recognised by the setup procedure/tool -#cmtconfig: x86_64-slc6-gcc47-opt - -# package (yes) or not (no) documentation files -# (command line option -d) -#docfiles: yes # (boolean option) - -# overwrite (yes) or not (no) existing tarballs of project packages -# (command line option -U) -#upgrade: yes # (boolean option) - -# keep (yes) existing tarballs of settings packages or overwrite (no) them -# if their versions differ from those in use -# (command line option -k) -#keep: yes # (boolean option) - -# recursively pack projects required by the project being packed -# (command line option -R) -# yes if starts with y or Y or is 1, no - otherwise -# (the same applies to the other boolean options) -#recursive: Yep # nope # (boolean option) - -# verify (yes) or not (no) that existing tarballs are up-to-date -# (command line option -V) -#verify: yes # (boolean option) - -# wait (yes) or not (no) until packaging completion -# (command line option -w) -#waiting: yes # (boolean option) - -# do not write anything to standard output -# (command line option -q) -#quiet: no # yes # (boolean option) - -# do not execute, only dump configuration -# (command line option -n) -#configure: no # yes # (boolean option) - -# directory to use for temporary files during packaging -# (with enough space to copy the project into) -# defaults to the TMPDIR environment variable if set, or /tmp -# (command line option -B) -#builddir = /data/kitbuild - -# CMT cache location -# defaults to the CMT site cache (http://www.cmtsite.org/pacman/cache) -#cmtcache = http://cern.ch/atlas-computing/links/kitsDirectory/CMT/pacman/cache - -# create (yes) or not (no) debug information packages (for not debug build) -# (command line option -I) -#debuginfo: no # (boolean option) - -# extention of debug information files (for not debug build) -# (command line option -S) -#debuginfosuffix = .debug diff --git a/PackDist/scripts/platforms b/PackDist/scripts/platforms deleted file mode 100755 index 45ff481b2b8c8437ee4eeffca396479b0adb2395..0000000000000000000000000000000000000000 --- a/PackDist/scripts/platforms +++ /dev/null @@ -1,60 +0,0 @@ -i686-slc4-gcc345-opt -i686-slc4-gcc345-dbg -x86_64-slc4-gcc345-opt -x86_64-slc4-gcc345-dbg -i686-slc4-gcc34-opt -i686-slc4-gcc34-dbg -x86_64-slc4-gcc34-opt -x86_64-slc4-gcc34-dbg -i686-slc4-gcc41-opt -i686-slc4-gcc41-dbg -x86_64-slc4-gcc41-opt -x86_64-slc4-gcc41-dbg -i686-slc4-gcc43-opt -i686-slc4-gcc43-dbg -x86_64-slc4-gcc43-opt -x86_64-slc4-gcc43-dbg -i686-slc5-gcc34-opt -i686-slc5-gcc34-dbg -x86_64-slc5-gcc34-opt -x86_64-slc5-gcc34-dbg -i686-slc5-gcc43-opt -i686-slc5-gcc43-dbg -x86_64-slc5-gcc43-opt -x86_64-slc5-gcc43-dbg -i686-slc5-icc11-opt -i686-slc5-icc11-dbg -i686-slc5-gcc46-opt -i686-slc5-gcc46-dbg -x86_64-slc5-gcc46-opt -x86_64-slc5-gcc46-dbg -i686-slc5-gcc47-dbg -i686-slc5-gcc47-opt -x86_64-slc5-gcc47-dbg -x86_64-slc5-gcc47-opt -x86_64-slc6-gcc46-opt -x86_64-slc6-gcc46-dbg -i686-slc6-gcc47-opt -i686-slc6-gcc47-dbg -x86_64-slc6-gcc47-opt -x86_64-slc6-gcc47-dbg -i686-slc6-gcc48-opt -i686-slc6-gcc48-dbg -x86_64-slc6-gcc48-opt -x86_64-slc6-gcc48-dbg -x86_64-slc6-gcc49-opt -x86_64-slc6-gcc49-dbg -i386-mac104-gcc40-opt -i386-mac104-gcc40-dbg -ppc-mac104-gcc40-opt -ppc-mac104-gcc40-dbg -i386-mac105-gcc40-opt -i386-mac105-gcc40-dbg -i386-mac106-gcc42-opt -i386-mac106-gcc42-dbg -x86_64-mac106-gcc42-opt -x86_64-mac106-gcc42-dbg -x86_64-slc6-clang37-opt -x86_64-slc6-clang37-dbg -x86_64-slc6-clang38-opt -x86_64-slc6-clang38-dbg diff --git a/PackDist/scripts/pltfm-junk.ptn b/PackDist/scripts/pltfm-junk.ptn deleted file mode 100755 index d9bfaca3ae44578d4b14b46ee7e6a10eea9a5d1e..0000000000000000000000000000000000000000 --- a/PackDist/scripts/pltfm-junk.ptn +++ /dev/null @@ -1,10 +0,0 @@ -*.o -*.make -*.stamp -*.shstamp -*.cmtref -*.d -*.dep -*.in -*.makesav -*.makecmtsave diff --git a/PackDist/scripts/proj-run.sh b/PackDist/scripts/proj-run.sh deleted file mode 100755 index bcde0b560d86aa303151714c8952cfbed9dd29af..0000000000000000000000000000000000000000 --- a/PackDist/scripts/proj-run.sh +++ /dev/null @@ -1,622 +0,0 @@ -#!/bin/bash - -[ "$PROJRUNDBG" ] && set -x - -scriptdir=$(dirname $0) -. $scriptdir/pack-common.sh -scriptdir=$(abspath $scriptdir) -export scriptdir - -help () -{ -cat <<EOF -Usage: `basename $0` [OPTION]... -Pack project with external packages it depends upon, or only external package(s). - - -L <path> create log file in directory <path> - -C <path> create packages in directory <path> - -X <path> create external packages in directory <path> - (takes precedence over -C value) - -J <path> create project packages in directory <path> - (takes precedence over -C value) - -o <path> create RPMs in directory <path> - -x <path> create external RPMs in directory <path> - (takes precedence over -o value) - -j <path> create project RPMs in directory <path> - (takes precedence over -o value) - -b <path> pack project located in project base directory <path> - -P <project> pack project <project> - -r <id> pack project release <id> - -p <package> pack external package <package> (may be multiple) - -D pack debug build - -I create debug information packages (for not debug build) - -S <suffix> suffix of debug information files (for not debug build) - -t <tag>[,<tag>...] use additional tag(s) for setup (may be multiple) - -T <cmtconfig> force CMTCONFIG <cmtconfig> (platform tag) for setup - -d pack documentation files also - -F overwrite existing tarballs of external packages - -U overwrite existing tarballs of project packages - -k keep existing tarballs of settings packages - (default is overwrite if their versions differ from those in use) - -R recursively pack projects required by the project being packed - -V verify that existing tarballs (of project and/or external packages) are up-to-date - -w wait until packing completion - -q do not write anything to standard output - -n do not execute, only dump configuration - -B <path> use directory <path> for temporary files - -c <path> use configuration file <path> - -h display this help and exit - -v output version information and exit - -The PACKOPTS environment variable specifies a space separated list of default options -to be placed in front of any explicit options. - -Report bugs to <Grigori.Rybkine@cern.ch>. -EOF -} - -version () -{ -if [ -r $scriptdir/../ChangeLog ]; then -printf "`basename $0` (PackDist) %s\nWritten by Grigori Rybkine.\n" \ -`sed -n '/^[[:blank:]]*PackDist-\([0-9][0-9]\(-[0-9][0-9]\)\{2,3\}\)[[:blank:]]*$/{s//\1/p -q -}' $scriptdir/../ChangeLog` -else -printf "`basename $0` (PackDist) %s\nWritten by Grigori Rybkine.\n" \ -`cd $scriptdir/../cmt && cmt show version|sed -n '/^[[:blank:]]*PackDist-\([0-9][0-9]\(-[0-9][0-9]\)\{2,3\}\)[[:blank:]]*$/s//\1/p'` -fi -} - -parse_opts () -{ -local msg="Try '`basename $0` -h' for more information." - -while getopts ":L:C:X:J:o:x:j:b:P:r:p:DIS:t:T:dFUkRVwqnB:c:hv" opt; do - case $opt in - L) eval logdir=${OPTARG} ;; - C) eval pacmancache=${OPTARG} ;; - X) eval externcache=${OPTARG} ;; - J) eval projcache=${OPTARG} ;; - o) eval rpmdir=${OPTARG} ;; - x) eval externdir=${OPTARG} ;; - j) eval projdir=${OPTARG} ;; - b) eval projbase=${OPTARG} ;; - P) project=${OPTARG} ;; - r) release=${OPTARG} ;; - p) if [ "$packages" ]; then - packages="$packages ${OPTARG}" - else packages=${OPTARG}; fi ;; - D) mode=dbg ;; # Debug - I) debuginfo=yes ;; - S) debuginfosuffix=${OPTARG} ;; - t) if [ "$tags" ]; then - tags="$tags ${OPTARG}" - else tags=${OPTARG}; fi ;; - T) cmtconfig=${OPTARG} ;; - d) docfiles=yes ;; - F) overwrite=yes ;; # Fresh - U) upgrade=yes ;; # Upgrade - k) keep=yes ;; - R) recursive=yes ;; - V) verify=yes ;; - w) waiting=yes ;; - q) quiet=yes ;; - n) configure=yes ;; - B) eval builddir=${OPTARG} ;; - c) config_read -e ${OPTARG} || return 1 ;; - h) help ; exit 0 ;; - v) version ; exit 0 ;; - \?) error "Invalid option: -${OPTARG}\n$msg" $FUNCNAME; return 1 ;; - :) error "Argument required for option: -${OPTARG}\n$msg" $FUNCNAME; return 1 ;; - esac -done - -shift $(($OPTIND - 1)) - -[ $# -eq 0 ] || { error "Invalid argument(s): $*\n$msg" $FUNCNAME; return 1; } -} - -config_read () -{ -_error_level=0 -tmpcfg=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -tmperr=$(mktemp -t tmp.XXXXXXXXXX) || { error "mktemp" $FUNCNAME; return 1; } -for f; do - if [ "X$f" = "X-e" ]; then - _error_level=2 - continue - elif [ "X$f" = "X-w" ]; then - _error_level=1 - continue - elif [ "X$f" = "X-i" ]; then - _error_level=0 - continue - fi -# [ -f "$f" ] || continue - if [ ! -r "$f" ]; then - case ${_error_level} in - 2) error "Cannot read file '$f'" $FUNCNAME; return 1 ;; - 1) warn "Cannot read file '$f'" $FUNCNAME; continue ;; - 0) continue ;; - esac - fi -# awk -v tmperr=$tmperr ' - awk 'BEGIN { tmperr="'$tmperr'" } - NF == 0 || /^#/ { next } - { sub(/[ \t]#.*$/, " "); if (NF == 0) next } - /^[ \t]*[^ \t=:]+[ \t]*[=:]/ { sub(/[=:]/, " "); print; next } - { printf "%s: line %d: %s\n", FILENAME, NR, $0 >> tmperr } -# { printf "%s: line %d:\n%s\n", FILENAME, NR, $0 >> tmperr } - ' "$f" >>$tmpcfg || { error "awk" $FUNCNAME; return 1; } -done -[ -s $tmperr ] && -{ error "Invalid syntax:\n$(<$tmperr)" $FUNCNAME; rm -f $tmperr $tmpcfg; return 2; } -rm -f $tmperr -while read opt val; do - case $opt in - cmthome) eval cmthome=${val} ;; # eval ${opt}=${val} - setuproot) eval setuproot=${val} ;; # eval ${opt}=${val} - logdir) eval logdir=${val} ;; - pacmancache) eval pacmancache=${val} ;; - externcache) eval externcache=${val} ;; - projcache) eval projcache=${val} ;; - rpmdir) eval rpmdir=${val} ;; - externdir) eval externdir=${val} ;; - projdir) eval projdir=${val} ;; - patchdir) eval patchdir=${val} ;; - projbase) eval projbase=${val} ;; - project) project=${val} ;; - release) release=${val} ;; - mainpkg) mainpkg=${val} ;; - container) container="${val}" ;; - packages) if [ "$packages" ]; then - packages="$packages ${val}" - else packages=${val}; fi ;; - mode) mode=${val} ;; - debuginfo) debuginfo=${val} ;; - debuginfosuffix) debuginfosuffix=${val} ;; - tags) if [ "$tags" ]; then - tags="$tags ${val}" - else tags=${val}; fi ;; - cmtconfig) cmtconfig=${val} ;; - docfiles) docfiles=${val} ;; - overwrite) overwrite=${val} ;; - upgrade) upgrade=${val} ;; - keep) keep=${val} ;; - recursive) recursive=${val} ;; - verify) verify=${val} ;; - waiting) waiting=${val} ;; - quiet) quiet=${val} ;; - configure) configure=${val} ;; - builddir) eval builddir=${val} ;; - cmtcache) cmtcache=${val} ;; - *) error "Invalid option: '${opt}'" $FUNCNAME; rm -f $tmpcfg; return 1 ;; - esac -done <${tmpcfg} -#rm -f $tmperr $tmpcfg -rm -f $tmpcfg -} - -config_dump () { -cat <<EOF -cmthome: $cmthome -setuproot: $setuproot -logdir: $logdir -pacmancache: $pacmancache -externcache: $externcache -projcache: $projcache -rpmdir: $rpmdir -externdir: $externdir -projdir: $projdir -patchdir: $patchdir -projbase: $projbase -project: $project -release: $release -mainpkg: $mainpkg -container: $container -packages: $packages -mode: $mode -debuginfo: $debuginfo -debuginfosuffix: $debuginfosuffix -tags: $tags -cmtconfig: $cmtconfig -docfiles: $docfiles -overwrite: $overwrite -upgrade: $upgrade -keep: $keep -recursive: $recursive -verify: $verify -waiting: $waiting -quiet: $quiet -configure: $configure -builddir: $builddir -cmtcache: $cmtcache -EOF -} - -parse_bool () -{ -local i v -for i; do - eval v=\$$i - case $v in [yY]*|1) eval $i=yes ;; *) eval $i=no ;; esac -done -} - -config_read -e $scriptdir/defaults.cfg -i $HOME/.pack.cfg -w $PACKCFG || exit -parse_opts $PACKOPTS "$@" || exit -shift $# - -[ "${uname:-}" ] || uname=$(uname) - -[ -t 2 ] || printf "\n`version`\n\n" >&2 - -parse_bool debuginfo docfiles overwrite upgrade keep recursive verify waiting quiet configure - -for pkg in $packages; do - pkg=`echo $pkg | sed -e 's#^[^/]#/&#' -e 's#[^/]$#&/#'` - if [ "$selected" ]; then - selected="$selected $pkg" - else selected=$pkg - fi -done - -[ -z "$tags" ] || tags=$(tr -s ' \t' ',,' <<<"$tags" | sed 's/^,//;s/,$//') -#config_dump; exit 18 - -[ $(wc -w <<<"$container") -le 2 ] || -{ error "Wrong container package specification: '$container'\n\t(must be: [container-name [access-path]])" $FUNCNAME; exit 1; } -[ "$container" ] && container=$(sed 's/[ \t]\+/ /g' <<<"$container") - -: ${project:?} -[ $project = CMT ] || : ${release:?} -#: ${release:?} -#: ${projbase:?} - -#[ -d "$projbase" ] && { projbase=$(abspath $projbase) || exit; } -: ${cmtcache:?} - -if [ "${debuginfo:-}" = yes ] && [ "${mode:-}" != dbg ]; then - [ -n "${debuginfosuffix:-}" ] || { error "'debuginfosuffix' must be non-empty" $FUNCNAME; exit 1; } -fi - -_setuproot () -{ -setuproot=$(abspath $setuproot) || return -export AtlasSetup=${setuproot} - -if [ -n "${projbase:-}" ]; then - if [ -d ${projbase} ]; then - cmtprojectpath=/afs/cern.ch/atlas/software/builds:/afs/cern.ch/atlas/project/tdaq/prod:/afs/cern.ch/atlas/offline/external -#### _cmd=". $setuproot/scripts/asetup.sh ${project},${release},${mode},notest,ignore${tags:+,${tags}} --releasesarea=${projbase}:${cmtprojectpath} ${PROJRUNDBG:+--debugprint}" - _cmd=". $setuproot/scripts/asetup.sh ${project},${release},${mode},notest,ignore${tags:+,${tags}} ${cmtconfig:+--cmtconfig=${cmtconfig}} --releasebase=${projbase} ${PROJRUNDBG:+--debugprint}" - else - warn "${projbase}: No such directory" $FUNCNAME - fi - [ -d ${projbase}/${project}/${release} ] || unset projbase -fi -[ -n "${_cmd:-}" ] || -_cmd=". $setuproot/scripts/asetup.sh ${project},${release},${mode},notest,ignore,builds${tags:+,${tags}} ${cmtconfig:+--cmtconfig=${cmtconfig}} ${PROJRUNDBG:+--debugprint}" - -info "asetup command=${_cmd}" $FUNCNAME - -[ "$PROJRUNDBG" ] && set +x -${_cmd} || { error "${_cmd}" $FUNCNAME; return 1; } -[ "$PROJRUNDBG" ] && set -x - -if [ -n "${projbase:-}" ]; then - for p in $(echo $cmtprojectpath | tr -s ':' ' '); do - path_append CMTPROJECTPATH $p - done - path_prepend CMTPROJECTPATH ${projbase} -fi - -if [ -z "${projbase:-}" ]; then - for _path in `echo "${CMTPATH:-}" | tr -s ':' ' '`; do - if [ -d ${_path} ]; then - [ ${release} = $(basename ${_path}) ] || continue - _p=$(dirname ${_path}) || return - [ ${project} = $(basename ${_p}) ] || continue - projbase=$(dirname ${_p}) || return - #projbase=$(dirname $(dirname ${_p})) || return - break - else - warn "${_path}: No such directory" $FUNCNAME - fi - done -fi -unset CMTPATH -if [ -z "${projbase:-}" ]; then - for _p in `echo "${CMTPROJECTPATH:-}" | tr -s ':' ' '`; do - if [ -d ${_p}/${project}/${release} ]; then - projbase=${_p} || return - break - else - warn "${_p}: No such directory" $FUNCNAME - fi - done -fi -[ -n "${projbase:-}" ] || -{ error "${project} ${release}: Cannot locate" $FUNCNAME; return 2; } - -#asetup LCGCMT,LCGCMT_59,builds,notest --releasebase=/afs/cern.ch/atlas/software/builds -#asetup LCGCMT,LCGCMT_59,builds,notest --releasebase=/afs/cern.ch/atlas/offline/external -#asetup LCGCMT,LCGCMT_59,builds,notest -#asetup LCGCMT,LCGCMT_59,notest --releasebase=/afs/cern.ch/atlas/offline/external - -#> cmt version v1r22 -#> echo $CMTCONFIG -# i686-slc5-gcc43-opt -#> echo $CMTPROJECTPATH -# /afs/cern.ch/atlas/software/builds:/afs/cern.ch/atlas/project/tdaq/prod:/afs/cern.ch/atlas/offline/external -#> echo $CMTEXTRATAGS -# ATLAS -#> echo $CMTSITE -# CERN - -#asetup AtlasConditions,16.3.0,builds,notest,ignore,noruntime -#source $AtlasSetup/scripts/asetup.sh AtlasConditions,16.3.0,builds,notest,ignore,noruntime -#. $setuproot/scripts/asetup.sh AtlasConditions,16.3.0,builds,notest,ignore,noruntime -#asetup 16.2.0,builds,notest --releasebase=/afs/cern.ch/atlas/software/builds -} - -_cmthome () -{ -cmthome=$(abspath $cmthome) || exit -cd ${cmthome} || return 1 -unset CMTPATH CMTPROJECTPATH -unset CMTROOT CMTSITE -if [ $project == AtlasRelease ]; then - [ "$PROJRUNDBG" ] && set +x - . ${cmthome}/setup.sh -tag_add=${release},${mode},noTest${tags:+,${tags}} || exit 1 - [ "$PROJRUNDBG" ] && set -x - if [ -z ${projbase} ]; then - projbase=`cmt -q show macro_value ATLAS_DIST_AREA` - : ${projbase:?} - else - export CMTPATH=$(sed 's#^:*[^:]*#'${projbase}/${release}'#' <<<"$CMTPATH") - fi - [ -d ${projbase}/${release} ] || - { error "${projbase}/${release} must exist and be a directory" $FUNCNAME; exit 1; } - -elif [ $project == LCGCMT -o $project == Gaudi ]; then - [ "$PROJRUNDBG" ] && set +x - . ${cmthome}/setup.sh -tag_add=${mode},noTest${tags:+,${tags}} || exit 1 - [ "$PROJRUNDBG" ] && set -x - if [ -z ${projbase} ]; then - projbase=`cmt -q show macro_value EXTERNAL_PROJECT_AREA` - : ${projbase:?} - fi - [ -d ${projbase}/${project}/${release} ] || - { error "${projbase}/${project}/${release}: No such directory" $FUNCNAME; exit 1; } -# export CMTPATH=${projbase}/${project}/${release} -# export CMTPROJECTPATH=${projbase} - path_prepend CMTPROJECTPATH ${projbase} - export CMTPROJECTPATH - unset CMTHOME - unset CMTPATH - -elif [ $project == CMT ]; then - [ "$PROJRUNDBG" ] && set +x - . ${cmthome}/setup.sh -tag_add=${mode},noTest${tags:+,${tags}} || exit 1 - [ "$PROJRUNDBG" ] && set -x - cmtinfo=(`cmt show uses | awk ' -$1 == "use" && $2 == "CMT" { gsub(/[()]/, "", $4); print $4, $3; exit } -'`) - [ ${#cmtinfo[*]} -eq 2 ] || - { error "Wrong CMT info: ${cmtinfo[*]}" $FUNCNAME; exit 1; } - [ -z ${projbase} ] && { projbase=${cmtinfo[0]}; : ${projbase:?}; } - [ -z ${release} ] && { release=${cmtinfo[1]}; : ${release:?}; } - - [ -d ${projbase}/${project}/${release} ] || - { error "${projbase}/${project}/${release}: No such directory" $FUNCNAME; exit 1; } - #{ warn "${projbase}/${project}/${release}: No such directory" $FUNCNAME; } - export CMTPROJECTPATH=${projbase} - unset CMTHOME - unset CMTPATH - -else - [ "$PROJRUNDBG" ] && set +x - . ${cmthome}/setup.sh -tag_add=${project},${release},${mode},noTest,builds${tags:+,${tags}} || exit 1 - [ "$PROJRUNDBG" ] && set -x - if [ -z ${projbase} ]; then - projbase=`echo $CMTPROJECTPATH | sed 's#^:\+##' | cut -d: -f1` - : ${projbase:?} - else - #export CMTPATH=${projbase}/${project}/${release} - #export CMTPROJECTPATH=$(sed 's#^:*[^:]*#'${projbase}'#' <<<"$CMTPROJECTPATH") - path_prepend CMTPROJECTPATH ${projbase} - export CMTPROJECTPATH - fi - unset CMTHOME - unset CMTPATH - [ -d ${projbase}/${project}/${release} ] || - { error "${projbase}/${project}/${release}: No such directory" $FUNCNAME; exit 1; } -fi -cd $OLDPWD -} - -if [ $project = CMT ]; then - unset setuproot - [ "${cmthome:-}" ] || - { error "cmthome must be set" $FUNCNAME; exit 1; } -fi - -if [ "${setuproot:-}" ]; then - _setuproot || exit -elif [ "${cmthome:-}" ]; then - warn "Obsolete cmthome use" $FUNCNAME - _cmthome || exit -else - error "Neither cmthome or setuproot set" $FUNCNAME; exit 1 -fi - -: ${CMTCONFIG:?} - -[ -z "$pacmancache" ] || pacmancache=$(abspath $pacmancache) || exit - -if [ -z "$externcache" ]; then - [ ! -d "$pacmancache" ] && - { error "pacmancache or externcache must exist and be a directory" $FUNCNAME; exit 1; } - info "setting externcache to pacmancache=$pacmancache" $FUNCNAME; externcache=$pacmancache -fi -[ -d "$externcache" ] || { error "externcache=$externcache must exist and be a directory" $FUNCNAME; exit 1; } - -if [ -z "$projcache" ]; then - [ ! -d "$pacmancache" ] && - { error "pacmancache or projcache must exist and be a directory" $FUNCNAME; exit 1; } - info "setting projcache to pacmancache=$pacmancache" $FUNCNAME; projcache=$pacmancache -fi -[ -d "$projcache" ] || { error "projcache=$projcache must exist and be a directory" $FUNCNAME; exit 1; } - -#[ -d "$pacmancache" ] || { error "$pacmancache must exist and be a directory" $FUNCNAME; exit 1; } - -for i in rpmdir externdir projdir; do - eval d=\$$i - if [ "$d" ]; then - [ -d "$d" ] || { error "$d: No such directory" $FUNCNAME; exit 1; } - eval export $i=$(abspath $d) || exit - [ "$PACKRPM" ] || export PACKRPM=$(dirname $scriptdir)/share - fi -done - -if [ -z "$rpmdir" ]; then - if [ "$externdir" ] && [ -z "$projdir" ]; then - info "setting rpmdir to externdir=$externdir" $FUNCNAME - export rpmdir=$(abspath $externdir) || exit - elif [ -z "$externdir" ] && [ "$projdir" ]; then - info "setting rpmdir to projdir=$projdir" $FUNCNAME - export rpmdir=$(abspath $projdir) || exit - fi -fi - -[ -d "$patchdir" ] || { error "patchdir=$patchdir must exist and be a directory" $FUNCNAME; exit 1; } - -[ -d "$logdir" ] || { error "logdir=$logdir must exist and be a directory" $FUNCNAME; exit 1; } - -# Make paths absolute -for i in logdir externcache projcache patchdir projbase; do - eval v=\$$i; eval $i=$(abspath $v) || exit -done -[ -z "$builddir" ] || builddir=$(abspath $builddir) || exit - -if [ "$configure" == yes ]; then - config_dump - exit -fi - -# Create auxiliary directories and files -#[ -d $pacmancache/kits ] || mkdir $pacmancache/kits || exit 1 -#[ -d $pacmancache/cache ] || mkdir $pacmancache/cache || exit 1 - -[ -d $externcache/kits ] || mkdir $externcache/kits || exit 1 -[ -d $externcache/cache ] || mkdir $externcache/cache || exit 1 - -[ -d $projcache/kits ] || mkdir $projcache/kits || exit 1 -[ -d $projcache/cache ] || mkdir $projcache/cache || exit 1 - -[ -d "$logdir/$project/$release" ] || mkdir -p $logdir/$project/$release || exit 1 -logfile=$logdir/$project/$release/`basename $0 .sh`-${CMTCONFIG}.log - -#TMPLOG=$(mktemp -t tmp.XXXXXXXXXX) || exit 1 -#mv --backup=t $TMPLOG $logfile || exit 1 -#chmod +r $logfile -_backup () -{ -for f; do - [ -f "$f" ] || continue - i=1 - while [ -f ${f}.~${i}~ ]; do - i=$(expr ${i} + 1) || { error "expr" $FUNCNAME; return 1; } - done - mv $f ${f}.~${i}~ || { error "mv" $FUNCNAME; return 1; } -done -} - -_backup $logfile || exit 1 - -main () -{ -info "Start `date`\t@ `hostname`" $FUNCNAME - -[ -z "$mainpkg" -a $project == AtlasRelease ] && mainpkg=AtlasRelease -: ${mainpkg:?} -cd $projbase/${release}/$mainpkg/*/cmt || exit 1 - -info "Start packing from `pwd -P`" $FUNCNAME - -if [ "$selected" ]; then -# cmd="pacmancache=${pacmancache} patchdir=${patchdir} overwrite=${overwrite} platform=${platform} cmt -quiet broadcast -global -select='${selected}' - ${scriptdir}/pack-extern.sh" - cmd="externcache=${externcache} patchdir=${patchdir} overwrite=${overwrite} cmt broadcast -global -select='${selected}' - ${scriptdir}/pack-extern.sh" - info "$cmd" $FUNCNAME - eval $cmd -else - requires=$(mktemp -t tmp.XXXXXXXXXX) || return 1 - -# cmd="pacmancache=${pacmancache} patchdir=${patchdir} overwrite=${overwrite} platform=${platform} cmt -quiet broadcast -global - ${scriptdir}/pack-extern.sh" - cmd="externcache=${externcache} patchdir=${patchdir} overwrite=${overwrite} cmt broadcast -global - ${scriptdir}/pack-extern.sh" - info "$cmd" $FUNCNAME - eval $cmd | tee -a ${requires} || { error "tee" $FUNCNAME; return 1; } - sed '/^#/d' ${requires} >${requires}.tmp || { error "sed" $FUNCNAME; return 1; } - mv -f ${requires}.tmp ${requires} || { error "mv" $FUNCNAME; return 1; } -# sed -i '/^#/d' ${requires} - - cmd="projbase=${projbase} project=${project} release=${release} projcache=${projcache} upgrade=${upgrade} mode=${mode} debuginfo=${debuginfo} debuginfosuffix=${debuginfosuffix} docfiles=${docfiles} builddir=${builddir} cmthome=${cmthome} uname=${uname} setuproot=${setuproot} ${scriptdir}/pack-proj.sh" - info "$cmd" $FUNCNAME - eval requires=${requires} $cmd - - rm -f ${requires} || return 0 - -fi - -info "Finish `date`\t@ `hostname`" $FUNCNAME -} - -proj () -{ -info "Start `date`\t@ `hostname`" $FUNCNAME - -cmd="selected='$selected' projbase=${projbase} project=${project} release=${release} container='${container}' projcache=${projcache} upgrade=${upgrade} mode=${mode} debuginfo=${debuginfo} debuginfosuffix=${debuginfosuffix} docfiles=${docfiles} builddir=${builddir} cmthome=${cmthome} setuproot=${setuproot} externcache=${externcache} patchdir=${patchdir} overwrite=${overwrite} keep=$keep recursive=$recursive relocate=yes verify=$verify cmtcache=$cmtcache waiting=$waiting quiet=$quiet uname=${uname} ${scriptdir}/pack-proj.sh" - info "$cmd" $FUNCNAME - eval $cmd - -local retval=$? -info "Finish `date`\t@ `hostname`" $FUNCNAME -return $retval -} - -# Do the packing -printf "\n`version`\n\n" >>$logfile -case $quiet in - no) info "Current configuration:\n`config_dump`" $FUNCNAME 2>&1 | tee -a $logfile ;; - yes) info "Current configuration:\n`config_dump`" $FUNCNAME >>$logfile 2>&1 ;; - *) error "Invalid value: quiet: $quiet" $FUNCNAME ;; -esac - -if [ $project == AtlasRelease ]; then - { time main; } >>$logfile 2>&1 & -# elif [ $project == LCGCMT ]; then -# { time extern_proj; } >>$logfile 2>&1 & -else - -case $waiting in - no) case $quiet in - no) { time proj; } >>$logfile 2>&1 & - info "`date`\tPID: $!\t@ `hostname`" $FUNCNAME ;; - yes) { time proj; } >>$logfile 2>&1 & ;; - *) error "Invalid value: quiet: $quiet" $FUNCNAME ;; - esac ;; - yes) case $quiet in - no) info "`date`\tPID: $$\t@ `hostname`" $FUNCNAME - { time proj; } 2>&1 | tee -a $logfile ;; - yes) { time proj; } >>$logfile 2>&1; retval=$? ;; - *) error "Invalid value: quiet: $quiet" $FUNCNAME ;; - esac ;; -esac - -fi - -info "\n\nLog file: $logfile" $FUNCNAME - -exit $retval diff --git a/PackDist/scripts/relink.py b/PackDist/scripts/relink.py deleted file mode 100755 index 8e60ad2572af46706c33737860625b0173d5e708..0000000000000000000000000000000000000000 --- a/PackDist/scripts/relink.py +++ /dev/null @@ -1,322 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -"""File: relink.py - -Developed against Python 2.3 -""" - -__version__ = '0.9.0' -__date__ = 'Tue Mar 15 2016' -__author__ = 'Grigori Rybkine <Grigori.Rybkine@cern.ch>' - -import os, sys -import getopt -import shutil - -def cwd(): - _cwd = os.getenv('PWD') - _gcwd = os.getcwd() - if _cwd and os.path.samefile(_cwd, _gcwd): - return _cwd - else: - return _gcwd - -def cd(path): - new = os.path.normpath(os.path.join(cwd(), path)) - os.chdir(path) - _gcwd = os.getcwd() - if os.path.samefile(new, _gcwd): - os.environ['PWD'] = new - else: - os.environ['PWD'] = _gcwd - -def commonhead(list1, list2): - c = -1 - for i in xrange(min(len(list1), len(list2))): - if list1[i] == list2[i]: c = i - else: break - #if c > -1: print >> sys.stderr, 'commonhead:', c, list1, list2 - return list1[:c + 1] - -#def relink(path, v = False): -def relink(path, Arg = (None, True, False)): - """Convert absolute link `path' (within current directory, to file in PROJ_SRC) to relative link. - - Current directory is a copy of (a part of) PROJ_SRC. - Remove `path' if it is a dangling link, or points to a file outside PROJ_SRC. - If the conversion results in a dangling link, replace `path' with a copy - in case it originally pointed to a regular file in PROJ_SRC, - create the empty target directory in case it originally pointed to a directory. - """ - if not os.path.islink(path): return - - exps = Arg[0] - debuginfo = Arg[1] - v = Arg[2] - - path = os.path.normpath(path) - s = os.readlink(path) - snorm = os.path.normpath(s) - p = os.path.join(PROJ_SRC, path) - hatpath = os.path.join(PROJ_HAT, path) - - if snorm.startswith(PROJ_SRC + os.sep): - srcpath = snorm[len(PROJ_SRC + os.sep):] - - pathl = path.split(os.sep) - srcpathl = srcpath.split(os.sep) - head = commonhead(pathl, srcpathl) - - if len(pathl) > len(head) + 1 or \ - len(pathl) == len(head) + 1 and len(srcpathl) > len(head): - # pathl: o o o a b # pathl: o o o a - # srcpathl: o o o c d e # srcpathl: o o o c d e - # head: o o o or # head: o o o - # --------------------- # --------------------- - # src: ../c/d/e # src: c/d/e - srcl = [os.pardir for i in xrange(len(pathl) - 1 - len(head))] + srcpathl[len(head):] - src = os.path.join(*srcl) - elif len(pathl) == len(head) + 1 and len(srcpathl) == len(head): - # pathl: o o o a - # srcpathl: o o o - # head: o o o - # --------------------- - # src: . - src = os.curdir - if v: print >> sys.stderr, 'detected symlink to current directory', `hatpath`, '->', `src` - elif len(pathl) == len(head): - src = os.path.join(*srcpathl[len(head) - 1:]) - if len(srcpathl) == len(head): - # pathl: o o a - # srcpathl: o o a - # --------------------- - # src: a - if v: print >> sys.stderr, 'detected symlink to itself', `hatpath`, '->', `src` - else: - # pathl: o o a - # srcpathl: o o a c - # --------------------- - # src: a/c - if v: print >> sys.stderr, 'detected too many levels of symlinks', `hatpath`, '->', `src` - else: - print >> sys.stderr, 'detected UNFORESEEN', `path`, '->', `srcpath` - return - - _srcpath = os.path.normpath(os.path.join(os.path.dirname(path), src)) - assert srcpath == _srcpath, '%s:\n%s not equal to %s' % (path, `srcpath`, `_srcpath`) - - os.remove(path) - if os.path.isfile(srcpath) or os.path.isdir(srcpath): - try: - os.symlink(src, path) - except (IOError, os.error), why: - print >> sys.stderr, 'Cannot symlink %s -> %s: %s' % (`hatpath`, `src`, str(why)) - else: - if v: print 'symlinked', `hatpath`, '->', `src` - else: - if os.path.isfile(s): - print >> sys.stderr, 'missing:', hatpath, '->', src - try: - shutil.copy2(s, path) - except (IOError, os.error), why: - print >> sys.stderr, 'Cannot copy %s -> %s: %s' % (`s`, `hatpath`, str(why)) - else: - if v: print >> sys.stderr, 'copied', `s`, '->', `hatpath` - elif os.path.isdir(s): - print >> sys.stderr, 'missing:', hatpath, '->', src - try: - os.makedirs(srcpath) - except (IOError, os.error), why: - print >> sys.stderr, 'Cannot create directory %s: %s' % (`os.path.join(PROJ_HAT, srcpath)`, str(why)) - else: - if v: print >> sys.stderr, 'created directory', `os.path.join(PROJ_HAT, srcpath)` - try: - os.symlink(src, path) - except (IOError, os.error), why: - print >> sys.stderr, 'Cannot symlink %s -> %s: %s' % (`hatpath`, `src`, str(why)) - else: - if v: print 'symlinked', `hatpath`, '->', `src` - else: - print >> sys.stderr, 'dangling:', p, '->', s - if v: print >> sys.stderr, 'removed', `hatpath` -# elif os.path.normpath(os.path.join(os.path.dirname(p), s)).startswith(PROJ_SRC + os.sep): - else: - srcpath = os.path.normpath(os.path.join(os.path.dirname(p), s)) -# os.path.normpath(os.path.join(os.path.dirname(p), s)).startswith(PROJ_SRC + os.sep): - if srcpath.startswith(PROJ_SRC + os.sep): - if os.path.isfile(path) or os.path.isdir(path): - if v: print 'relative:', hatpath, '->', s - else: - if os.path.isfile(p) or os.path.isdir(p): - print >> sys.stderr, 'missing:', hatpath, '->', s - else: - print >> sys.stderr, 'dangling:', p, '->', s - os.remove(path); - if v: print >> sys.stderr, 'removed', `hatpath` - else: - if os.path.isfile(p) or os.path.isdir(p): - if exps: - dst = exps.destination(srcpath) - if dst: - os.remove(path) - if not dst[1] or debuginfo: - # if not dst[1] or DEBUGINFO == 'yes' or MODE == 'dbg': - upl = [os.pardir for i in xrange(len(hatpath.split(os.sep)) - 1)] - src = os.path.join(os.path.join(*upl), dst[0]) - try: - os.symlink(src, path) - except (IOError, os.error), why: - print >> sys.stderr, 'Cannot symlink %s -> %s: %s' % (`hatpath`, `src`, str(why)) - else: - if v: print 'symlinked', `hatpath`, '->', `src` - else: - print 'debuginfo:', hatpath, '->', s - if v: print 'removed', `hatpath` - else: - print >> sys.stderr, 'not_exported:', srcpath - os.remove(path); - if v: print >> sys.stderr, 'removed', `hatpath`, '->', `s` - else: - print >> sys.stderr, 'external:', hatpath, '->', s - os.remove(path); - if v: print >> sys.stderr, 'removed', `hatpath` - else: - print >> sys.stderr, 'dangling:', p, '->', s - os.remove(path); - if v: print >> sys.stderr, 'removed', `hatpath` - -def doTree(top = cwd(), v = (None, True, True)): - global PROJ_SRC, PROJ_HAT - PROJ_SRC = os.path.normpath(os.path.join(cwd(), os.environ['projsrc'])) - PROJ_HAT = os.path.normpath(os.environ['projhat']) - - assert os.path.normpath(os.path.join(cwd(), top)).endswith(PROJ_HAT), '%s: Parent directory not %s' % (top, `PROJ_HAT`) - - def doList(v, dirpath, filenames): - #print >> sys.stderr, dirpath, filenames - for filename in filenames: - path = os.path.join(dirpath, filename) - #print >> sys.stderr, path - if os.path.islink(path): - relink(path, v) - - curdir = cwd() - cd(top) - - os.path.walk(os.curdir, doList, v) - - cd(curdir) - -#if __name__ == '__main__': - #fout = file(os.path.basename(sys.argv[0]) + '.out', 'w') - #sys.stdout = fout - #ferr = file(os.path.basename(sys.argv[0]) + '.err', 'w') - #sys.stderr = ferr -# if len(sys.argv) > 1: -# for arg in sys.argv[1:]: doTree(arg) -# else: doTree() - -class ExportPaths(object): - def __init__(self, path): - self.paths = {} - f = open(path, 'U') - try: - for l in f: - # expected line format: <src>\0<dst>\0<debuginfo_suffix>\n - i = l[:-1].split('\0') - assert len(i) == 3, '%s: %s: Wrong line format' % (path, `l`) - r = os.path.realpath(i[0]) - i[0], i[1] = [os.path.normpath(p) for p in (i[0], i[1])] - assert os.path.realpath(i[0]) == r, '%s (%s): Ambiguous export path' % (i[0], i[1]) - if i[2] == '': i[2] = '\0' # null character '\0' does not appear in file paths - - for (_r, s), (d, suf) in self.paths.iteritems(): - if r == _r: - if i[0] == s and i[1] == d: - print >>sys.stderr, '%s (%s): Duplicate export path' % (i[0], i[1]) - else: - print >>sys.stderr, '%s (%s), %s (%s): Redundant export paths' % \ - (i[0], i[1], s, d) - - self.paths[(r, i[0])] = (i[1], i[2]) - finally: - f.close() - - def destination(self, path): - rpathl = os.path.realpath(path).lstrip(os.sep).split(os.sep) - pathl = os.path.normpath(path).lstrip(os.sep).split(os.sep) - for (r, s), (d, suf) in self.paths.iteritems(): - # first try with real paths - rl = r.lstrip(os.sep).split(os.sep) - head = commonhead(rl, rpathl) -# print >>sys.stderr, 'destination: %s %s: %s' % \ -# (str(rl), str(rpathl), str(head)) - if len(rl) == len(head): - return (os.path.join(*(d.split(os.sep) + rpathl[len(rl):])), rpathl[-1].endswith(suf)) - elif len(rpathl) == len(head): - dl = d.lstrip(os.sep).split(os.sep) - if len(dl) + len(rpathl) - len(rl) > 0: - return (os.path.join(*dl[:len(dl) + len(rpathl) - len(rl)]), False) - # then try with normalized paths - sl = s.lstrip(os.sep).split(os.sep) - head = commonhead(sl, pathl) -# print >>sys.stderr, 'destination: %s %s: %s' % \ -# (str(sl), str(pathl), str(head)) - if len(sl) == len(head): - return (os.path.join(*(d.split(os.sep) + pathl[len(sl):])), pathl[-1].endswith(suf)) - elif len(pathl) == len(head): - dl = d.lstrip(os.sep).split(os.sep) - if len(dl) + len(pathl) - len(sl) > 0: - return (os.path.join(*dl[:len(dl) + len(pathl) - len(sl)]), False) - return None - -def main(argv=[__name__]): - self = os.path.basename(argv[0]) - try: - opts, args = getopt.getopt(argv[1:], - "hIS:H:X:", - ["help", "version", "debuginfo", "project-src=", "project-hat=", - "export-paths-from="]) - except getopt.error, e: - print >>sys.stderr, '%s: %s' % (self, str(e)) - print >>sys.stderr, "Try '%s --help' for more information." % self - return 1 - - debuginfo = False - for o, v in opts: - if o in ("-h", "--help"): - print sys.modules[__name__].__doc__ - return 0 - elif o in ("--version",): - print '%s %s (%s)' % (self, __version__, __date__) - print '%sWritten by %s.' % (os.linesep, __author__) - return 0 - elif o in ("-I", "--debuginfo"): - debuginfo = True - elif o in ("-S", "--project-src"): - os.environ['projsrc'] = v.rstrip(os.sep) - elif o in ("-H", "--project-hat"): - os.environ['projhat'] = v.strip(os.sep) - elif o in ("-X", "--export-paths-from"): - export_paths = ExportPaths(v) - -# if not args: -# print >>sys.stderr, '%s: missing path argument' % self -# print >>sys.stderr, "Try '%s --help' for more information." % self -# return 1 - - try: - Arg = (export_paths, debuginfo, True) - except NameError: - Arg = (None, debuginfo, True) - -# print >> sys.stderr, Arg -# return 17 - - if args: - for arg in args: doTree(arg, Arg) - else: doTree(cwd(), Arg) - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/PackDist/scripts/requirements.template b/PackDist/scripts/requirements.template deleted file mode 100755 index fb2f8237699c0725b07398a2fd7a5c2b179e8046..0000000000000000000000000000000000000000 --- a/PackDist/scripts/requirements.template +++ /dev/null @@ -1,47 +0,0 @@ -# -# !!! DO NOT EDIT - GENERATED AUTOMATICALLY !!! -# -# Usage: -# -# . @INSTALL_PREFIX@/cmtsite/setup.sh -tag=<project>,<release>[,<cmtconfig>] -# -# or -# -# export ATLAS_TEST_AREA=<path-to-your-development-area> -# . @INSTALL_PREFIX@/cmtsite/setup.sh -tag=<project>,<release>,<type>[,<cmtconfig>] -# -# where <type> is one of the following: simpleTest, oneTest, projectTest -# -# Two additional styles of override of the default CMTCONFIG value are possible: -# 1. Specifying the forceConfig tag on the command line in which case the CMTCONFIG -# environment variable is used to setup the build and runtime environments -# 2. Specifying a subset of the opt/dbg, gcc34/gcc43, 32/64 and slc4/slc5 tags on -# the command line, in which case the default configuration will be overridden -# accordingly. -# -# Report bugs to <hn-atlas-releaseKitProblem@cern.ch>. -# - -set CMTSITE STANDALONE -set SITEROOT @INSTALL_PREFIX@ - -macro ATLAS_DIST_AREA ${SITEROOT} - -apply_tag noTest -tag_exclude simpleTest noTest -tag_exclude oneTest noTest -tag_exclude projectTest noTest - -apply_tag projectArea -macro SITE_PROJECT_AREA ${SITEROOT} -macro EXTERNAL_PROJECT_AREA ${SITEROOT} - -use AtlasLogin AtlasLogin-* $(ATLAS_DIST_AREA) - -# -# This will be overridden by a known CMTCONFIG value (i.e. listed below), -# if set via AtlasLogin above -# -macro cmtconfig_default @CMTCONFIG@ - -set CMTCONFIG $(cmtconfig_default) diff --git a/PackDist/scripts/src.ptn b/PackDist/scripts/src.ptn deleted file mode 100755 index ed95aae52f895b9512f23e7f0f7cc8e21b34bf75..0000000000000000000000000000000000000000 --- a/PackDist/scripts/src.ptn +++ /dev/null @@ -1,19 +0,0 @@ -src/*.c -*src/*.cc -src/*.cxx -*.cpp -*.f -*.F -*.f90 -*.F90 -*.FF90 -*.y -*.l -configure -*.in -*.age -test/*.cxx -srctest/*.cxx -pool/*.cxx -pool_plugins/*.cxx -cpp_any/*.cxx diff --git a/PackDist/share/bin/pack-rpm-extern.sh b/PackDist/share/bin/pack-rpm-extern.sh deleted file mode 100644 index c5811bac3470d28c4d1c14f1af22674166de5940..0000000000000000000000000000000000000000 --- a/PackDist/share/bin/pack-rpm-extern.sh +++ /dev/null @@ -1,6 +0,0 @@ - - if [ ${pltfm} = bin ]; then - $PACKRPM/bin/pack-rpm.py "$name $package $version $platform" "$tmpreq" "" "" $(_getver $name) "${src[*]}" "${dst[*]}" - elif [ ${pltfm} = debuginfo ]; then - $PACKRPM/bin/pack-rpm.py "$name $package $version ${platform_debuginfo:-${CMTCONFIG}_debuginfo}" "$tmpreq" "" "" $(_getver $name) "${src[*]}" "${dst[*]}" - fi diff --git a/PackDist/share/bin/pack-rpm-proj.sh b/PackDist/share/bin/pack-rpm-proj.sh deleted file mode 100644 index 51c3f78b736a7b7b12a0e0c76e0c5e95dd062334..0000000000000000000000000000000000000000 --- a/PackDist/share/bin/pack-rpm-proj.sh +++ /dev/null @@ -1,10 +0,0 @@ - - if [ ${pltfm} == bin ]; then - cmtver=$(awk '$2 == "CMT" { print $3; exit }' ${tmpreq}) || return 1 - _pre ${1} ${2} ${3} >|${tmppre} || return 1 - _post ${1} ${2} ${3} >|${tmppost} || return 1 - _preun ${1} ${2} ${3} >|${tmppreun} || return 1 - $PACKRPM/bin/pack-rpm.py "$name ${2} ${3} $pltfm" $tmpreq ${tmppost} ${tmppre} $(_getver $name) "" "" ${tmppreun} || return 1 - else - $PACKRPM/bin/pack-rpm.py "$name ${2} ${3} $pltfm" $tmpreq "" "" $(_getver $name) || return 1 - fi diff --git a/PackDist/share/bin/pack-rpm-settings.sh b/PackDist/share/bin/pack-rpm-settings.sh deleted file mode 100644 index 7be95047db480e08fb2ce735014309dff5693136..0000000000000000000000000000000000000000 --- a/PackDist/share/bin/pack-rpm-settings.sh +++ /dev/null @@ -1,7 +0,0 @@ - -if [ ${pkg[0]} = AtlasSetup ]; then - _pre ${pkg[2]}/${pkg[0]} ${pkg[0]} ${pkg[1]} >|${tmppre} -else - _pre ${pkg[2]}/${pkg[0]}/${pkg[1]} ${pkg[0]} ${pkg[1]} >|${tmppre} -fi - $PACKRPM/bin/pack-rpm.py "$name ${pkg[0]} ${pkg[1]} noarch" "" "" ${tmppre} $(_getver $name) diff --git a/PackDist/share/bin/pack-rpm.py b/PackDist/share/bin/pack-rpm.py deleted file mode 100755 index faa01eca568c4e203506b2c43c1a8e0ac6c952d9..0000000000000000000000000000000000000000 --- a/PackDist/share/bin/pack-rpm.py +++ /dev/null @@ -1,403 +0,0 @@ -#!/usr/bin/env python -"""File: pack-rpm.py - -This script builds (binary) rpm package -based on meta-data provided and from a tarball built -by the PackDist package. -""" - -__version__ = '0.12.0' -__date__ = 'Tue Mar 15 2016' -__author__ = 'Grigori Rybkine <Grigori.Rybkine@cern.ch>' - -# -# Write spec file and build (binary) rpm package -# -# Parameters: 'name package/project version [architecture]' ['requires-file' -# ['postinstall-script' ['preinstall-script' ['version' ['source-paths' 'destination-paths' -# ['preuninstall-script']]]]]] -# - -import sys, os -import re -import commands - -try: - __path__ = [os.path.join(os.path.dirname(sys.modules[__name__].__file__), os.pardir, 'python')] -except AttributeError, e: - # with Python 2.2.3, sys.modules['__main__'] - # AttributeError: 'module' object has no attribute '__file__': even for scripts - if __name__ == '__main__': - __path__ = [os.path.join(os.path.dirname(sys.argv[0]), os.pardir, 'python')] - else: - raise -from PackDistCommon import * - -def _getver(name, default='', type=None): - fpath = os.path.join(os.environ['projcache'], 'specs', name + '.spec') - if not os.access(fpath, os.R_OK): return default - s = file(fpath).read() - p = r'version[ \t]*:[ \t]*(?P<ver>[\w.]+)' - m = re.search(p, s, re.I) - if m: return m.group('ver') - else: return default - -def info(message='', location=''): - if message: message = ': ' + message - if location: location += ': ' - print >> sys.stderr, "%s: %sINFO%s" % (os.path.basename(sys.argv[0]), location, message) - -def warn(message='', location=''): - if message: message = ': ' + message - if location: location += ': ' - print >> sys.stderr, "%s: %sWARNING%s" % (os.path.basename(sys.argv[0]), location, message) - -def error(message='', location=''): - if message: message = ': ' + message - if location: location += ': ' - print >> sys.stderr, "%s: %sERROR%s" % (os.path.basename(sys.argv[0]), location, message) - -def rpmfile(name, version, release, arch, type=None): - cmd = 'rpm -D "NAME %s" -D "VERSION %s" -D "RELEASE %s" -D "ARCH %s" -E `rpm -E %%_rpmfilename`' % (name, version, release, arch) - status, rpmfilename = commands.getstatusoutput(cmd) - if status != 0: - error(rpmfilename, rpmfile.__name__) - raise CommandError(cmd, rpmfilename, exitstatus(status)) - if type == 'extern': rpmdir = os.getenv('externdir') - elif type == 'proj': rpmdir = os.getenv('projdir') - else: rpmdir = None - if not rpmdir: rpmdir = os.getenv('rpmdir') - if not rpmdir: - cmd = 'rpm -E %_rpmdir' - status, rpmdir = commands.getstatusoutput(cmd) - if status != 0: - error(rpmdir, rpmfile.__name__) - raise CommandError(cmd, rpmfilename, exitstatus(status)) - return (rpmdir, rpmfilename) - -def _getalien(requires): - reqs = [] - for r in requires: - i = r.rfind(':') - if i != -1: reqs.append((r[0:i], r[i+1:])) - return reqs - -def _buildalien(aliendeps, buildarch): - errs = list() - builddir = _builddir() - buildrootdir = _buildrootdir() - tmppath = _tmppath() - sourcedir = tmppath - suffix = '.tar.gz' - for d in aliendeps: - i = d[1].find('-') - if i == -1: - warn('%s %s: No name or version specified' % (d[0], d[1]), - _buildalien.__name__) - continue - else: - _name = d[1][0:i] - _version = d[1][i + 1:] - if not _name: - warn('%s %s: Empty name specified' % (d[0], d[1]), - _buildalien.__name__) - continue - if not _version: - warn('%s %s: Empty version specified' % (d[0], d[1]), - _buildalien.__name__) - continue - try: - rpmdir, rpmfilename = rpmfile(d[1], _version.replace('-', '.'), '1', buildarch, 'extern') - except Error, e: - errs.append(e) - e.write() - continue - rpmpath = os.path.join(rpmdir, rpmfilename) - if os.path.isfile(rpmpath): - info('%s: File exists' % rpmpath) - continue - specpath = os.path.join(os.path.dirname(sys.argv[0]), os.pardir, 'specs', _name + '.spec') - if not os.path.isfile(specpath): - warn('%s: No such file' % specpath, - _buildalien.__name__) - continue - _swversion = os.getenv('release') - if not _swversion: - _swversion = _version - source0 = os.path.join(sourcedir, d[1] + suffix) - if d[0].startswith('http://'): - cmd = '{ cd %s && wget %s; } >&2' % (sourcedir, os.path.join(d[0], d[1] + suffix)) - status = os.system(cmd) - if status != 0: - errs.append(Error(_buildalien.__name__, cmd, exitstatus(status))) - error(cmd, _buildalien.__name__) - if os.path.exists(source0): - os.remove(source0) - continue - else: - warn('%s %s: No source found' % (d[0], d[1]), - _buildalien.__name__) - continue - - cmd = 'rpmbuild --define "_version %s" --define "_swversion %s" --define "_sourcedir %s" --define "_builddir %s" --define "_buildrootdir %s" --define "_rpmdir %s" --define "_tmppath %s" --target=%s -bb %s >&2' % (_version, _swversion, sourcedir, builddir, buildrootdir, rpmdir, tmppath, buildarch, specpath) - status = os.system(cmd) - if status != 0: - errs.append(Error(_buildalien.__name__, cmd, exitstatus(status))) - error(cmd, _buildalien.__name__) - os.remove(source0) - - if errs: raise errs.pop() - -#macro AtlasDBRelease_requires "http://atlas.web.cern.ch/Atlas/GROUPS/DATABASE/pacman4/DBRelease:DBRelease-$(AtlasDBRelease_native_version)" - -def _tmppath(): - #tmppath = os.getenv('builddir') - tmppath = os.getenv('TMPDIR') # should always be set - if not tmppath: - cmd = 'rpm -E %_tmppath' - status, tmppath = commands.getstatusoutput(cmd) - if status != 0: - #error(tmppath, rpmfile.__name__) - raise CommandError(cmd, tmppath, exitstatus(status)) - return tmppath - -def _builddir(): - builddir = os.getenv('builddir') # should always be set - if not builddir: - cmd = 'rpm -E %_builddir' - status, builddir = commands.getstatusoutput(cmd) - if status != 0: - #error(builddir, rpmfile.__name__) - raise CommandError(cmd, builddir, exitstatus(status)) - return builddir - -def _buildrootdir(): - buildrootdir = os.getenv('buildrootdir') # should always be set - if not buildrootdir: - cmd = 'rpm -E %_buildrootdir' - status, buildrootdir = commands.getstatusoutput(cmd) - if status != 0: - #error(buildrootdir, rpmfile.__name__) - raise CommandError(cmd, buildrootdir, exitstatus(status)) - return buildrootdir - -def _specdir(): - specdir = os.getenv('specdir') # should always be set - if not specdir: - cmd = 'rpm -E %_specdir' - status, specdir = commands.getstatusoutput(cmd) - if status != 0: - #error(specdir, rpmfile.__name__) - raise CommandError(cmd, specdir, exitstatus(status)) - return specdir - -##################################### main ########################################## - -NPVA = sys.argv[1].split() # Name Package Version Architecture (CMTCONFIG noarch) - # Name Project Release Architecture (bin src doc noarch) -if len(NPVA) < 3: - error('%s: Too few parameters' % ' '.join(NPVA)) - sys.exit(2) -if len(NPVA) == 3: - NPVA.append(os.getenv('CMTCONFIG')) - -name = NPVA[0] # 'ROOT_3_10_02_0411_slc3_gcc323' - -if len(sys.argv) > 7 and sys.argv[6] and sys.argv[7]: # external software paths - type = 'extern' -else: - type = 'proj' - -if len(sys.argv) > 5 and sys.argv[5]: - version = sys.argv[5] -else: - try: version = str(int(_getver(name)) + 1) - except ValueError: - version = '1' - print >> sys.stderr, "%s: Version set to %s" % (name, version) - warn('%s: Set version to %s' % (name, version)) - -summary = ' '.join(NPVA[1:3]) #name #'ROOT' - -if NPVA[3] in ['src', 'doc', 'noarch']: - buildarch = 'noarch' -else: - buildarch = os.getenv('CMTCONFIG').split('-')[0] #'i686' - -# add dependencies -extradeps = ['atlas-filesystem'] -requires = extradeps -if len(sys.argv) > 2 and sys.argv[2]: - reqfile = file(sys.argv[2]) - requires += reqfile.read().splitlines() -requires = [r.split()[0] for r in requires if r] - -retval = 0 -# try to build dependencies from external tarballs, if can be found -try: - _buildalien(_getalien(requires), buildarch) -except Error, e: - retval += 1 - -requires = ', '.join([r[r.rfind(':') + 1:] for r in requires]) - -rpmdir, rpmfilename = rpmfile(name, version, '1', buildarch, type) -rpmpath = os.path.join(rpmdir, rpmfilename) -if os.path.isfile(rpmpath): - info('%s: File exists' % rpmpath) - sys.exit(retval) - -# add provides, if needed -provides = [] -#if len(sys.argv) > 7 and sys.argv[6] and sys.argv[7]: # external software paths -if type == 'extern': - p = '_'.join([NPVA[1], NPVA[2], '_'.join(NPVA[3].split('-'))]) - if p != NPVA[0] and p not in provides: - provides += [p] -# IndexError: list index out of range -provides = ', '.join(provides) - -# write spec file -specinfile=file(os.path.join(os.path.dirname(sys.argv[0]), os.pardir, 'specs', 'proj.spec.in')) -#IOError: [Errno 2] No such file or directory: '/data/rybkine/PAD/bin/specs/extern.spec.in' -spec = specinfile.read() % vars() -# KeyError: provides -specinfile.close() - -if not requires: - spec = re.sub(r'(?mi)^requires[ \t]*:[ \t\S]*\n', '', spec) -if not provides: - spec = re.sub(r'(?mi)^provides[ \t]*:[ \t\S]*\n', '', spec) - -# fill in %files section -if type == 'extern': sourcedir = os.path.join(os.environ['externcache'], 'kits') -elif type == 'proj': sourcedir = os.path.join(os.environ['projcache'], 'kits') -else: sourcedir = None -if not sourcedir: - error('No source directory specified') - sys.exit(2) - -source0 = os.path.join(sourcedir, name + '.tar.gz') -if os.path.isfile(source0): - if len(sys.argv) > 7 and sys.argv[6] and sys.argv[7]: # external software paths - if NPVA[3].endswith('_debuginfo'): - cmd = 'find . -noleaf \\( \\! -type d -o -empty \\) -print >|$RPM_BUILD_DIR/files.txt\n' - cmd += '%{__sed} -i "s#^\\.#%%{prefix}#" $RPM_BUILD_DIR/files.txt\n' - spec = spec.replace('%{_fixperms} .\n', '%{_fixperms} .\n' + cmd) - spec = spec.replace('%files', '%files -f files.txt') - else: - src = sys.argv[6].split() - dst = sys.argv[7].split() - paths = '' - for f in zip(src, dst): - if not (os.path.isfile(f[0]) or os.path.isdir(f[0])): - error("%s: No such file or directory" % f[0]) - retval += 1 - paths += os.path.join('%{prefix}', f[1]) + '\n' - if paths: - spec = spec.replace('%defattr(-,root,root,-)\n', - '%defattr(-,root,root,-)\n' + paths) - - elif len(NPVA) > 3: # projects, settings - if NPVA[3] == 'bin': - cmd = 'find . -noleaf -name ' + os.getenv('CMTCONFIG') + ' -prune -print >|$RPM_BUILD_DIR/files.txt\n' - cmd += '%{__sed} -i "s#^\\.#%%{prefix}#" $RPM_BUILD_DIR/files.txt\n' - spec = spec.replace('%{_fixperms} .\n', '%{_fixperms} .\n' + cmd) - spec = spec.replace('%files', '%files -f files.txt') - elif NPVA[3] == 'debuginfo': - cmd = 'find . -noleaf \\( \\! -type d -o -empty \\) -print >|$RPM_BUILD_DIR/files.txt\n' - # cmd = 'find . -noleaf -name "*' + os.getenv('debuginfosuffix') + '" -print >|$RPM_BUILD_DIR/files.txt\n' - cmd += '%{__sed} -i "s#^\\.#%%{prefix}#" $RPM_BUILD_DIR/files.txt\n' - spec = spec.replace('%{_fixperms} .\n', '%{_fixperms} .\n' + cmd) - spec = spec.replace('%files', '%files -f files.txt') - elif NPVA[3] in ['src', 'doc']: - cmd = 'find . -noleaf \\( \\! -type d -o -empty \\) -print >|$RPM_BUILD_DIR/files.txt\n' - cmd += '%{__sed} -i "s#^\\.#%%{prefix}#" $RPM_BUILD_DIR/files.txt\n' - spec = spec.replace('%{_fixperms} .\n', '%{_fixperms} .\n' + cmd) - spec = spec.replace('%files', '%files -f files.txt') - elif NPVA[3] == 'noarch': - cmd = 'find . -noleaf -type d -name cmt -exec test -f \'{}\'/requirements \\; \ --exec touch -a \'{}\'/setup.sh \'{}\'/setup.csh \'{}\'/cleanup.sh \'{}\'/cleanup.csh \\; \ --not -exec test -f \'{}\'/Makefile \\; -exec %{__cp} -p $PACKRPM/specs/Makefile.cmt \'{}\'/Makefile \\;\n' - spec = spec.replace('%{_fixperms} .\n', '%{_fixperms} .\n' + cmd) - if NPVA[1] == 'AtlasSetup': - # %{prefix}/NPVA[1] - paths = os.path.join('%{prefix}', NPVA[1]) + '\n' - else: - # %{prefix}/NPVA[1]/NPVA[2] - paths = os.path.join('%{prefix}', NPVA[1], NPVA[2]) + '\n' - spec = spec.replace('%defattr(-,root,root,-)\n', - '%defattr(-,root,root,-)\n' + paths) - else: - error("%s: Unknown platform: %s %s %s" % NPVA[3], NPVA[0], NPVA[1], NPVA[2]) - sys.exit(1) - else: - error("%s: Cannot build file list: %s" % source0, sys.argv[1]) - sys.exit(1) -else: - warn("%s: No such file" % source0) - spec = re.sub(r'(?mi)^Source0[ \t]*:[ \t\S]*\n', '', spec) - - spec = re.sub(r'(?m)^%{__gzip}.*$', 'touch %{name}.ghost', spec) - paths = '%ghost %{prefix}/%{name}.ghost\n' - spec = spec.replace('%defattr(-,root,root,-)\n', - '%defattr(-,root,root,-)\n' + paths) - #spec = re.sub(r'(?s)\n%install.*\n%clean', '\n%install\n\n%clean', spec) - - #spec = re.sub(r'(?s)\n%files.*\Z', '\n', spec) - -logpath = '$RPM_INSTALL_PREFIX/var/log/scripts.log' -# add preinstall-script -if len(sys.argv) > 4 and sys.argv[4]: - prefile = file(sys.argv[4]) - pre = prefile.read().replace('@INSTALL_PREFIX@', '$RPM_INSTALL_PREFIX') - prefile.close() - if pre: - pre = '{ %s; } >>%s 2>&1' % (pre.rstrip(), logpath) - #spec += '\n%pre\n' + pre + '\n' - spec += '\n%pre\nshift $#\n' + pre + '\n' # better add to the script -# echo "shell('$(sed s/@INSTALL_PREFIX@/\$PACMAN_INSTALLATION/g $4)')" >>${fpath} - -# add postinstall-script -if len(sys.argv) > 3 and sys.argv[3]: - postfile = file(sys.argv[3]) - post = postfile.read().replace('@INSTALL_PREFIX@', '$RPM_INSTALL_PREFIX') - postfile.close() - if post: - post = '{ %s; } >>%s 2>&1' % (post.rstrip(), logpath) - #spec += '\n%post\n' + post + '\n' - spec += '\n%post\nshift $#\n' + post + '\n' # better add to the script -# echo "shell(\"$(sed s/@INSTALL_PREFIX@/\$PACMAN_INSTALLATION/g $3)\")" >>${fpath} - -# add preuninstall-script -if len(sys.argv) > 8 and sys.argv[8]: - preunfile = file(sys.argv[8]) - preun = preunfile.read().replace('@INSTALL_PREFIX@', '$RPM_INSTALL_PREFIX') - preunfile.close() - if preun: - preun = '{ %s; } >>%s 2>&1' % (preun.rstrip(), logpath) - spec += '\n%preun\n' + preun + '\n' - -builddir = _builddir() -buildrootdir = _buildrootdir() -tmppath = _tmppath() -specdir = _specdir() - -specpath = os.path.join(specdir, name + '.spec') -specfile = file(specpath, 'w') -specfile.write(spec) -specfile.close() -#info "Writing ${fpath}, version ${ver}" $FUNCNAME -info("Wrote: %s, version %s" % (specpath, version)) - -cmd = 'rpmbuild --define "_sourcedir %s" --define "_builddir %s" --define "_buildrootdir %s" --define "_rpmdir %s" --define "_tmppath %s" --target=%s -bb %s >&2' \ - % (sourcedir, builddir, buildrootdir, rpmdir, tmppath, buildarch, specpath) -status = os.system(cmd) -if status != 0: - if exitstatus(status): - retval = exitstatus(status) - else: - retval += 1 - error(cmd) - -sys.exit(retval) diff --git a/PackDist/share/create-cmthome.sh b/PackDist/share/create-cmthome.sh deleted file mode 100755 index a86a684e5a3e87afab29fd2574dc794ccb13777d..0000000000000000000000000000000000000000 --- a/PackDist/share/create-cmthome.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# File: create-cmthome.sh -# -# Create cmthome with a customised requirements file -# and a test area directory to use with the distribution kit -# -# Usage: ./create-cmthome.sh # from where the kit has been installed -# -# version 0.0.1 -# -# Report bugs to <Grigori.Rybkine@cern.ch>. -# Written by Grigori Rybkine. -# - -[ -d cmtsite ] || { echo "cmtsite: No such directory"; exit 2; } -if [ -d $HOME/cmthome ]; then - echo $HOME/cmthome exists - echo Trying to make a backup of $HOME/cmthome - mv -v $HOME/cmthome $HOME/cmthome.bak || exit 1 -fi - -echo Copying -cp -av cmtsite $HOME/cmthome - -[ -f $HOME/cmthome/requirements ] || { echo "$HOME/cmthome/requirements: No such file"; exit 2; } - -echo Customising $HOME/cmthome/requirements to use with the kit -sed -i -e 's%#.*$%%' -e '/^$/d' -e 's/apply_tag noTest/#apply_tag noTest/' \ --e 's#\(use AtlasLogin.*\)#macro ATLAS_TEST_AREA ${HOME}/testarea\n\n\1#' \ -$HOME/cmthome/requirements -echo ATLAS_TEST_AREA will be set to ${HOME}/testarea -echo "check https://twiki.cern.ch/twiki/bin/view/Atlas/AtlasLoginPackage for further details" - -[ -d ${HOME}/testarea ] || mkdir -v ${HOME}/testarea - -echo Configuring to use CMT from the kit -(. cmtsite/setup.sh >/dev/null 2>&1; cd $HOME/cmthome; cmt config) diff --git a/PackDist/share/pack-relocate.sh b/PackDist/share/pack-relocate.sh deleted file mode 100755 index 4c8dcce13cf8fda5e2ab427de0439a83b245c06a..0000000000000000000000000000000000000000 --- a/PackDist/share/pack-relocate.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/sh - -msg="Usage: `basename $0` [OPTION]... SOURCE DEST - or: `basename $0` [OPTION]... -t PATH... -In first form, relocate the ATLAS distribution kit from SOURCE to DEST. -In second form, locate the ATLAS distribution kit in PATH and transform -as described for -t option (implies -i option). - - -i edit files in-place, without moving them from SOURCE to DEST - -c only relocate files in cmtsite - -t transform setup scripts so that full paths in them may be changed by setting ATLAS_RELEASE_BASE environment variable - -h display this help and exit - -v output version information and exit - -Report bugs to <Grigori.Rybkine@cern.ch>." - -ver="`basename $0` (PackDist) 0.7.0 -Written by Grigori Rybkine." - -unset _inplace _config _transform - -while getopts "icthv" opt; do - case $opt in - i) _inplace=y ;; - c) _config=y ;; - t) _transform=y ;; - h) echo "$msg"; exit 0 ;; - v) echo "$ver"; exit 0 ;; - \?) echo "$msg"; exit 1 ;; - esac -done - -shift $(($OPTIND - 1)) - -transform () -{ - p=$(find "$1" -path '*/cmtsite/requirements' -print -quit) || return - [ -f "$p" ] || { echo >&2 "Cannot find release in $1"; return 1; } - siteroot=$(awk '$1 == "set" && $2 == "SITEROOT" {print $3; exit}' $p) || return - [ -d "$siteroot" ] || { echo >&2 "Cannot determine SITEROOT from $p"; return 1; } - resiteroot=$(echo "${siteroot}"|awk '{gsub("/", "\\/");print}') || return - - for suffix in .sh .csh; do -if [ ${suffix} = .csh ]; then -sed_script='/^[^#]*'"${resiteroot}"'/{ -i\ -if (! ${?ATLAS_RELEASE_BASE}) then -p -i\ -else -s/'"${resiteroot}"'/${ATLAS_RELEASE_BASE}/g -a\ -endif -}' -elif [ ${suffix} = .sh ]; then -sed_script='/^[^#]*'"${resiteroot}"'/{ -s/'"${resiteroot}"'/${ATLAS_RELEASE_BASE:-'"${resiteroot}"'}/g -}' -fi - -find "${siteroot}"/.cmtsite "${siteroot}"/cmtsite -noleaf -type f \( -name setup${suffix} -o -name cleanup${suffix} -o -name asetup${suffix} \) \! -exec grep -F -q ATLAS_RELEASE_BASE '{}' \; -exec sed -i "${sed_script}" '{}' \+ || retval=1 - -[ "${_config:-}" != y ] || continue - -find "${siteroot}"/CMT -noleaf -type f \( -path \*/mgr/setup${suffix} -o -path \*/mgr/cleanup${suffix} \) \! -exec grep -F -q ATLAS_RELEASE_BASE '{}' \; -exec sed -i "${sed_script}" '{}' \+ || retval=1 - -find "${siteroot}" -noleaf -type f \( -path \*/cmt/setup${suffix} -o -path \*/cmt/cleanup${suffix} \) \! -exec grep -F -q ATLAS_RELEASE_BASE '{}' \; -exec sed -i "${sed_script}" '{}' \+ || retval=1 - -# optimised environment setup - setup scripts -find "${siteroot}" -noleaf -type f \( -path \*/standalone-setup${suffix} -o -path \*/standalone-init${suffix} \) \! -exec grep -F -q ATLAS_RELEASE_BASE '{}' \; -exec sed -i "${sed_script}" '{}' \+ || retval=1 -done - -# optimised environment setup - requirements file -sed_script='/^[^#]*'"${resiteroot}"'/{ -s/'"${resiteroot}"'/${SITEROOT}/g -}' -find "${siteroot}" -noleaf -type f -name requirements -exec grep -q '^# CMTFLAGS:' '{}' \; -exec grep -F -q "${siteroot}" '{}' \; -exec sed -i "${sed_script}" '{}' \+ || retval=1 - return ${retval} -} - -retval=0 -if [ "${_transform-}" = y ]; then - [ $# -ge 1 ] || set $PWD || exit - for p; do - transform "$p" || retval=1 - done - exit ${retval} -fi - -[ $# -eq 2 ] || { echo "$msg"; exit 1; } - -src=$(echo $1|sed -e 's#/\{1,\}#/#g' -e 's#/*$##') -dst=$(echo $2|sed -e 's#/\{1,\}#/#g' -e 's#/*$##') - -if [ `expr $src : '/'` -eq 0 ]; then - src=${PWD}/${src} -fi -if [ `expr $dst : '/'` -eq 0 ] ; then - dst=${PWD}/${dst} -fi - -[ -d ${src}/.cmtsite ] || -{ echo >&2 "Distribution kit in '$src' built with PackDist prior to PackDist-00-05-00: Cannot relocate"; exit 1; } - -if [ "${_inplace}" != y ]; then - [ ! -d ${dst} ] || { echo >&2 "Directory '${dst}' already exists"; exit 2; } - mv ${src} ${dst} || exit - _dst=${dst} -else - _dst=${src} -fi - -find ${_dst}/.cmtsite ${_dst}/cmtsite -noleaf -type f \( -name requirements\* -o -name asetup_defaults\* -o -name setup.sh -o -name setup.csh -o -name cleanup.sh -o -name cleanup.csh -o -name asetup.sh -o -name asetup.csh \) | xargs -r sed -i 's,'${src}','${dst}',g' || exit - -find ${_dst}/cmtsite -noleaf -type f -name asetup_defaults\* | xargs -r sed -i 's,'`dirname ${src}`','`dirname ${dst}`',g' || exit - -[ "${_config:-}" != y ] || exit 0 - -find ${_dst}/CMT -noleaf -type f \( -path \*/mgr/setup.sh -o -path \*/mgr/setup.csh -o -path \*/mgr/cleanup.sh -o -path \*/mgr/cleanup.csh \) | xargs -r sed -i 's,'${src}','${dst}',g' || exit - -find ${_dst} -noleaf -type f \( -path \*/cmt/setup.sh -o -path \*/cmt/setup.csh -o -path \*/cmt/cleanup.sh -o -path \*/cmt/cleanup.csh \) | xargs -r sed -i 's,'${src}','${dst}',g' || exit - -find ${_dst}/DBRelease -noleaf -type f -name \*.xml | xargs -r sed -i 's,'${src}','${dst}',g' || exit - -sed_script='s,'"${src}"','"${dst}"',g' -# optimised environment setup - setup scripts -find "${_dst}" -noleaf -type f \( -path \*/standalone-setup.sh -o -path \*/standalone-init.sh -o -path \*/standalone-setup.csh -o -path \*/standalone-init.csh \) -exec sed -i "${sed_script}" '{}' \+ || retval=1 - -# optimised environment setup - requirements file -find "${_dst}" -noleaf -type f -name requirements -exec grep -q '^# CMTFLAGS:' '{}' \; -exec sed -i "${sed_script}" '{}' \+ || retval=1 - -exit ${retval} diff --git a/PackDist/share/pack-standalone.py b/PackDist/share/pack-standalone.py deleted file mode 100755 index 125ffb11bc619645141575eeb01e78cf367c8803..0000000000000000000000000000000000000000 --- a/PackDist/share/pack-standalone.py +++ /dev/null @@ -1,283 +0,0 @@ -#!/usr/bin/env python -"""File: pack-standalone.py - -Usage: pack-standalone.py [OPTION]... PATH... -Create a standalone pacman file from the pacman file built by the PackDist tools -for project (binary) package(s) found in command line argument(s) PATH... -Only dependencies on the same project packages and external software packages, -if found in the same directory as the processed package, are preserved. - - -d, --debug print lots of debugging information - -h, --help display this help and exit - --version output version information and exit - -Report bugs to <Grigori.Rybkine@cern.ch>. -""" - -__version__ = '0.3.1' -__date__ = 'Sun Aug 01 2010' -__author__ = 'Grigory Rybkin' - -import sys, os -import re -import commands -import logging -import shutil -import getopt - -try: - __path__ = [os.path.join(os.path.dirname(sys.modules[__name__].__file__), 'python')] -except AttributeError, e: - # with Python 2.2.3, sys.modules['__main__'] - # AttributeError: 'module' object has no attribute '__file__': even for scripts - if __name__ == '__main__': - __path__ = [os.path.join(os.path.dirname(sys.argv[0]), 'python')] - else: - raise -from PackDistCommon import * - -class Parser(object): - def __init__(self, package): - self.package = package - self.parsers = [] - p_cmt = re.compile(r'package\(\'CMTv\d+(?:r\d+)?(?:p\d+)?.*\'\)\s*') - self.parsers.append((p_cmt, self.comment)) - p_settings = re.compile(r'package\(\'Atlas(?:Settings|Login|Setup)\'\)\s*') - self.parsers.append((p_settings, self.comment)) - p_self = re.compile(r'package\(\'%s.+\'\)\s*' % \ - re.sub('[-.]', '_', '%s_%s' % \ - (self.package.project, self.package.release))) - self.parsers.append((p_self, self.keep)) - p_other = re.compile(r'package\(\'(?P<package>.+)\'\)\s*') - self.parsers.append((p_other, self.other)) - p_shell = re.compile(r'shell\s*\(.*\)\s*') - self.parsers.append((p_shell, self.shell)) - p_any = re.compile(r'(?s).*') - self.parsers.append((p_any, self.keep)) - self.pacman = [] - self.pre = True - self.post = False - def comment(self, line, match): - self.pacman.append('#%s' % line) - logger.debug('comment: %r\n%s' % (line, self.pacman)) - def keep(self, line, match): - self.pacman.append(line) - logger.debug('keep: %r\n%s' % (line, self.pacman)) - def other(self, line, match): - logger.debug('other: %r %s' % (line, match.group('package'))) - try: - pkg = Package(os.path.join(os.path.dirname(self.package.filename), - match.group('package') + self.package.name[1] - ) - ) - if pkg.type == 'extern': - self.keep(line, match) - logger.warning('%s: Kept external dependency %r', - self.package.name[0], match.group('package')) - else: - self.comment(line, match) - except IOError, e: - logger.debug('other: %s', e, exc_info=True) - self.comment(line, match) - def skip(self, line, match): - logger.debug('skip: %r\n%s' % (line, self.pacman)) - def shell(self, line, match): - logger.debug('shell: %r\n%s' % (line, self.pacman)) - if self.pre: - self.pre = False - self.post = True - l = self.package.pre + os.linesep - self.pacman.append(l) - logger.debug('append: %r\n%s' % (l, self.pacman)) - elif self.post: - try: - self.post = False - l = self.package.post + os.linesep - self.pacman.append(l) - logger.debug('append: %r\n%s' % (l, self.pacman)) - except AttributeError, e: - logger.debug('shell: %s', e, exc_info=True) - self.comment(line, match) - else: - logger.warning('unexpected: %r' % line) - self.comment(line, match) - - def parse(self): - for line in self.package.pacman.splitlines(True): - logger.debug('parsing: %r', line) - for (p, a) in self.parsers: - m = p.match(line) - if m: - a(line, m) - break - - logger.debug('parsed: %s' % self.pacman) - return ''.join(self.pacman) - -class Package(object): - def __init__(self, filename): - self.name = os.path.splitext(os.path.basename(filename)) - assert self.name[1] == '.pacman', '%s: Instantiated with file name' % `filename` - self.filename = filename - - pacmanfile = open(self.filename) - self.pacman = pacmanfile.read() - pacmanfile.close() - - m = re.search(r'description(.*External.*)', self.pacman) - if m: self.type = 'extern' - else: self.type = 'proj' - - if self.name[0].startswith('CMTv'): self.type = 'CMT' - - if self.type in ('extern', 'CMT'): return - - name = self.name[0].split('_') - self.project = name[0] - if name[0] in ('AtlasSettings', 'AtlasLogin', 'AtlasSetup'): - self.platform = 'noarch' - self.release = re.search(r'version\(\'(?P<version>.+)\'\)', - self.pacman).group('version') - elif name[-1] in ('src', 'noarch'): - self.platform = name[-1] - self.release = '.'.join(name[1:-1]) - else: - self.platform = '-'.join(name[-4:]) - self.release = '.'.join(name[1:-4]) - self.pre = 'shell(\'[ "$CMTROOT" ] && [ "$CMTBIN" ] && [ "$CMTCONFIG" ] || { echo "Project environment not set" >&2; exit 1; }\')' - - m = re.search(r'shell\s*\(".*?(?P<config>cd\s+\$PACMAN_INSTALLATION/(?P<project>[\w.-]+)/(?P<release>[\w.-]+)/(?P<cntnrcmt>([\w.-]+/)+cmt).*)"\)\s*', self.pacman) - if m: - self.project = m.group('project') - self.release = m.group('release') - self.cntnrcmt = m.group('cntnrcmt') - self.post = 'shell("unset CMTPATH; %s")' % m.group('config') - logger.debug('cntnrcmt: %s', m.group('cntnrcmt')) - logger.debug('postinstall script:\n%s', self.post) - else: - logger.warning('%s %s %s: Cannot determine postinstall script', - self.project, self.release, self.platform) - - logger.debug('%s %s %s: Initialised', - self.project, self.release, self.platform) - - def standalone(self): - if self.type in ('extern', 'CMT'): - logger.debug('type %s: %s: Nothing to change', - `self.type`, self.name[0]) - return 0 - if self.platform in ('src', 'noarch'): - logger.debug('platform %s: %s: Nothing to change', - `self.platform`, self.name[0]) - return 0 - - if len(self.release.split('.')) < 4: - logger.warning('%s %s %s %s: Does not look a patch project', - self.name[0], self.project, self.release, self.platform) - - try: - pacman_new = Parser(self).parse() -# if pacman_new == ''.join(pacman): - if pacman_new == self.pacman: - logger.info('standalone: %s' % self.filename) - return 0 - - filename_real = os.path.realpath(self.filename) - os.rename(filename_real, filename_real + '.save') -# shutil.copy2(filename_real, filename_real + '.save') -# logger.info('copied %s -> %s', - logger.info('renamed %s -> %s', - `filename_real`, `filename_real + '.save'`) - - pacmanfile = open(filename_real, 'w') - pacmanfile.write(pacman_new) - pacmanfile.close() - logger.info('wrote: %s' % pacmanfile.name) - return 0 - - except (IOError, os.error), e: -# logger.error(e) - logger.error(e, exc_info=True) -# pacmanfile.close() - return 1 - -def pkg_files(paths): - ps = [] - errs = [] - for p in paths: - if os.path.isfile(p) or os.path.isdir(p): - ps.append(p) - else: - errs.append(p) - for p in errs: - print >> sys.stderr, 'No such file or directory:', p - if not ps: - raise InputError(' '.join(paths), 'No valid arguments') - - cmd = 'find ' + ' '.join(ps) + ' -noleaf -name "*.pacman"' -# cmd = 'find ' + ' '.join(ps) + ' -noleaf \\( -name "*opt*.pacman" -o -name "*dbg*.pacman" \\)' - sc, filenames = commands.getstatusoutput(cmd) - if sc != 0: - # The exit status for the command can be interpreted - # according to the rules for the C function wait(). - raise CommandError(cmd, filenames, sc) - return filenames.splitlines() - -def help(): - print sys.modules[__name__].__doc__ - -def main(argv=[__name__]): - self = os.path.basename(argv[0]) - try: - opts, args = getopt.getopt(argv[1:], - "hd", - ["help", "version", "debug"]) - except getopt.error, e: - print >>sys.stderr, '%s: %s' % (self, str(e)) - print >>sys.stderr, "Try '%s --help' for more information." % self - return 1 - - global logger - logging.basicConfig() - logger = logging.getLogger(self) - logger.setLevel(logging.INFO) - -# ch = logging.StreamHandler() -# ch.setFormatter(logging.Formatter("%(name)s: %(levelname)s: %(message)s")) -# ch.setLevel(logging.INFO) - - for o, v in opts: - if o in ("-h", "--help"): - print sys.modules[__name__].__doc__ - return 0 - elif o in ("--version",): - print '%s %s (%s)' % (self, __version__, __date__) - print '%sWritten by %s.' % (os.linesep, __author__) - return 0 - elif o in ("-d", "--debug"): - logger.setLevel(logging.DEBUG) -# ch.setLevel(logging.DEBUG) - -# logger.addHandler(ch) - - if not args: - print >>sys.stderr, '%s: missing path argument' % self - print >>sys.stderr, "Try '%s --help' for more information." % self - return 1 - - try: - filenames = pkg_files(args) - except InputError, e: - print >> sys.stderr, e - help() - return 1 - - sc = 0 - for filename in filenames: - sc += Package(filename).standalone() - - if sc != 0: return 1 - else: return 0 - -if __name__ == '__main__': - sys.exit(main(sys.argv)) diff --git a/PackDist/share/python/PackDistCommon.py b/PackDist/share/python/PackDistCommon.py deleted file mode 100755 index 0833847cfd1065059cea672b676003e232021674..0000000000000000000000000000000000000000 --- a/PackDist/share/python/PackDistCommon.py +++ /dev/null @@ -1,61 +0,0 @@ -"""File: PackDistCommon.py - -Common classes and utility functions of the PackDist package. -""" - -__author__ = 'Grigori Rybkine <Grigori.Rybkine@cern.ch>' -__version__ = '0.2.1' -__date__ = 'Wed Oct 03 2012' - -__all__ = ['Error', 'InputError', 'CommandError', 'exitstatus'] - -import sys -import os - -class Error(Exception): - """Base class for exceptions in this module.""" - def __str__(self): - return ': '.join([str(arg) for arg in self.args]) - def write(self, file = sys.stderr): - print >> file, '%s: %s' % (self.__class__.__name__, self) - -class InputError(Error): - """Exception raised for errors in the input. - - Attributes: - expression() -- input expression in which the error occurred - message() -- explanation of the error - """ - - def __init__(self, expression, message): - Error.__init__(self, expression, message) - def expression(self): - return self.args[0] - def message(self): - return self.args[1] - -class CommandError(Error): - """Exception raised for errors executing shell commands. - - Attributes: - args[0] -- shell command executing which the error occurred - args[1] -- stderr and stdout of the command - args[2] -- exit status of the command - """ - - def __init__(self, cmd, output, sc = None): - Error.__init__(self, cmd, output, sc) - -def exitstatus (status): - """Return child exit status, if child terminated normally, None otherwise. - - Parameter status: child process status information as returned by os.wait(), - or os.waitpid(), - os.system(), close() method of file object returned by os.popen(), - commands.getstatusoutput() - """ - - if os.WIFEXITED(status): - return os.WEXITSTATUS(status) - else: - return None diff --git a/PackDist/share/rpm-erase.sh b/PackDist/share/rpm-erase.sh deleted file mode 100755 index 8c2b686104ba2c398c16a3fbb8155e1eb4aee312..0000000000000000000000000000000000000000 --- a/PackDist/share/rpm-erase.sh +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/sh -# File: rpm-erase.sh -# -# Author: Grigori Rybkine <Grigori.Rybkine@cern.ch>. -# -__version__='0.3.1' -__date__='Fri Mar 28 2008' -__author__='Grigori Rybkine <Grigori.Rybkine@cern.ch>' - -_help () -{ -cat <<EOF -Usage: `basename $0` [OPTION]... PACKAGE [PACKAGE]... -Erase (uninstall) RPM PACKAGE(s). - - -p <path> use the database in directory <path> - -D erase as many package(s) upon which PACKAGE(s) depend as possible - -k <pattern> do not erase package(s) which match (basic) regular expression <pattern> - -y assume Yes to all queries and do not prompt - -h display this help and exit - -v output version information and exit - -Report bugs to <Grigori.Rybkine@cern.ch>. -EOF -} - -_version () -{ -echo "`basename $0` version $__version__" -echo Written by Grigori Rybkine. -} - -_parse_opts () -{ -local msg="Try '`basename $0` -h' for more information." - -unset dbpath deps keep reply - -while getopts ":p:Dk:yhv" opt; do - case $opt in - p) eval dbpath=${OPTARG} ;; - D) deps=yes ;; - k) keep="${OPTARG}" ;; - y) reply=yes ;; - h) _help; exit 0 ;; - v) _version; exit 0 ;; - \?) echo -e "`basename $0`: invalid option: -${OPTARG}\n$msg"; exit 1;; - :) echo -e "`basename $0`: argument required for option: -${OPTARG}\n$msg"; exit 1;; - esac -done - -shift $(($OPTIND - 1)) - -[ $# -gt 0 ] || { echo -e "`basename $0`: no argument(s) specified\n$msg"; exit 1; } -} - -_reqpkg_d () -{ -# -# depth-first -# -local created=no -[ -f "$tmpdone" ] || -# Do not consider the /bin/sh capability -{ tmpdone=$(mktemp) && created=yes && echo /bin/sh >>$tmpdone; } || return - -local tmpreq=$(mktemp) || return -local tmppkg=$(mktemp) || return -local reqnm pkg - -for pkg; do - -rpm ${dbpath:+--dbpath ${dbpath}} -q --quiet $pkg || continue -rpm ${dbpath:+--dbpath ${dbpath}} -q --qf '[%{REQUIRENAME}\n]' $pkg >|$tmpreq || continue - -for reqnm in $(<$tmpreq); do - grep -q "^$reqnm\$" $tmpdone && continue - echo $reqnm >>$tmpdone || return - rpm ${dbpath:+--dbpath ${dbpath}} -q --qf '[%{NAME}\n]' --whatprovides $reqnm >|$tmppkg || continue - _exclude "$keep" $tmppkg || return - cat $tmppkg || return - if [ "$deps" ]; then - _reqpkg_d $(<$tmppkg) || return - fi -done - -done - -rm -f $tmpreq $tmppkg -[ $created == no ] || rm -f $tmpdone -} - -_reqpkg () -{ -[ $# -gt 0 ] || return 0 - -local created=no -[ -f "$tmpdone" ] || -# Do not consider the /bin/sh capability -{ tmpdone=$(mktemp) && created=yes && echo /bin/sh >>$tmpdone; } || return - -local tmpreq=$(mktemp) || return -local tmpnm=$(mktemp) || return -local tmppkg=$(mktemp) || return -local pkg reqnm - -for pkg; do -rpm ${dbpath:+--dbpath ${dbpath}} -q --quiet $pkg || continue -rpm ${dbpath:+--dbpath ${dbpath}} -q --qf '[%{REQUIRENAME}\n]' $pkg >|$tmpnm || continue -cat $tmpnm >>$tmpreq || return -done -sort -u -o $tmpreq $tmpreq || return - -for reqnm in $(<$tmpreq); do - grep -q "^$reqnm\$" $tmpdone && continue - echo $reqnm >>$tmpdone || return - rpm ${dbpath:+--dbpath ${dbpath}} -q --qf '[%{NAME}\n]' --whatprovides $reqnm >|$tmpnm || continue - cat $tmpnm >>$tmppkg || return -done -sort -u -o $tmppkg $tmppkg || return - -rm -f $tmpreq $tmpnm - -_exclude "$keep" $tmppkg || return -cat $tmppkg || return -if [ "$deps" ]; then - _reqpkg $(<$tmppkg) || return -fi - -rm -f $tmppkg -[ $created == no ] || rm -f $tmpdone -} - -_erase () -{ -local tmpdone=$(mktemp) || return - -local total=`<$1 sort -u | wc -l` || return -local nmbr=0 erased pkg -while true; do - erased=0 - for pkg in $(<$1); do - grep -q "^$pkg\$" $tmpdone && continue - rpm ${dbpath:+--dbpath ${dbpath}} --test -e "$pkg" >/dev/null 2>&1 || continue - rpm ${dbpath:+--dbpath ${dbpath}} -e "$pkg" || continue - #let erased++ nmbr++ || return - erased=`expr $erased + 1` || return - nmbr=`expr $nmbr + 1` || return - #echo -e "\t$nmbr: $pkg\t[$((nmbr*100/total))%]" || return - #echo -e "\t$nmbr: $pkg\t[$(expr $nmbr '*' 100 / $total)%]" || return - printf "%5d: %-65s [%3d%%]\n" $nmbr $pkg $(expr $nmbr '*' 100 / $total) || return - echo $pkg >>$tmpdone || return - _exclude "^$pkg\$" $1 || return - done - [ $erased -gt 0 ] || break -done -rm -f $tmpdone -} - -_uniq () -{ -# -# Discard all but one of identical lines from standard input, -# writing to standard output. -# -awk '{ if (vue[$0] != 1) { vue[$0] = 1; print } }' -} - -_exclude () -{ -# -# Discard all lines of file $2 which match (basic) regular expression $1. -# -[ "$1" ] || return 0 -sed -i '\%'"$1"'%d' "$2" -} - -main () -{ -_parse_opts "$@" -shift $(($OPTIND - 1)) - -local tmppkg=$(mktemp) || return - -if rpm ${dbpath:+--dbpath ${dbpath}} -q "$@" && - rpm ${dbpath:+--dbpath ${dbpath}} --test -e "$@"; then - - rpm ${dbpath:+--dbpath ${dbpath}} -q --qf '%{NAME}\n' "$@" | _uniq >>$tmppkg || return - - _exclude "$keep" $tmppkg || return - if [ "$deps" ]; then - echo -n "Building Dependency Tree..." - local tmppkgs=$(mktemp) || return - if [ "$depth" != yes ]; then - _reqpkg $(<$tmppkg) | _uniq >>$tmppkgs || return - else - _reqpkg_d $(<$tmppkg) | _uniq >>$tmppkgs || return - fi - cat $tmppkgs >>$tmppkg || return - rm -f $tmppkgs - echo " Done" -# _exclude "$keep" $tmppkg || return - fi - - if [ "$reply" != yes ]; then - - echo "Try to REMOVE the following packages:" - <$tmppkg sort -u | sed 's/^/\t/' || return - echo "`<$tmppkg sort -u | wc -l` removed." - echo -n "Do you want to continue? [Y/n] " - read reply - - fi - - case "$reply" in - y*|Y*) - echo "Executing RPM (-e)..." - _erase $tmppkg || return - echo "Done." - if [ -s $tmppkg ]; then - echo "Could not REMOVE the following packages:" - <$tmppkg sort -u | sed 's/^/\t/' || return - echo "`<$tmppkg sort -u | wc -l` not removed." - fi - ;; - *) echo "Abort.";; - esac - -else - rm -f $tmppkg - return 1 - -fi -retval=$? -rm -f $tmppkg -return $retval -} - -main "$@" diff --git a/PackDist/share/setup-standalone.sh b/PackDist/share/setup-standalone.sh deleted file mode 100644 index 67dbd3e5337e712cd297888953c62637ed5033a3..0000000000000000000000000000000000000000 --- a/PackDist/share/setup-standalone.sh +++ /dev/null @@ -1,33 +0,0 @@ -# -# Usage: . ./setup-standalone.sh [-H CMTHOME] [TAG]... -# Setup the environment for standalone installation of a project -# containing patches for the projects via asetup command [found in CMTHOME] -# with the tags [TAG]... -# -# Example: -# . ./setup-standalone.sh -H /afs/cern.ch/atlas/software/releases/17.0.3/cmtsite 17.0.3 32 -# - -unset cmthome -if [ $# -ge 1 ]; then - if [ $1 = -H ]; then - shift - if [ $# -ge 1 ]; then - cmthome=$1; shift - else - echo "setup-standalone.sh: ERROR: Argument required for option: -H" >&2; return 1 - fi - fi -fi - -tags=$(echo $* | tr -s ' ' ',') -shift $# - -if [ -n "$cmthome" ]; then - source $cmthome/asetup.sh ${tags} -else - asetup ${tags} -fi -setupstandalonestatus=$? -unset cmthome tags -return $setupstandalonestatus diff --git a/PackDist/share/specs/DBRelease.spec b/PackDist/share/specs/DBRelease.spec deleted file mode 100644 index b66b16a02d84067a2bd8f64193e1f33dfface286..0000000000000000000000000000000000000000 --- a/PackDist/share/specs/DBRelease.spec +++ /dev/null @@ -1,123 +0,0 @@ -%global __os_install_post /usr/lib/rpm/brp-compress %{nil} - -%{!?_version: %{error:_version not defined}} -%{!?_release: %{expand:%define _release 1}} - -%{!?_swversion: %{error:_swversion not defined}} - -Name: DBRelease-%{_version} -Version: %(echo %{_version} | %{__sed} 's/-/./g') -Release: %{_release} -Epoch: 0 -Summary: DBRelease - -Group: Application -License: ATLAS -URL: http://atlas.web.cern.ch/Atlas/GROUPS/DATABASE/pacman4/DBRelease/%{name}.tar.gz -Packager: ATLAS Offline -Source0: %{name}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -BuildArch: noarch - -AutoReqProv: no -#Requires: AtlasLogin - -Prefix: /opt/atlas - -%description -Package DBRelease for s/w rel %{_swversion} - -%prep - -%build - -%define _fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root -%define _fixgroup [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} root - -%install -%{__rm} -rf $RPM_BUILD_ROOT -%{__mkdir_p} $RPM_BUILD_ROOT%{prefix} -cd $RPM_BUILD_ROOT%{prefix} -%{__gzip} -dc %{SOURCE0} | %{__tar} -xvvf - -if [ -h DBRelease/current ]; then - %{__rm} -f DBRelease/current -fi -STATUS=$? -if [ $STATUS -ne 0 ]; then - exit $STATUS -fi -%{_fixowner} . -%{_fixgroup} . -%{_fixperms} . - -%clean -%{__rm} -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root,-) -%{prefix}/DBRelease/%{_version} - -%post -{ -dbdir=$RPM_INSTALL_PREFIX/DBRelease/%{_version} -# Edit XML configuration files, insert the full path to SQLite replicas -fn=dblookup.xml -fp=$dbdir/XMLConfig/$fn -sed -i "s#sqliteGenerated:#sqlite_file:$dbdir/#" $fp -# Edit file catalogs, insert the full paths to CondDB payload files -fns="PoolCat_oflcond.xml PoolCat_tbcond.xml PoolCat_cmccond.xml \ -PoolCat_comcond.xml" -fps= -for fn in $fns; do - fps="$fps $dbdir/poolcond/$fn" -done -sed -i "s#--GENERATED--#$dbdir/poolcond/#" $fps -# Modify the installed kit -#echo "Updating $RPM_INSTALL_PREFIX/cmtsite/requirements..." -#sed -i.dborig '$a\ -#set DBRELEASE_INSTALLED %{_version} -#/DBRELEASE/d' \ -#$RPM_INSTALL_PREFIX/cmtsite/requirements - -if [ -h $RPM_INSTALL_PREFIX/DBRelease/current ]; then - rm -f $RPM_INSTALL_PREFIX/DBRelease/current -fi -ln -s %{_version} $RPM_INSTALL_PREFIX/DBRelease/current -} >>$RPM_INSTALL_PREFIX/var/log/scripts.log 2>&1 - -%changelog -* Thu Dec 06 2012 Grigori Rybkine <Grigori.Rybkine@cern.ch> -- Override system __os_install_post macro -- Define _fixowner, _fixgroup macros since they are missing with RPM 4.8.0 and later -- In %%install section, do not exit (so as to let RPM run __spec_install_post actions) - -* Tue Aug 08 2007 Grigori Rybkine <Grigori.Rybkine@cern.ch> -- Make spec file more generic by introducing the _version, _release, _swversion macros -- Prints message to stderr and return BADSPEC if the _version or _swversion macro - not defined on the command line -- Set the _release macro to 1 if not defined on the command line -- Drop dependency on AtlasLogin (starting from DBRelease 4.1.1) - -* Sun Jul 01 2007 Grigori Rybkine <Grigori.Rybkine@cern.ch> -- Make spec file more generic by introducing the dbversion, swversion parameters -- Redirect the post scriptlet stdout and stderr to a log file - -* Mon Jan 22 2007 Grigori Rybkine <Grigori.Rybkine@cern.ch> -- Update to version 3.1.1 - -* Sun Dec 17 2006 Grigori Rybkine <Grigori.Rybkine@cern.ch> -- Update to version 3.0.1 - -* Sat Dec 02 2006 Grigori Rybkine <Grigori.Rybkine@cern.ch> -- Update to version 2.9.1 - -* Fri Dec 01 2006 Grigori Rybkine <Grigori.Rybkine@cern.ch> -- Update to new version (3.0-LST) -- Modify the post scriptlet - -* Sat Oct 21 2006 Grigori Rybkine <Grigori.Rybkine@rhul.ac.uk> -- Modify the post scriptlet (2.8-2) - -* Sun Oct 15 2006 Grigori Rybkine <Grigori.Rybkine@rhul.ac.uk> -- First spec file for DBRelease (2.8-1) diff --git a/PackDist/share/specs/Makefile.cmt b/PackDist/share/specs/Makefile.cmt deleted file mode 100644 index c2c9dbbed79a7894e694cf7a0c7d1bf0756334c3..0000000000000000000000000000000000000000 --- a/PackDist/share/specs/Makefile.cmt +++ /dev/null @@ -1,4 +0,0 @@ -include $(CMTROOT)/src/Makefile.header - -include $(CMTROOT)/src/constituents.make - diff --git a/PackDist/share/specs/proj.spec.in b/PackDist/share/specs/proj.spec.in deleted file mode 100644 index 63a475aa61dd72b79913064bd9dd449139f17ef0..0000000000000000000000000000000000000000 --- a/PackDist/share/specs/proj.spec.in +++ /dev/null @@ -1,58 +0,0 @@ -%%undefine _enable_debug_packages -%%global __os_install_post /usr/lib/rpm/brp-compress %%{nil} - -Name: %(name)s -Version: %(version)s -Release: 1 -Epoch: 0 -Summary: %(summary)s - -Group: Application/Physics -License: ATLAS -URL: http://atlas.web.cern.ch/Atlas -Packager: ATLAS Offline -Source0: %%{name}.tar.gz -BuildRoot: %%{_tmppath}/%%{name}-%%{version}-%%{release}-root-%%(%%{__id_u} -n) - -AutoReqProv: no -Requires: %(requires)s -Provides: %(provides)s - -Prefix: /opt/atlas - -%%description -High Energy Physics Application - -%%prep - -%%build - -%%define _fixowner [ `%%{__id_u}` = '0' ] && %%{__chown_Rhf} root -%%define _fixgroup [ `%%{__id_u}` = '0' ] && %%{__chgrp_Rhf} root - -%%install -%%{__rm} -rf $RPM_BUILD_ROOT -%%{__mkdir_p} $RPM_BUILD_ROOT%%{prefix} -cd $RPM_BUILD_ROOT%%{prefix} -%%{__gzip} -dc %%{SOURCE0} | %%{__tar} -xvvf - -STATUS=$? -if [ $STATUS -ne 0 ]; then - exit $STATUS -fi -%%{_fixowner} . -%%{_fixgroup} . -%%{_fixperms} . - -%%clean -%%{__rm} -rf $RPM_BUILD_ROOT - -%%files -%%defattr(-,root,root,-) - -%%changelog -* Thu Dec 06 2012 Grigori Rybkine <Grigori.Rybkine@cern.ch> -- Undefine _enable_debug_packages macro (so as to disable building debuginfo packages) -- Override system __os_install_post macro -- Define _fixowner, _fixgroup macros since they are missing with RPM 4.8.0 and later -- In %%%%install section, do not exit (so as to let RPM run __spec_install_post actions) - diff --git a/ReleaseTests/CMakeLists.txt b/ReleaseTests/CMakeLists.txt deleted file mode 100644 index 47c0786e2d036ffb2267697975852c462b6c0760..0000000000000000000000000000000000000000 --- a/ReleaseTests/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -################################################################################ -# Package: ReleaseTests -################################################################################ - -# Declare the package name: -atlas_subdir( ReleaseTests ) - -# Declare the package's dependencies: -atlas_depends_on_subdirs( PRIVATE - TestPolicy ) - -# Install files from the package: -atlas_install_runtime( test/ReleaseTests_TestConfiguration.xml ) - diff --git a/ReleaseTests/bin/testSelectionXML.py b/ReleaseTests/bin/testSelectionXML.py deleted file mode 100755 index 8e597f71d0dcea4c27c004ac4f6ed6d65c73d860..0000000000000000000000000000000000000000 --- a/ReleaseTests/bin/testSelectionXML.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -import os -import xml.etree.ElementTree as ET -import re -import commands - -# list = commands.getstatusoutput("cmt show packages /afs/cern.ch/work/s/seuster/sel | gawk '{print $3 \"/\" $1}'")[1].split() -list = commands.getstatusoutput("cmt show packages | gawk '{print $3 \"/\" $1}'")[1].split() -# list = os.getenv("CMTPATH").split(':') - -# list = ['/afs/cern.ch/atlas/software/builds/nightlies/devval/AtlasAnalysis/rel_2/Reconstruction/egamma/egammaPhysCalib/egammaPhysCalib/selection.xml'] - -ErrorList = {} -ErrorContent = {} -GUIDList = {} -GUIDListDup = {} - -print "Processing these packages:" -for index, item in enumerate(list): - print index, item - -for path in list: - #print path - from os.path import join, getsize - for root, dirs, files in os.walk(path): - if os.path.exists(root): - for name in files: - path=join(root, name) - if os.path.exists(path) and name=="selection.xml": - #print ("file ", path," size ",getsize(path)) - with open(path, 'r') as content_file: - content = content_file.read() - old="different" - while old != content: - old = content - content = re.sub(r"(class +[a-zA-Z]+ *= *\")([a-zA-Z0-9:_* ,&;]+)<([a-zA-Z0-9:_* ,<&;]+)>([a-zA-Z0-9:_* ,>&;]*)", r"\1\2<\3>\4", content) - #print "TEST" - #print - #print content - - try: - tree = ET.fromstring(content) - #for child in tree: - # print child.tag, child.attrib - for neighbor in tree.findall('./class'): - guid=neighbor.get("id") - clnm=neighbor.get("name") - #print "id: ",clnm,guid - if guid != None: - if guid in GUIDList: - print "Duplicate ! ", guid, " found twice !!" - print " 1. ", GUIDList[guid] - print " 2. ", path, " (", clnm, ")" - GUIDListDup[guid]=path + " (" + clnm + ")" - else: - GUIDList[guid]=path + " (" + clnm + ")" - - except Exception as e: - #print "ERROR: ", type(e) - #print "ERROR: ", e.args - #print "ERROR: ", content - # ErrorList.append(path) - ErrorList[path]=e.args - ErrorContent[path]=content - pass - -if len(ErrorList): - print "Failed reading these selection.xml files:" - for index, item in enumerate(ErrorList): - print index, item, ErrorList[item] - print " Error was : ", ErrorList[item] - print " selection.xml was: " - print ErrorContent[item] -else: - print "All selection.xml files in all packages were read successfully" - -if len(GUIDListDup): - print "Found following Duplicates in selection.xml:" - for index, item in enumerate(GUIDListDup): - print index, item, GUIDListDup[item] - print " also declared in ", GUIDList[item] - -import sys -sys.exit(len(GUIDListDup)) diff --git a/ReleaseTests/test/ReleaseTests_TestConfiguration.xml b/ReleaseTests/test/ReleaseTests_TestConfiguration.xml deleted file mode 100644 index af325748c54eff4bee4c49b522dcc5e1edc27a57..0000000000000000000000000000000000000000 --- a/ReleaseTests/test/ReleaseTests_TestConfiguration.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE unifiedTestConfiguration SYSTEM "http://www.hep.ucl.ac.uk/atlas/AtlasTesting/DTD/unifiedTestConfiguration.dtd"> - -<unifiedTestConfiguration> - - <atn> - <TEST name="ReleaseTests" type="script" suite="Examples"> - <options_atn> - ${ATN_PACKAGE}/bin/testSelectionXML.py - </options_atn> - <timelimit>60</timelimit> - <author>Rolf Seuster</author> - <prescript>rm -f $ATN_WORK_AREA/*</prescript> - <expectations> - <returnValue>0</returnValue> - </expectations> - </TEST> - </atn> - -</unifiedTestConfiguration> diff --git a/docs/doxyfile b/docs/doxyfile index bc54420578d573027d8e0a53bcb3b3bc966af6d5..2c2dca8f56cd3301167ed1e6b4a57104d9205525 100644 --- a/docs/doxyfile +++ b/docs/doxyfile @@ -771,7 +771,7 @@ WARN_LOGFILE = doxygen_warnings.log # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = README.md AtlasGeometryCommon AtlasTest Calorimeter Commission Control DataQuality Database DetectorDescription Event External ForwardDetectors Generators InnerDetector LumiBlock MagneticField MuonSpectrometer PhysicsAnalysis Projects Reconstruction ReleaseTests Simulation TestBeam TestPolicy TileCalorimeter Tools Tracking graphics +INPUT = README.md AtlasGeometryCommon AtlasTest Calorimeter Commission Control DataQuality Database DetectorDescription Event External ForwardDetectors Generators InnerDetector LumiBlock MagneticField MuonSpectrometer PhysicsAnalysis Projects Reconstruction Simulation TestBeam TestPolicy TileCalorimeter Tools Tracking graphics INPUT += Trigger HLT # This tag can be used to specify the character encoding of the source files