diff options
author | SangYoun Kwak <sy.kwak@samsung.com> | 2024-05-21 21:39:13 +0900 |
---|---|---|
committer | SangYoun Kwak <sy.kwak@samsung.com> | 2024-05-21 21:39:13 +0900 |
commit | 9a759de15caf247a9ec163f16a03b8ffda57c4f7 (patch) | |
tree | b91fb426d56c59196b6f76b51a662216e0fe7620 | |
parent | 8e7b38a953b2b7022377fa060aabe966ef3a5272 (diff) | |
download | rootstrap-9a759de15caf247a9ec163f16a03b8ffda57c4f7.tar.gz rootstrap-9a759de15caf247a9ec163f16a03b8ffda57c4f7.tar.bz2 rootstrap-9a759de15caf247a9ec163f16a03b8ffda57c4f7.zip |
Modify script to include only necessary .pc file
Previously, rootstrap generation script copied every .pc files in the
pkgconfig path but it is not valid since there are some packages which
installed by dependencies. Those packages should not be included in the
.pc file, so the script is modified to copy .pc files which are in the
necessary packages.
Change-Id: Ifb9baa2541e00500341930618fa58c2abdd788d4
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
-rwxr-xr-x | script/rootstrap_gen_1.0.sh | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/script/rootstrap_gen_1.0.sh b/script/rootstrap_gen_1.0.sh index a5f002f..226ed60 100755 --- a/script/rootstrap_gen_1.0.sh +++ b/script/rootstrap_gen_1.0.sh @@ -193,6 +193,7 @@ function copy_header_and_so() if [[ "${ALL}" == "*" ]] || [[ "${INTERNAL}" == true ]]; then log "ALL(*) and internal is not supported" + return 1 else log "+ copy necessary files .." for i in $(xmlstarlet sel -t -m "//necessary/file" -o "." -v "text()" -o " " -n ${xml_file}); do @@ -216,27 +217,32 @@ function copy_header_and_so() log "Error Occurred Copy file .... " 1>&2 exit $ERROR_NOT_EXIST_FILE fi + + return 0 } function copy_package_config() { local src_dir=$1 local dest_dir=$2 + local xml_file=$3 log "***************** $FUNCNAME *****************" log "+ source directory : ${src_dir}" log "+ destination dierctory : ${dest_dir}" + log "+ xml source file : ${xml_file}" - if [[ ! -d "${src_dir}/usr/lib/pkgconfig" ]]; then - log "+ no pkgconfig directory(${src_dir}/usr/lib/pkgconfig)" + local pc_fname="$(xmlstarlet sel -t -v '//rootstrap/@name' ${item}).pc" + local src_pc_file_path="${src_dir}/usr/lib/pkgconfig/${pc_fname}" + local dest_pc_path="${dest_dir}/usr/lib/pkgconfig" + + if [[ ! -f "${src_pc_file_path}" ]]; then + log "+ no pkgconfig file(${src_pc_file_path})" return 1 fi - cd ${src_dir} - local dest_path="${dest_dir}/usr/lib/pkgconfig" - mkdir -p ${dest_path} - cp -P -R ./usr/lib/pkgconfig/* "${dest_path}" - cd - + mkdir -p ${dest_pc_path} + cp -P "${src_pc_file_path}" "${dest_pc_path}/." } function check_prerequisite() @@ -417,11 +423,16 @@ do #copy only header & so to dest copy_header_and_so ${BUILD_REQUIRED_INSTALLED_PATH} ${GBS_BUILDROOT} ${item} + if [[ $? -ne 0 ]]; then + echo "Failed to copy_header_and_so for ${item}, skip." + continue + fi + + copy_package_config ${BUILD_REQUIRED_INSTALLED_PATH} ${GBS_BUILDROOT} ${item} #get build option from xml #get_build_option $item done #finish copy header & library -copy_package_config ${BUILD_REQUIRED_INSTALLED_PATH} ${GBS_BUILDROOT} ################################################################## #postlink for delete needed field from Library |