From patchwork Wed Oct 10 06:07:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Holsgrove X-Patchwork-Id: 190550 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 859DE2C0081 for ; Wed, 10 Oct 2012 17:08:25 +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=1350454105; 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=GKuljZvSurLxKqn+C5VpoL6Kb6Q=; b=qy6b+cTC1nMhSnB KG2CkjdSDdv3rZ8DvEdTlZ+oPgD5MU6acFEKhy9jQfhMwVICKSKkNli4aqax7iOZ 4T5Afa6/08F2dfrh1a2HX3VEdLzykPvsV4M7x56zZwA4ZYOGjKVjbnvIhMkB2/lh gwAJsiNJhuCjaM7cqlHar74KdHtc= 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=HAH8ZLXQsUzz9Ups2gOD4cKbW/Mhh/WrpRFxDZb1IEFK5KQ/vM9c1C81KdPW9y 9DZvyPatQwDP6nAv80VxsNA8C+2BvWv1jlKuCdR/SMClXkkV0IQOXpf1/Cl+To6B 8D5NB30YpzxZcNq4rGeNtGoYpJeO4Bjp1UGCDHqd3jaY0=; Received: (qmail 14026 invoked by alias); 10 Oct 2012 06:08:11 -0000 Received: (qmail 13923 invoked by uid 22791); 10 Oct 2012 06:08:08 -0000 X-SWARE-Spam-Status: No, hits=-3.1 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-pb0-f41.google.com (HELO mail-pb0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 10 Oct 2012 06:08:04 +0000 Received: by mail-pb0-f41.google.com with SMTP id rq2so391958pbb.0 for ; Tue, 09 Oct 2012 23:08:04 -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=Xv3UzeJFPBEJ86jkWT1ZVuxZhuLXY/xPcsoK2BxIfr4=; b=MpjBJem/N6v9tyNNcXHl2BnzSsZdiggcHoSr5ZyF9k39Nq9dJQoj8YQE2pNRUyhVvx I1nBovQSnAqXocqN7W/IjLIis58jcvCzsaAXEW6BaQwEUo+CaC2wBolPJr+8JKZgQWil n49fP86E8/pPpN9x2YVS0FBSaF8oHXULKXkWPPDX+0n51XTdwhwDYwb2uz5iLsfUS6sK MqU1lCez4oLseEl4fzv0Ruxes5ms3iC/HsHMI72hNEJnbENnjpG/BsJfZjleQ++MwRnx lfUJE39+3Ll2RpefrXcFg7CjV2cyytQ0FIVAtZN5aYEVgZwI36M+9wtyK9XXz0Q0xT1G KeRQ== Received: by 10.66.75.74 with SMTP id a10mr59642879paw.46.1349849284191; Tue, 09 Oct 2012 23:08:04 -0700 (PDT) Received: from localhost ([124.148.20.9]) by mx.google.com with ESMTPS id qd6sm514589pbb.34.2012.10.09.23.08.01 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Oct 2012 23:08:03 -0700 (PDT) MIME-Version: 1.0 Subject: [PATCH 1 of 6] config+scripts: Extract CUSTOM / CUSTOM_LOCATION currently in linux.sh X-Mercurial-Node: 54e6f8f3b141d3502e51e35cdda8aded03b597f4 Message-Id: <54e6f8f3b141d3502e51.1349849274@localhost.localdomain> In-Reply-To: References: User-Agent: Mercurial-patchbomb/2.3.1 Date: Wed, 10 Oct 2012 16:07:54 +1000 From: David Holsgrove To: bryanhundven@gmail.com, yann.morin.1998@free.fr Cc: crossgcc@sourceware.org X-Gm-Message-State: ALoCoQksb+amhYDqycuqw/9wwCT3m8Yn7Jo/qVrQHhw0OGKebcwhYzAunqhp6PFTPZwllpbpO+OM 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 54e6f8f3b141d3502e51e35cdda8aded03b597f4 # Parent 43ace4bb005eef085437e3d4fbaef528ef0ef005 config+scripts: Extract CUSTOM / CUSTOM_LOCATION currently in linux.sh Generalise in scripts/functions as GetCustom Add CUSTOM_LOCATION_ROOT_DIR to config/paths.in as a root directory which will be used if CUSTOM is selected as version, and no CUSTOM_LOCATION given for a component. --- For unsubscribe information see http://sourceware.org/lists.html#faq diff -r 43ace4bb005e -r 54e6f8f3b141 config/global/paths.in --- a/config/global/paths.in Wed Sep 26 16:37:31 2012 +0200 +++ b/config/global/paths.in Thu Oct 04 13:26:14 2012 +1000 @@ -60,6 +60,15 @@ # The reason you might also want to install elsewhere is if you are going # to package your shinny new toolchain for distribution. + +config CUSTOM_LOCATION_ROOT_DIR + string + depends on EXPERIMENTAL + prompt "directory containing custom source components" + help + This is the path CT-NG will attempt to use as a root for locating + local copies of source components (CUSTOM_LOCATION_ROOT_DIR/component) + config RM_RF_PREFIX_DIR bool prompt "| Remove the prefix dir prior to building" diff -r 43ace4bb005e -r 54e6f8f3b141 scripts/functions --- a/scripts/functions Wed Sep 26 16:37:31 2012 +0200 +++ b/scripts/functions Thu Oct 04 13:26:14 2012 +1000 @@ -516,6 +516,32 @@ return 1 } +# This function gets the custom source from either a tarball or directory +# Usage: CT_GetCustom custom_name +CT_GetCustom() { + local custom_name="$1" + local custom_location="$2" + + 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