commit:     1e51b25dc650f363f1bd284666441d968f0e3e08
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 26 16:21:30 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Fri Jul 26 16:21:30 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=1e51b25d

Make use of new is_gzipped() function

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gen_configkernel.sh | 2 +-
 gen_initramfs.sh    | 2 +-
 gen_package.sh      | 6 ++++--
 genkernel           | 2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/gen_configkernel.sh b/gen_configkernel.sh
index 9a4812f..9a33717 100755
--- a/gen_configkernel.sh
+++ b/gen_configkernel.sh
@@ -132,7 +132,7 @@ config_kernel() {
                print_info 3 "$(get_indent 1)>> Copying '${KERNEL_CONFIG}' to 
'${KERNEL_OUTPUTDIR}/.config' ..."
 
                local message="Failed to copy kernel config file 
'${KERNEL_CONFIG}' to '${KERNEL_OUTPUTDIR}/.config'!"
-               if [[ "$(file --brief --mime-type "${KERNEL_CONFIG}" 
2>/dev/null)" == application/x-gzip ]]
+               if isTrue "$(is_gzipped "${KERNEL_CONFIG}")"
                then
                        # Support --kernel-config=/proc/config.gz, mainly
                        zcat "${KERNEL_CONFIG}" > "${KERNEL_OUTPUTDIR}/.config" 
|| gen_die "${message}"

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index eb3aed7..9a06855 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -1629,7 +1629,7 @@ create_initramfs() {
                local ACTUAL_KERNEL_CONFIG="${KERNEL_CONFIG}"
        fi
 
-       if [[ "$(file --brief --mime-type "${ACTUAL_KERNEL_CONFIG}")" == 
application/x-gzip ]]
+       if isTrue "$(is_gzipped "${ACTUAL_KERNEL_CONFIG}")"
        then
                # Support --kernel-config=/proc/config.gz, mainly
                local CONFGREP=zgrep

diff --git a/gen_package.sh b/gen_package.sh
index ca46a2c..665f101 100755
--- a/gen_package.sh
+++ b/gen_package.sh
@@ -123,7 +123,8 @@ gen_kerncache() {
        cp -aL "${KERNEL_OUTPUTDIR}/.config" 
"${TEMP}/kerncache/config-${ARCH}-${KV}" \
                || gen_die "Could not copy the kernel config 
'${KERNEL_OUTPUTDIR}/.config' for the kernel package!"
 
-       if [[ "$(file --brief --mime-type "${KERNEL_CONFIG}")" == 
application/x-gzip ]]; then
+       if isTrue "$(is_gzipped "${KERNEL_CONFIG}")"
+       then
                # Support --kernel-config=/proc/config.gz, mainly
                zcat "${KERNEL_CONFIG}" > 
"${TEMP}/kerncache/config-${ARCH}-${KV}.orig" \
                        || gen_die "Could not copy the kernel config 
'${KERNEL_CONFIG}' for the kernel package!"
@@ -250,7 +251,8 @@ gen_kerncache_is_valid() {
                                        local test1=$(grep -v "^#" 
"${TEMP}/config-${ARCH}-${KV}" | md5sum | cut -d " " -f 1)
                                fi
 
-                               if [[ "$(file --brief --mime-type 
"${KERNEL_CONFIG}")" == application/x-gzip ]]; then
+                               if isTrue "$(is_gzipped "${KERNEL_CONFIG}")"
+                               then
                                        # Support 
--kernel-config=/proc/config.gz, mainly
                                        local CONFGREP=zgrep
                                else

diff --git a/genkernel b/genkernel
index 0368acd..9625353 100755
--- a/genkernel
+++ b/genkernel
@@ -442,7 +442,7 @@ then
                print_warning 1 '"man genkernel" explains "dozfs" in detail.'
        fi
 
-       if [[ "$(file --brief --mime-type "${KERNEL_CONFIG}")" == 
application/x-gzip ]]
+       if isTrue "$(is_gzipped "${KERNEL_CONFIG}")"
        then
                # Support --kernel-config=/proc/config.gz, mainly
                CONFGREP=zgrep

Reply via email to