From patchwork Thu Oct 11 04:53:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Holsgrove X-Patchwork-Id: 190784 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]) by ozlabs.org (Postfix) with SMTP id 395722C008E for ; Thu, 11 Oct 2012 15:53:53 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sourceware.org; s=default; x=1350536033; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Content-Type:MIME-Version:Content-Transfer-Encoding: Subject:Message-Id:In-Reply-To:References:User-Agent:Date:From: To:Cc:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Subscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=AhVuWGO8Xv5vIqqfpbUYE3RnM/k=; b=poKi8iJNWvhoZuk qkhm4s1UFw4thzp7dpyAcWrZeUAItg/mjfTM8xZVMGBUXaNVerY+ygLTdqFEDjHK ujBAlhjhNo9ZkCRWsXZalHuIGR3k+TV+SCuZxnT22E9FD5wYzDFnRz9GeASha6sp 8eVOhUMaqjI76v/d4M/Mpsp/PEaw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=sourceware.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Content-Type:MIME-Version:Content-Transfer-Encoding:Subject:X-Mercurial-Node:Message-Id:In-Reply-To:References:User-Agent:Date:From:To:Cc:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=sSNSfv9LdyIaVQHWvbk4MCy6vSNQV32C2jsw2PxdoU3jLV1hysYWQKL72CVbbE 8eS/mDrs3NR+e2kb443QL7rfG8NAw/MTQISCIrAX2k4IWs37iokX46hzUx2nJySz 3OsTt1FJSuu65IOOlP93Tm+TL3FIgq6YVyTLGvah++FLQ=; Received: (qmail 822 invoked by alias); 11 Oct 2012 04:53:37 -0000 Received: (qmail 724 invoked by uid 22791); 11 Oct 2012 04:53:35 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-pa0-f41.google.com (HELO mail-pa0-f41.google.com) (209.85.220.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Oct 2012 04:53:25 +0000 Received: by mail-pa0-f41.google.com with SMTP id fa10so1482167pad.0 for ; Wed, 10 Oct 2012 21:53:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:content-type:mime-version:content-transfer-encoding:subject :x-mercurial-node:message-id:in-reply-to:references:user-agent:date :from:to:cc:x-gm-message-state; bh=nmexr3hthqeusVAzlfKyKFG7pKJrT+I7Wa2nPS9ZsDc=; b=nC52hawmdzqd3bR+TZ/evslBHC/k5/wiSxGb2L3i0m8lICK7AASxftzCCczWiYi8ft ReiY/ziNvlONOox1cSb3zmUtD+GaFYI3NL5UiHfbbjyabZbEHrLaeVff4QSX8dmONEGG 3sjGdaTt3hbRG/kTObwLpqrGeSyGu5J+/QgN1FMXBedr7SH06SE+4XR2x8B3jNjfc1jj Dc767U1YZQZDF6VuLGFPwhjLwRhmjViXdR3JBji3KFiSMqFRjpD2G8sEn1JNdEGnXWqK AMN/yvbU5efXu7flVOeG08HznAUph3X5FpEUyEAoB+uFoHynNLIx8FDOCRxfBV3i9enH 8j9g== Received: by 10.68.134.97 with SMTP id pj1mr186193pbb.55.1349931204748; Wed, 10 Oct 2012 21:53:24 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id qb2sm2122996pbb.15.2012.10.10.21.53.22 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Oct 2012 21:53:24 -0700 (PDT) MIME-Version: 1.0 Subject: [PATCH 02 of 13] scripts/functions: add a generic custom location infrastructure X-Mercurial-Node: 131c163c69f9cc81d2beabaa998dca9c9386df38 Message-Id: <131c163c69f9cc81d2be.1349931191@localhost.localdomain> In-Reply-To: References: User-Agent: Mercurial-patchbomb/2.3.1 Date: Thu, 11 Oct 2012 14:53:11 +1000 From: David Holsgrove To: yann.morin.1998@free.fr Cc: crossgcc@sourceware.org X-Gm-Message-State: ALoCoQllhQXj4iPlaqjO+9dxzvvNGXcjKBZAThH0+9/L+1SJ5+CFf2h9NxGGDd0nt//Mmz0Zgl7F X-IsSubscribed: yes 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 # HG changeset patch # User David Holsgrove # Date 1349321174 -36000 # Node ID 131c163c69f9cc81d2beabaa998dca9c9386df38 # Parent 7a666ba8c0ea5e8f4b18f3c34a8a5bbb170f0233 scripts/functions: add a generic custom location infrastructure Add a generic custom location infrastructure (inspired by the one in kernel/linux) to allow the user to use custom tarballs or directories for any component. Signed-off-by: "David Holsgrove" --- For unsubscribe information see http://sourceware.org/lists.html#faq diff -r 7a666ba8c0ea -r 131c163c69f9 scripts/functions --- a/scripts/functions Thu Oct 11 14:37:45 2012 +1000 +++ b/scripts/functions Thu Oct 04 13:26:14 2012 +1000 @@ -516,6 +516,42 @@ return 1 } +# This function gets the custom source from either a tarball or directory +# Usage: CT_GetCustom custom_name +CT_GetCustom() { + local custom_component="$1" + local custom_version="$2" + local custom_location="$3" + local custom_name="${custom_component}-${custom_version}" + + CT_TestAndAbort "${custom_name}: CT_CUSTOM_LOCATION_ROOT_DIR or ${custom_component}'s CUSTOM_LOCATION must be set." \ + -z "${CT_CUSTOM_LOCATION_ROOT_DIR}" -a -z "${custom_location}" + + if [ -n "${CT_CUSTOM_LOCATION_ROOT_DIR}" \ + -a -z "${custom_location}" ]; then + custom_location="${CT_CUSTOM_LOCATION_ROOT_DIR}/${custom_component}" + fi + + if [ ! -d "${custom_location}" ]; then + # We need to know the custom tarball extension, + # so we can create a properly-named symlink, which + # we use later on in 'extract' + case "${custom_location}" in + *.tar.bz2) custom_name="${custom_name}.tar.bz2";; + *.tar.gz|*.tgz) custom_name="${custom_name}.tar.gz";; + *.tar) custom_name="${custom_name}.tar";; + *) CT_Abort "Unknown extension for custom tarball '${custom_location}'";; + esac + CT_DoLog EXTRA "Using '${custom_name}' from local storage" + CT_DoExecLog DEBUG ln -sf "${custom_location}" \ + "${CT_TARBALLS_DIR}/${custom_name}" + else + CT_DoLog EXTRA "Using '${custom_name}' from local storage" + CT_DoExecLog DEBUG ln -snf "${custom_location}" \ + "${CT_SRC_DIR}/${custom_name}" + fi +} + # This function saves the specified to local storage if possible, # and if so, symlinks it for later usage # Usage: CT_SaveLocal