diff --git a/lib.sh b/lib.sh index edaee4b..6cd762f 100644 --- a/lib.sh +++ b/lib.sh @@ -388,15 +388,15 @@ kernel_version_full() { } -# Returns the full kernel version. If $1 is "3.14-1" then kernel_version_full returns "3.14.0_1". -kernel_version_full_no_hyphen() { +# Returns the pkg kernel version. If $1 is "3.14-1" then kernel_version_full returns "3.14_1". +kernel_version_no_hyphen() { # $1: The full kernel version # returns: output is printed to stdout - echo $(kernel_version_full ${1} | sed s/-/./g) + echo ${1} | sed s/-/./g } reset_variables() { - kernel_version_full_pkgver="" + kernel_version_pkgver="" kernel_version_full="" kernel_version="" zfs_pkgver="" @@ -844,7 +844,7 @@ git_calc_pkgver() { for repo in "spl" "zfs"; do msg2 "Cloning working copy for ${repo}" local sha=${spl_git_commit} - local kernvers=${kernel_version_full_pkgver} + local kernvers=${kernel_version_pkgver} if [[ ${repo} =~ ^zfs ]]; then sha=${zfs_git_commit} fi diff --git a/repo.sh b/repo.sh index bd88e78..84b83be 100755 --- a/repo.sh +++ b/repo.sh @@ -156,9 +156,9 @@ repo_package_list() { # Get packages from the backup directory path="packages/${kernel_name}/${pkg_list_find}/" - if [[ ! -z ${kernel_version_full_pkgver} ]]; then - debug "kernel_version_full_pkgver: ${kernel_version_full_pkgver}" - fcmd="find ${path} -iname '*${kernel_version_full_pkgver}-${spl_pkgrel}*.pkg.tar.xz' -o -iname '*${kernel_version_full_pkgver}-${zfs_pkgrel}*.pkg.tar.xz' " + if [[ ! -z ${kernel_version_pkgver} ]]; then + debug "kernel_version_pkgver: ${kernel_version_pkgver}" + fcmd="find ${path} -iname '*${kernel_version_pkgver}-${spl_pkgrel}*.pkg.tar.xz' -o -iname '*${kernel_version_pkgver}-${zfs_pkgrel}*.pkg.tar.xz' " run_cmd_no_output_no_dry_run "${fcmd}" for pkg in ${run_cmd_output}; do pkgs+=(${pkg}) @@ -171,7 +171,7 @@ repo_package_list() { pkgs+=(${pkg}) done else - debug "kernel_version_full_pkgver and spl_pkgver (and zfs_pkgver) not set!" + debug "kernel_version_pkgver and spl_pkgver (and zfs_pkgver) not set!" debug "Falling back to newest package by mod time for zfs and spl" for z in $(printf '%s ' ${pkg_list[@]} ); do # fcmd="find ${path} -iname '*${kernel_name}*-${spl_pkgrel}*.pkg.tar.xz' -o -iname '*${zfs_pkgver}-${zfs_pkgrel}*.pkg.tar.xz' " @@ -195,12 +195,12 @@ repo_package_list() { # Version match check: arch: x86_64 name: spl-utils-linux-git vers: 0.7.0_rc1_r0_g4fd75d3_4.7.2_1-4 vers_match: 0.6.5.8.*4.7.2_1-4 debug "spl_pkgver: ${spl_pkgver}" debug "zfs_pkgver: ${zfs_pkgver}" - debug "kernel_version_full_pkgver: ${kernel_version_full_pkgver}" + debug "kernel_version_pkgver: ${kernel_version_pkgver}" kernvers="" # append kernel version if set - if [ ! -z "${kernel_version_full_pkgver}" ]; then - kernvers="_${kernel_version_full_pkgver}"; + if [ ! -z "${kernel_version_pkgver}" ]; then + kernvers="_${kernel_version_pkgver}"; fi if [[ ${pkg} =~ .*spl-.* ]]; then diff --git a/src/kernels/archiso.sh b/src/kernels/archiso.sh index 58eee80..fed5651 100644 --- a/src/kernels/archiso.sh +++ b/src/kernels/archiso.sh @@ -34,7 +34,7 @@ update_archiso_linux_pkgbuilds() { pkg_list=("spl-archiso-linux" "zfs-archiso-linux") kernel_version_full=$(kernel_version_full ${kernel_version}) - kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version}) + kernel_version_pkgver=$(kernel_version_no_hyphen ${kernel_version}) kernel_version_major=${kernel_version%-*} kernel_mod_path="${kernel_version_full/.arch/-arch}-ARCH" archzfs_package_group="archzfs-archiso-linux" diff --git a/src/kernels/linux-hardened.sh b/src/kernels/linux-hardened.sh index 0b5a292..3eca524 100644 --- a/src/kernels/linux-hardened.sh +++ b/src/kernels/linux-hardened.sh @@ -39,7 +39,7 @@ get_kernel_options() { fi kernel_version=${webpage_output} kernel_version_full=$(kernel_version_full ${kernel_version}) - kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version}) + kernel_version_pkgver=$(kernel_version_no_hyphen ${kernel_version}) kernel_version_major=${kernel_version%-*} kernel_mod_path="${kernel_version_full}-hardened" linux_depends="\"linux-hardened=\${_kernelver}\"" diff --git a/src/kernels/linux-lts.sh b/src/kernels/linux-lts.sh index 0a6a0e6..020c963 100644 --- a/src/kernels/linux-lts.sh +++ b/src/kernels/linux-lts.sh @@ -42,7 +42,7 @@ get_kernel_options() { fi kernel_version=${webpage_output} kernel_version_full=$(kernel_version_full ${kernel_version}) - kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version}) + kernel_version_pkgver=$(kernel_version_no_hyphen ${kernel_version}) kernel_version_major=${kernel_version%-*} kernel_mod_path="${kernel_version_full}-lts" linux_depends="\"linux-lts=\${_kernelver}\"" diff --git a/src/kernels/linux-vfio.sh b/src/kernels/linux-vfio.sh index 5f89073..d57c1be 100644 --- a/src/kernels/linux-vfio.sh +++ b/src/kernels/linux-vfio.sh @@ -39,7 +39,7 @@ get_kernel_options() { fi kernel_version=${regex_match} kernel_version_full=$(kernel_version_full ${kernel_version}) - kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version}) + kernel_version_pkgver=$(kernel_version_no_hyphen ${kernel_version}) kernel_version_major=${kernel_version%-*} kernel_mod_path="${kernel_version_full/.arch/-arch}-vfio" linux_depends="\"linux-vfio=\${_kernelver}\"" diff --git a/src/kernels/linux-zen.sh b/src/kernels/linux-zen.sh index 541813c..c5147bb 100644 --- a/src/kernels/linux-zen.sh +++ b/src/kernels/linux-zen.sh @@ -39,7 +39,7 @@ get_kernel_options() { fi kernel_version=${webpage_output} kernel_version_full=$(kernel_version_full ${kernel_version}) - kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version}) + kernel_version_pkgver=$(kernel_version_no_hyphen ${kernel_version}) kernel_version_major=${kernel_version%-*} kernel_mod_path="${kernel_version_full/.zen/-zen}-zen" linux_depends="\"linux-zen=\${_kernelver}\"" diff --git a/src/kernels/linux.sh b/src/kernels/linux.sh index d649dc1..7bab68e 100644 --- a/src/kernels/linux.sh +++ b/src/kernels/linux.sh @@ -42,7 +42,7 @@ get_kernel_options() { fi kernel_version=${webpage_output} kernel_version_full=$(kernel_version_full ${kernel_version}) - kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version}) + kernel_version_pkgver=$(kernel_version_no_hyphen ${kernel_version}) kernel_version_major=${kernel_version%-*} kernel_mod_path="${kernel_version_full/.arch/-arch}-ARCH" linux_depends="\"linux=\${_kernelver}\""