From patchwork Sat May 4 11:29:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerzy Grzegorek X-Patchwork-Id: 241443 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 3AA0F2C00D8 for ; Sat, 4 May 2013 21:31:31 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:content-type:mime-version :content-transfer-encoding:subject:message-id:in-reply-to :references:date:from:to:cc; q=dns; s=default; b=wuPFALfxFzS4vOg TB15u9epKy3hFg9+nfVXIvM1yRDWL56GQItxS2DS5tEeb3xiHRzdlWYhziC4NQE1 EtRy52+tACGghU92OBmiXsU4Vp96RS59ODPaodtDhh+SBmsYSDFMCBNB01kfAEqo XOW2iRmVjSiMtUJ2n/N0uGmQP3lU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:content-type:mime-version :content-transfer-encoding:subject:message-id:in-reply-to :references:date:from:to:cc; s=default; bh=7L7lKK30QQlwNBXNqJCWp GtxgKA=; b=KDBKkhE0UBhFRFh1y+z2BOYx3rT5VKF7pdW1s+yhK/DgAVWTJPW3X ZvzcXUM3s08uFLrIQOKR5XAYE99T5IQOEnwGoxelrjAjdrIlBjAiyslC8J9V0HGE K03hiP/IgDiniNAkwGvoHg3D0pmcCptOgFfDYN8tc2V38r+ol4+7w4= Received: (qmail 28148 invoked by alias); 4 May 2013 11:30:55 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Delivered-To: mailing list crossgcc@sourceware.org Received: (qmail 28084 invoked by uid 89); 4 May 2013 11:30:55 -0000 X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.1 Received: from tasak.trzebnica.net (HELO poczta.trzebnica.net) (91.195.232.70) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sat, 04 May 2013 11:30:53 +0000 Received: from [127.0.1.1] (93-181-142-99.internetia.net.pl [93.181.142.99]) by poczta.trzebnica.net (Postfix) with ESMTP id 869AF37FA1; Sat, 4 May 2013 13:30:50 +0200 (CEST) MIME-Version: 1.0 Subject: [PATCH 2 of 2] scripts/functions: change a debug info for custom tarballs X-Mercurial-Node: 40af5e881617b6109c34f1d084bba3041e3c240e Message-Id: <40af5e881617b6109c34.1367666988@NX5000> In-Reply-To: References: User-Agent: Mercurial-patchbomb/2.0.2 Date: Sat, 04 May 2013 13:29:48 +0200 From: Jerzy Grzegorek To: "Yann E. MORIN" Cc: crossgcc@sourceware.org # HG changeset patch # User "Jerzy Grzegorek" # Date 1367665576 -7200 # Node ID 40af5e881617b6109c34f1d084bba3041e3c240e # Parent 722db80eb1f5c5189699ae471a52c78366dccf78 scripts/functions: change a debug info for custom tarballs Signed-off-by: Jerzy Grzegorek --- For unsubscribe information see http://sourceware.org/lists.html#faq diff -r 722db80eb1f5 -r 40af5e881617 scripts/functions --- a/scripts/functions Sat May 04 13:04:29 2013 +0200 +++ b/scripts/functions Sat May 04 13:06:16 2013 +0200 @@ -587,6 +587,25 @@ fi } +# This function checks if we work with custom tarball +# and if yes, changes debug info; for example: +# from linux-3.4 to linux-custom +# Usage: CT_CheckCustom +# or CT_CheckCustom +CT_CheckCustom() { + local basename="$1" + + case "${basename}" in + linux-*) if [ "${CT_KERNEL_LINUX_CUSTOM}" = "y" ]; then + if [ "$#" == 2 ]; then return 1; fi + basename='linux-custom' + fi + ;; + esac + + if [ "$#" == 1 ]; then echo "${basename}"; fi +} + # This function tries to retrieve a tarball form a local directory # Usage: CT_GetLocal [.extension] CT_GetLocal() { @@ -601,15 +620,18 @@ fi if [ -n "${CT_LOCAL_TARBALLS_DIR}" ]; then - CT_DoLog DEBUG "Trying to retrieve an already downloaded copy of '${basename}'" + CT_DoLog DEBUG "Trying to retrieve an already downloaded copy of '$( CT_CheckCustom ${basename} )'" # We'd rather have a bzip2'ed tarball, then gzipped tarball, plain tarball, # or, as a failover, a file without extension. for ext in ${first_ext} $(CT_DoListTarballExt) ''; do CT_DoLog DEBUG "Trying '${CT_LOCAL_TARBALLS_DIR}/${basename}${ext}'" if [ -r "${CT_LOCAL_TARBALLS_DIR}/${basename}${ext}" -a \ "${CT_FORCE_DOWNLOAD}" != "y" ]; then - CT_DoLog DEBUG "Got '${basename}' from local storage" - CT_DoExecLog ALL ln -s "${CT_LOCAL_TARBALLS_DIR}/${basename}${ext}" "${CT_TARBALLS_DIR}/${basename}${ext}" + CT_DoLog DEBUG "Got '$( CT_CheckCustom ${basename} )' from local storage" + # Do not create symlink for custom tarball here + if CT_CheckCustom "${basename}" "check"; then + CT_DoExecLog ALL ln -s "${CT_LOCAL_TARBALLS_DIR}/${basename}${ext}" "${CT_TARBALLS_DIR}/${basename}${ext}" + fi return 0 fi done @@ -645,6 +667,7 @@ *.tar) custom_name="${custom_name}.tar";; *) CT_Abort "Unknown extension for custom tarball '${custom_location}'";; esac + CT_DoLog DEBUG "Already have '${custom_name}'" CT_DoExecLog DEBUG ln -sf "${custom_location}" \ "${CT_TARBALLS_DIR}/${custom_name}" else @@ -661,11 +684,14 @@ local basename="${file##*/}" if [ "${CT_SAVE_TARBALLS}" = "y" ]; then - CT_DoLog EXTRA "Saving '${basename}' to local storage" + CT_DoLog EXTRA "Saving '$( CT_CheckCustom ${basename} )' to local storage" # The file may already exist if downloads are forced: remove it first CT_DoExecLog ALL rm -f "${CT_LOCAL_TARBALLS_DIR}/${basename}" CT_DoExecLog ALL mv -f "${file}" "${CT_LOCAL_TARBALLS_DIR}" - CT_DoExecLog ALL ln -s "${CT_LOCAL_TARBALLS_DIR}/${basename}" "${file}" + # Do not create symlink for custom tarball here + if CT_CheckCustom "${basename}" "check"; then + CT_DoExecLog ALL ln -s "${CT_LOCAL_TARBALLS_DIR}/${basename}" "${file}" + fi fi } @@ -694,12 +720,12 @@ # If not allowed to download from the Internet, don't if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then - CT_DoLog DEBUG "Not allowed to download from the Internet, aborting ${file} download" + CT_DoLog DEBUG "Not allowed to download from the Internet, aborting '$( CT_CheckCustom ${file} )' download" return 1 fi # Try to retrieve the file - CT_DoLog EXTRA "Retrieving '${file}'" + CT_DoLog EXTRA "Retrieving '$( CT_CheckCustom ${file} )'" # Add URLs on the LAN mirror if [ "${CT_USE_MIRROR}" = "y" ]; then @@ -722,7 +748,7 @@ CT_DoLog DEBUG "Trying '${url}/${file}${ext}'" CT_DoGetFile "${url}/${file}${ext}" if [ -f "${CT_TARBALLS_DIR}/${file}${ext}" ]; then - CT_DoLog DEBUG "Got '${file}' from the Internet" + CT_DoLog DEBUG "Got '$( CT_CheckCustom ${file} )' from the Internet" CT_SaveLocal "${CT_TARBALLS_DIR}/${file}${ext}" return 0 fi