diff --git a/.github/verify_header.sh b/.github/verify_header.sh index 42ddc01..d17f64d 100755 --- a/.github/verify_header.sh +++ b/.github/verify_header.sh @@ -5,20 +5,32 @@ # SPDX-License-Identifier: BSD-3-Clause # +# COPYRIGHT_REGEX is lowercase, because the whole line is +# converted to lowercase before test against this regex. +COPYRIGHT_REGEX="(copyright|\(c\))\s*([0-9]{4}(\s*-\s*([0-9]{4}))?)" +LICENSE_REGEX="SPDX-License-Identifier: BSD-3-Clause$" YEAR=$(date +"%Y") -REGEX="Copyright\(c\) [0-9]{4}-([0-9]{4}) |Copyright\(c\) ([0-9]{4}) " -while read -r line; do - if [[ "$line" =~ $REGEX ]]; then - echo ${BASH_REMATCH[0]} - if [[ $YEAR == ${BASH_REMATCH[1]} || $YEAR == ${BASH_REMATCH[2]} ]]; then - echo $1 have appropriate license header - exit 0 - fi - echo $1 have wrong license header year - exit 1 - fi +unset copyright_header license_header + +# Read lines until proper copyright and license headers are found. +while read -r line && [[ ! "$copyright_header" || ! "$license_header" ]]; do + if [[ "${line,,}" =~ $COPYRIGHT_REGEX ]]; then + # If the fourth regex group (from year range) doesn't exist, + # use the second regex group instead (from a single year). + copyright_year=${BASH_REMATCH[4]:-${BASH_REMATCH[2]}} + + if [[ $copyright_year == $YEAR ]]; then + copyright_header="correct_copyright_header_found" + fi + elif [[ "$line" =~ $LICENSE_REGEX ]]; then + license_header="correct_license_header_found" + fi done < "$1" -echo $1 does not contain appropriate license header +# Proper copyright and license info were found - all good. +[[ "$copyright_header" && "$license_header" ]] && exit 0 + +[[ ! "$copyright_header" ]] && echo >&2 "error: file '$1' does not contain any appropriate copyright info" +[[ ! "$license_header" ]] && echo >&2 "error: file '$1' does not contain appropriate license identifier" exit 1 diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index a34c554..685197b 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -3,9 +3,10 @@ on: pull_request: branches: - master - + env: - EXTENSIONS: "c h cpp py go sh" + EXTENSIONS: "c h cpp py go sh mk spec service" + FILES: "configure configure.d/* *Makefile utils/casctl tools/pckgen.d/deb/debian/rules" jobs: verify-date: runs-on: ubuntu-latest @@ -23,15 +24,16 @@ jobs: files_to_check=(${{ steps.changed-files.outputs.added_files }}) files_to_check+=(${{ steps.changed-files.outputs.modified_files }}) - for FILE in ${files_to_check[@]}; do - REGEX=".*\.(.*)" - if [[ "$FILE" =~ $REGEX ]] - then - EXTENSION=${BASH_REMATCH[1]} - EXTENSIONS_LIST=($EXTENSIONS) - if [[ " ${EXTENSIONS_LIST[*]} " =~ " ${EXTENSION} " ]] - then - .github/verify_header.sh $FILE - fi + for file in ${files_to_check[@]}; do + for file_in_list in $FILES; do + if [[ "$file" == $file_in_list ]]; then + .github/verify_header.sh "$file" + continue 2 + fi + done + + extension=${file##*.} + if [[ "$EXTENSIONS" =~ $extension ]]; then + .github/verify_header.sh "$file" fi done diff --git a/Makefile b/Makefile index 7a6791a..2d0b76a 100644 --- a/Makefile +++ b/Makefile @@ -27,16 +27,16 @@ endif endif archives: - @tools/pckgen $(PWD) tar zip + @tools/pckgen.sh $(PWD) tar zip rpm: - @tools/pckgen $(PWD) rpm --debug + @tools/pckgen.sh $(PWD) rpm --debug srpm: - @tools/pckgen $(PWD) srpm + @tools/pckgen.sh $(PWD) srpm deb: - @tools/pckgen $(PWD) deb --debug + @tools/pckgen.sh $(PWD) deb --debug dsc: - @tools/pckgen $(PWD) dsc + @tools/pckgen.sh $(PWD) dsc diff --git a/configure b/configure index cb7e776..4519d99 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright(c) 2012-2021 Intel Corporation +# Copyright(c) 2012-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # @@ -79,7 +79,7 @@ fi # Run version generator with 'build' flag to # indicate that we are in the build process -(cd tools && ./cas_version_gen build) +(cd tools && ./cas_version_gen.sh build) if [ $? -ne 0 ]; then echo "Error: failed to obtain CAS version" >&2 exit 1 diff --git a/configure.d/1_alloc_disk.conf b/configure.d/1_alloc_disk.conf index 05c9417..ba76ae9 100644 --- a/configure.d/1_alloc_disk.conf +++ b/configure.d/1_alloc_disk.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { diff --git a/configure.d/1_append_bio.conf b/configure.d/1_append_bio.conf index 5b27ae2..8c53463 100644 --- a/configure.d/1_append_bio.conf +++ b/configure.d/1_append_bio.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { diff --git a/configure.d/1_bd_first_part.conf b/configure.d/1_bd_first_part.conf index dde6ef5..b29ebbb 100644 --- a/configure.d/1_bd_first_part.conf +++ b/configure.d/1_bd_first_part.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_bd_part_count.conf b/configure.d/1_bd_part_count.conf index edea2aa..d2f15e0 100644 --- a/configure.d/1_bd_part_count.conf +++ b/configure.d/1_bd_part_count.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_bdev_lookup.conf b/configure.d/1_bdev_lookup.conf index 1867e43..a0d5fa6 100644 --- a/configure.d/1_bdev_lookup.conf +++ b/configure.d/1_bdev_lookup.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_bdev_nr_sectors.conf b/configure.d/1_bdev_nr_sectors.conf index c5d9a27..342e85e 100644 --- a/configure.d/1_bdev_nr_sectors.conf +++ b/configure.d/1_bdev_nr_sectors.conf @@ -1,10 +1,10 @@ #!/bin/bash # -# Copyright(c) 2012-2021 Intel Corporation +# Copyright(c) 2012-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { diff --git a/configure.d/1_bdev_whole.conf b/configure.d/1_bdev_whole.conf index 0443b62..10aba5f 100644 --- a/configure.d/1_bdev_whole.conf +++ b/configure.d/1_bdev_whole.conf @@ -1,10 +1,10 @@ #!/bin/bash # -# Copyright(c) 2012-2021 Intel Corporation +# Copyright(c) 2012-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { diff --git a/configure.d/1_bio_clone.conf b/configure.d/1_bio_clone.conf index d91e296..8d5085e 100644 --- a/configure.d/1_bio_clone.conf +++ b/configure.d/1_bio_clone.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_bio_dev.conf b/configure.d/1_bio_dev.conf index 380de33..60cdb33 100644 --- a/configure.d/1_bio_dev.conf +++ b/configure.d/1_bio_dev.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_bio_discard.conf b/configure.d/1_bio_discard.conf index 53a4b0f..94911f2 100644 --- a/configure.d/1_bio_discard.conf +++ b/configure.d/1_bio_discard.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_bio_err.conf b/configure.d/1_bio_err.conf index e650073..4ece0a1 100644 --- a/configure.d/1_bio_err.conf +++ b/configure.d/1_bio_err.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_bio_flags.conf b/configure.d/1_bio_flags.conf index 5330b24..f727232 100644 --- a/configure.d/1_bio_flags.conf +++ b/configure.d/1_bio_flags.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_bio_gendisk.conf b/configure.d/1_bio_gendisk.conf index e2d44fc..ab2b2ea 100644 --- a/configure.d/1_bio_gendisk.conf +++ b/configure.d/1_bio_gendisk.conf @@ -1,10 +1,10 @@ #!/bin/bash # -# Copyright(c) 2012-2021 Intel Corporation +# Copyright(c) 2012-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_bio_iter.conf b/configure.d/1_bio_iter.conf index de230ec..be16c13 100644 --- a/configure.d/1_bio_iter.conf +++ b/configure.d/1_bio_iter.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_bio_max_vecs.conf b/configure.d/1_bio_max_vecs.conf index 59a0af7..08de2c9 100644 --- a/configure.d/1_bio_max_vecs.conf +++ b/configure.d/1_bio_max_vecs.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_bio_split.conf b/configure.d/1_bio_split.conf index 9f7d95e..3f5a82e 100644 --- a/configure.d/1_bio_split.conf +++ b/configure.d/1_bio_split.conf @@ -1,10 +1,10 @@ #!/bin/bash # -# Copyright(c) 2012-2021 Intel Corporation +# Copyright(c) 2012-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_biovec.conf b/configure.d/1_biovec.conf index ab85e9a..d770c4f 100644 --- a/configure.d/1_biovec.conf +++ b/configure.d/1_biovec.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_blk_end_req.conf b/configure.d/1_blk_end_req.conf index 367edf2..91a22bc 100644 --- a/configure.d/1_blk_end_req.conf +++ b/configure.d/1_blk_end_req.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_blk_mq.conf b/configure.d/1_blk_mq.conf index 6be6a9b..2c7b5ed 100644 --- a/configure.d/1_blk_mq.conf +++ b/configure.d/1_blk_mq.conf @@ -1,10 +1,10 @@ #!/bin/bash # -# Copyright(c) 2012-2021 Intel Corporation +# Copyright(c) 2012-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_blk_queue_exit_workaround_for_rhel.conf b/configure.d/1_blk_queue_exit_workaround_for_rhel.conf index e557613..70a3437 100644 --- a/configure.d/1_blk_queue_exit_workaround_for_rhel.conf +++ b/configure.d/1_blk_queue_exit_workaround_for_rhel.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh # RHEL8.5 kernel 4.18 subversion targeted for the workaround is 348.7.1. # The workaround is needed starting this version and up. diff --git a/configure.d/1_blk_status.conf b/configure.d/1_blk_status.conf index ffac2ae..1efc80b 100644 --- a/configure.d/1_blk_status.conf +++ b/configure.d/1_blk_status.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_deamonize.conf b/configure.d/1_deamonize.conf index 276cc13..9133aa3 100644 --- a/configure.d/1_deamonize.conf +++ b/configure.d/1_deamonize.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_dentry.conf b/configure.d/1_dentry.conf index 45054c7..e25a4ca 100644 --- a/configure.d/1_dentry.conf +++ b/configure.d/1_dentry.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_discard_zeros.conf b/configure.d/1_discard_zeros.conf index 5f4e1b3..a556e56 100644 --- a/configure.d/1_discard_zeros.conf +++ b/configure.d/1_discard_zeros.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_err_no_to_blk_sts.conf b/configure.d/1_err_no_to_blk_sts.conf index 00d9f1d..5388d07 100644 --- a/configure.d/1_err_no_to_blk_sts.conf +++ b/configure.d/1_err_no_to_blk_sts.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_flush_flag.conf b/configure.d/1_flush_flag.conf index 3b50844..02b6244 100644 --- a/configure.d/1_flush_flag.conf +++ b/configure.d/1_flush_flag.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_global_page_state.conf b/configure.d/1_global_page_state.conf index 0d7de85..1584e34 100644 --- a/configure.d/1_global_page_state.conf +++ b/configure.d/1_global_page_state.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_hlist.conf b/configure.d/1_hlist.conf index 24a2d87..a4946b4 100644 --- a/configure.d/1_hlist.conf +++ b/configure.d/1_hlist.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_inode.conf b/configure.d/1_inode.conf index e119adb..e737b3e 100644 --- a/configure.d/1_inode.conf +++ b/configure.d/1_inode.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_kallsyms_on_each_symbol.conf b/configure.d/1_kallsyms_on_each_symbol.conf index 81b51fb..419afd4 100644 --- a/configure.d/1_kallsyms_on_each_symbol.conf +++ b/configure.d/1_kallsyms_on_each_symbol.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_make_request.conf b/configure.d/1_make_request.conf index b61bb43..07fe943 100644 --- a/configure.d/1_make_request.conf +++ b/configure.d/1_make_request.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_module_mutex.conf b/configure.d/1_module_mutex.conf index d8cc307..99efdd9 100644 --- a/configure.d/1_module_mutex.conf +++ b/configure.d/1_module_mutex.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { diff --git a/configure.d/1_mq_flags.conf b/configure.d/1_mq_flags.conf index 9b6e7db..4eb9bf0 100644 --- a/configure.d/1_mq_flags.conf +++ b/configure.d/1_mq_flags.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_munmap.conf b/configure.d/1_munmap.conf index 6bfab08..144826d 100644 --- a/configure.d/1_munmap.conf +++ b/configure.d/1_munmap.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_queue_bounce.conf b/configure.d/1_queue_bounce.conf index 5db3d3d..dc737c1 100644 --- a/configure.d/1_queue_bounce.conf +++ b/configure.d/1_queue_bounce.conf @@ -1,10 +1,10 @@ #!/bin/bash # -# Copyright(c) 2012-2021 Intel Corporation +# Copyright(c) 2012-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_queue_chunk_sectors.conf b/configure.d/1_queue_chunk_sectors.conf index f6edc0e..3da9d7a 100644 --- a/configure.d/1_queue_chunk_sectors.conf +++ b/configure.d/1_queue_chunk_sectors.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_queue_flag_set.conf b/configure.d/1_queue_flag_set.conf index a90c7ee..893c8b5 100644 --- a/configure.d/1_queue_flag_set.conf +++ b/configure.d/1_queue_flag_set.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_queue_limits.conf b/configure.d/1_queue_limits.conf index de59a93..0eb6572 100644 --- a/configure.d/1_queue_limits.conf +++ b/configure.d/1_queue_limits.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh # RHEL 7.3 check() { diff --git a/configure.d/1_queue_lock.conf b/configure.d/1_queue_lock.conf index 494fcb1..37f7722 100644 --- a/configure.d/1_queue_lock.conf +++ b/configure.d/1_queue_lock.conf @@ -1,10 +1,10 @@ #!/bin/bash # -# Copyright(c) 2012-2021 Intel Corporation +# Copyright(c) 2012-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_reread_partitions.conf b/configure.d/1_reread_partitions.conf index 6e2d9a5..a4b645a 100644 --- a/configure.d/1_reread_partitions.conf +++ b/configure.d/1_reread_partitions.conf @@ -1,10 +1,10 @@ #!/bin/bash # -# Copyright(c) 2012-2021 Intel Corporation +# Copyright(c) 2012-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_set_submit_bio.conf b/configure.d/1_set_submit_bio.conf index e9fc739..a358ead 100644 --- a/configure.d/1_set_submit_bio.conf +++ b/configure.d/1_set_submit_bio.conf @@ -1,10 +1,10 @@ #!/bin/bash # -# Copyright(c) 2012-2021 Intel Corporation +# Copyright(c) 2012-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_submit_bio.conf b/configure.d/1_submit_bio.conf index 54627bc..5437330 100644 --- a/configure.d/1_submit_bio.conf +++ b/configure.d/1_submit_bio.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh # submit_bio() can be defined in "bio.h" or in "fs.h" # If it is defind in fs.h, three possibilities are available: diff --git a/configure.d/1_timekeeping.conf b/configure.d/1_timekeeping.conf index 5f68b41..6d55834 100644 --- a/configure.d/1_timekeeping.conf +++ b/configure.d/1_timekeeping.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_vfs_ioctl.conf b/configure.d/1_vfs_ioctl.conf index 1bf6a7e..3401f27 100644 --- a/configure.d/1_vfs_ioctl.conf +++ b/configure.d/1_vfs_ioctl.conf @@ -1,10 +1,10 @@ #!/bin/bash # -# Copyright(c) 2012-2021 Intel Corporation +# Copyright(c) 2012-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_vmalloc.conf b/configure.d/1_vmalloc.conf index 891c667..7241cda 100644 --- a/configure.d/1_vmalloc.conf +++ b/configure.d/1_vmalloc.conf @@ -1,10 +1,10 @@ #!/bin/bash # -# Copyright(c) 2012-2021 Intel Corporation +# Copyright(c) 2012-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_write_flag.conf b/configure.d/1_write_flag.conf index 383ae91..d6ab0eb 100644 --- a/configure.d/1_write_flag.conf +++ b/configure.d/1_write_flag.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/1_wtlh.conf b/configure.d/1_wtlh.conf index c7d43c6..d5b8bf7 100644 --- a/configure.d/1_wtlh.conf +++ b/configure.d/1_wtlh.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/2_bio_barrier.conf b/configure.d/2_bio_barrier.conf index c800ec1..461d658 100644 --- a/configure.d/2_bio_barrier.conf +++ b/configure.d/2_bio_barrier.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/2_bio_cmpl.conf b/configure.d/2_bio_cmpl.conf index d847070..70ff88e 100644 --- a/configure.d/2_bio_cmpl.conf +++ b/configure.d/2_bio_cmpl.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/2_generic_acct.conf b/configure.d/2_generic_acct.conf index f5ecfee..49ca6c7 100644 --- a/configure.d/2_generic_acct.conf +++ b/configure.d/2_generic_acct.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/2_queue_write.conf b/configure.d/2_queue_write.conf index 6d17998..d7a29c9 100644 --- a/configure.d/2_queue_write.conf +++ b/configure.d/2_queue_write.conf @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -. $(dirname $3)/conf_framework +. $(dirname $3)/conf_framework.sh check() { cur_name=$(basename $2) diff --git a/configure.d/conf_framework b/configure.d/conf_framework.sh similarity index 100% rename from configure.d/conf_framework rename to configure.d/conf_framework.sh diff --git a/doc/reqparse b/doc/reqparse.py similarity index 100% rename from doc/reqparse rename to doc/reqparse.py diff --git a/test/functional/tests/misc/test_files_permissions.py b/test/functional/tests/misc/test_files_permissions.py index 96668c8..632f14a 100644 --- a/test/functional/tests/misc/test_files_permissions.py +++ b/test/functional/tests/misc/test_files_permissions.py @@ -14,12 +14,7 @@ from api.cas.installer import ( rsync_opencas_sources, ) from core.test_run import TestRun -from test_tools.fs_utils import ( - FilesPermissions, - find_all_files, - find_all_dirs, - find_all_items, -) +from test_tools.fs_utils import FilesPermissions, find_all_items repo_files_perms_exceptions = { @@ -61,8 +56,8 @@ repo_files_perms_exceptions = { "test/smoke_test/run_tests": 755, "test/smoke_test/write_back/01": 755, "test/smoke_test/write_back/02": 755, - "tools/cas_version_gen": 755, - "tools/pckgen": 755, + "tools/cas_version_gen.sh": 755, + "tools/pckgen.sh": 755, "tools/pckgen.d/deb/debian/rules": 755, "tools/version2sha": 755, "utils/casctl": 755, diff --git a/tools/cas_version_gen b/tools/cas_version_gen.sh similarity index 100% rename from tools/cas_version_gen rename to tools/cas_version_gen.sh diff --git a/tools/pckgen.d/deb/debian/CAS_NAME-modules.install b/tools/pckgen.d/deb/debian/CAS_NAME-modules.install index 5f2b1d8..5c986d7 100644 --- a/tools/pckgen.d/deb/debian/CAS_NAME-modules.install +++ b/tools/pckgen.d/deb/debian/CAS_NAME-modules.install @@ -2,7 +2,7 @@ ./modules/* usr/src/-modules-/modules/ ./ocf/* usr/src/-modules-/ocf/ ./utils/* usr/src/-modules-/utils/ -./tools/cas_version_gen usr/src/-modules-/tools/ +./tools/cas_version_gen.sh usr/src/-modules-/tools/ ./tools/helpers.mk usr/src/-modules-/tools/ ./configure.d/* usr/src/-modules-/configure.d/ ./configure usr/src/-modules-/ diff --git a/tools/pckgen.d/deb/debian/changelog b/tools/pckgen.d/deb/debian/changelog index 34c7a94..7e1a509 100644 --- a/tools/pckgen.d/deb/debian/changelog +++ b/tools/pckgen.d/deb/debian/changelog @@ -1,6 +1,6 @@ (-1) trusty; urgency=medium - * pckgen: automated package generation + * pckgen.sh: automated package generation -- diff --git a/tools/pckgen.d/deb/debian/copyright b/tools/pckgen.d/deb/debian/copyright index c1dc35c..f48e04b 100644 --- a/tools/pckgen.d/deb/debian/copyright +++ b/tools/pckgen.d/deb/debian/copyright @@ -3,5 +3,5 @@ Upstream-Name: Intel Corporation Source: Files: * -Copyright: 2019-2021 Intel Corporation +Copyright: 2019- Intel Corporation License: diff --git a/tools/pckgen.d/deb/debian/rules b/tools/pckgen.d/deb/debian/rules index eec70ba..f05a27d 100755 --- a/tools/pckgen.d/deb/debian/rules +++ b/tools/pckgen.d/deb/debian/rules @@ -13,7 +13,7 @@ override_dh_auto_configure: override_dh_auto_build: - (cd tools/; ./cas_version_gen build) + (cd tools/; ./cas_version_gen.sh build) override_dh_auto_install: @@ -21,7 +21,7 @@ override_dh_auto_install: (cd utils; make install_files DESTDIR="$(shell pwd)/debian/tmp") # clean and generate version again before installing sources for DKMS make distclean - (cd tools/; ./cas_version_gen) + (cd tools/; ./cas_version_gen.sh) override_dh_dkms: dh_dkms -V $(DEB_VERSION_UPSTREAM) diff --git a/tools/pckgen.d/rpm/CAS_NAME.spec b/tools/pckgen.d/rpm/CAS_NAME.spec index ea3df0d..ed991fb 100644 --- a/tools/pckgen.d/rpm/CAS_NAME.spec +++ b/tools/pckgen.d/rpm/CAS_NAME.spec @@ -137,7 +137,7 @@ fi /etc/dracut.conf.d/opencas.conf /var/lib/opencas/cas_version /lib/opencas/casctl -/lib/opencas/open-cas-loader +/lib/opencas/open-cas-loader.py /lib/opencas/opencas.py /lib/udev/rules.d/60-persistent-storage-cas-load.rules /lib/udev/rules.d/60-persistent-storage-cas.rules diff --git a/tools/pckgen b/tools/pckgen.sh similarity index 99% rename from tools/pckgen rename to tools/pckgen.sh index 518c511..84b15c2 100755 --- a/tools/pckgen +++ b/tools/pckgen.sh @@ -354,6 +354,7 @@ deb_control_files_prepare() { sed -i "s//${CAS_GIT//\//\\/}/g" "$file" sed -i "s//$PACKAGE_MAINTAINER/g" "$file" sed -i "s//$PACKAGE_DATE/g" "$file" + sed -i "s//$(date +%Y)/g" "$file" done if [ "$DEBUG" ]; then @@ -545,7 +546,7 @@ DEB_BUILD_DIR="$TEMP_DIR/debuild" # Version file location: VERSION_FILE="$SOURCES_DIR/.metadata/cas_version" # CAS version generator location: -CAS_VERSION_GEN="$SOURCES_DIR/tools/cas_version_gen" +CAS_VERSION_GEN="$SOURCES_DIR/tools/cas_version_gen.sh" check_version diff --git a/tools/version2sha b/tools/version2sha.sh similarity index 100% rename from tools/version2sha rename to tools/version2sha.sh diff --git a/utils/60-persistent-storage-cas-load.rules b/utils/60-persistent-storage-cas-load.rules index 126d313..e1c15a2 100644 --- a/utils/60-persistent-storage-cas-load.rules +++ b/utils/60-persistent-storage-cas-load.rules @@ -1,6 +1,6 @@ ACTION=="remove", GOTO="cas_loader_end" SUBSYSTEM!="block", GOTO="cas_loader_end" -RUN+="/lib/opencas/open-cas-loader /dev/$name" +RUN+="/lib/opencas/open-cas-loader.py /dev/$name" LABEL="cas_loader_end" diff --git a/utils/Makefile b/utils/Makefile index 9def0c2..5a36c1b 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -41,7 +41,7 @@ install_files: @install -m 644 -D opencas.py $(DESTDIR)$(CASCTL_DIR)/opencas.py @install -m 755 -D casctl $(DESTDIR)$(CASCTL_DIR)/casctl - @install -m 755 -D open-cas-loader $(DESTDIR)$(CASCTL_DIR)/open-cas-loader + @install -m 755 -D open-cas-loader.py $(DESTDIR)$(CASCTL_DIR)/open-cas-loader.py @install -m 644 -D etc/dracut.conf.d/opencas.conf $(DESTDIR)/etc/dracut.conf.d/opencas.conf @@ -70,7 +70,7 @@ uninstall: $(call remove-file,$(DESTDIR)$(CASCTL_DIR)/opencas.py) $(call remove-file,$(DESTDIR)$(CASCTL_DIR)/casctl) - $(call remove-file,$(DESTDIR)$(CASCTL_DIR)/open-cas-loader) + $(call remove-file,$(DESTDIR)$(CASCTL_DIR)/open-cas-loader.py) $(call remove-directory,$(DESTDIR)$(CASCTL_DIR)) $(call remove-file,$(DESTDIR)/etc/dracut.conf.d/opencas.conf) diff --git a/utils/open-cas-loader b/utils/open-cas-loader.py similarity index 100% rename from utils/open-cas-loader rename to utils/open-cas-loader.py