From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DF241138334 for ; Tue, 26 Mar 2019 12:38:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 06DC2E086F; Tue, 26 Mar 2019 12:38:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B78B6E086F for ; Tue, 26 Mar 2019 12:38:33 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C7D3F335C16 for ; Tue, 26 Mar 2019 12:38:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3DCAE57D for ; Tue, 26 Mar 2019 12:38:29 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1553597977.d333608c9489abfff00eb65cf7c072927b2b32e1.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_package.sh X-VCS-Directories: / X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: d333608c9489abfff00eb65cf7c072927b2b32e1 X-VCS-Branch: master Date: Tue, 26 Mar 2019 12:38:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4e3473e7-27d6-41dc-9fbe-375b1c033fa3 X-Archives-Hash: 4c4cac50dd443c28b0cd52e1575e1534 commit: d333608c9489abfff00eb65cf7c072927b2b32e1 Author: Thomas Deutschmann gentoo org> AuthorDate: Tue Mar 26 10:59:37 2019 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Tue Mar 26 10:59:37 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=d333608c gen_package.sh: delete temp files only when DEBUGCLEANUP is not set Signed-off-by: Thomas Deutschmann gentoo.org> gen_package.sh | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/gen_package.sh b/gen_package.sh index bd137ad..d8ffac0 100755 --- a/gen_package.sh +++ b/gen_package.sh @@ -2,7 +2,8 @@ # $Id$ gen_minkernpackage() { - print_info 1 'Creating minimal kernel package' + print_info 1 '' + print_info 1 "Creating minimal kernel package in '${MINKERNPACKAGE}'..." rm -rf "${TEMP}/minkernpackage" > /dev/null 2>&1 mkdir "${TEMP}/minkernpackage" || gen_die 'Could not make a directory for the kernel package!' if [ "${KERNCACHE}" != "" ] @@ -17,7 +18,7 @@ gen_minkernpackage() { mv minkernpackage/{kernelz-${ARCH}-${KV},kernelz-${KNAME}-${ARCH}-${KV}} fi if [ ! -f minkernpackage/kernel-${KNAME}-${ARCH}-${KV} \ - -o ! -f minkernpackage/config-${KNAME}-${ARCH}-${KV} ]; + -o ! -f minkernpackage/config-${KNAME}-${ARCH}-${KV} ]; then gen_die "Cannot locate kernel binary" fi @@ -53,31 +54,37 @@ gen_minkernpackage() { cd "${TEMP}/minkernpackage" /bin/tar -jcpf ${MINKERNPACKAGE} * || gen_die 'Could not compress the kernel package!' - print_info 3 "Created minimal kernel package: $(readlink -f ${MINKERNPACKAGE})" - cd "${TEMP}" && rm -rf "${TEMP}/minkernpackage" > /dev/null 2>&1 + + cd "${TEMP}" + isTrue "${CMD_DEBUGCLEANUP}" && rm -rf "${TEMP}/minkernpackage" > /dev/null + return 0 } gen_modulespackage() { - print_info 1 'Creating modules package' + print_info 1 '' + print_info 1 "Creating modules package in '${MODULESPACKAGE}'..." rm -rf "${TEMP}/modulespackage" > /dev/null 2>&1 mkdir "${TEMP}/modulespackage" || gen_die 'Could not make a directory for the kernel package!' if [ -d ${INSTALL_MOD_PATH}/lib/modules/${KV} ] then - mkdir -p ${TEMP}/modulespackage/lib/modules - cp -r "${INSTALL_MOD_PATH}/lib/modules/${KV}" "${TEMP}/modulespackage/lib/modules" - cd "${TEMP}/modulespackage" - /bin/tar -jcpf ${MODULESPACKAGE} * || gen_die 'Could not compress the modules package!' + mkdir -p ${TEMP}/modulespackage/lib/modules + cp -r "${INSTALL_MOD_PATH}/lib/modules/${KV}" "${TEMP}/modulespackage/lib/modules" + cd "${TEMP}/modulespackage" + /bin/tar -jcpf ${MODULESPACKAGE} * || gen_die 'Could not compress the modules package!' else - print_info 1 "Could not create a modules package ${INSTALL_MOD_PATH}/lib/modules/${KV} was not found" + print_info 1 "Could not create modules package, '${INSTALL_MOD_PATH}/lib/modules/${KV}' was not found" fi - print_info 3 "Created modules package: $(readlink -f ${MODULESPACKAGE})" - cd "${TEMP}" && rm -rf "${TEMP}/modulespackage" > /dev/null 2>&1 + + cd "${TEMP}" + isTrue "${CMD_DEBUGCLEANUP}" && rm -rf "${TEMP}/modulespackage" > /dev/null + return 0 } gen_kerncache() { - print_info 1 'Creating kernel cache' + print_info 1 '' + print_info 1 "Creating kernel cache in '${KERNCACHE}'..." rm -rf "${TEMP}/kerncache" > /dev/null 2>&1 mkdir "${TEMP}/kerncache" || gen_die 'Could not make a directory for the kernel cache!' @@ -118,8 +125,10 @@ gen_kerncache() cd "${TEMP}/kerncache" /bin/tar -jcpf ${KERNCACHE} * || gen_die 'Could not compress the kernel package!' - print_info 3 "Created kernel cache: $(readlink -f ${KERNCACHE})" - cd "${TEMP}" && rm -rf "${TEMP}/kerncache" > /dev/null 2>&1 + + cd "${TEMP}" + isTrue "${CMD_DEBUGCLEANUP}" && rm -rf "${TEMP}/kerncache" > /dev/null + return 0 } gen_kerncache_extract_kernel()