public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: Remy Bohmer <linux@bohmer.net>
To: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Cc: "Bart vdr. Meulen" <bartvdrmeulen@gmail.com>, crossgcc@sourceware.org
Subject: [CT-NG:patch 07/19] Adapt CTPatch function to handle dash in  package name
Date: Fri, 09 Apr 2010 19:33:00 -0000	[thread overview]
Message-ID: <4bbf8104.0f67f10a.695a.64e5@mx.google.com> (raw)
In-Reply-To: <20100409190419.325379428@bohmer.net>

[-- Attachment #1: adept-CTPatch-to-handle-dash-in-pacakge.patch --]
[-- Type: text/plain, Size: 1598 bytes --]

Some packages have a dash ('-') in their package name, other
packages have a dash in their version number. In order to handle this
first look for a patch directory split on the last dash, in not found
check for a patch direcory split on the fist dash.

TODO:
Handle package with dash both in package and version number.

Signed-off-by: Bart vdr. Meulen <bartvdrmeulen@gmail.com>
---
 scripts/functions |   10 ++++++++++
 1 file changed, 10 insertions(+)

Index: crosstool-ng/scripts/functions
===================================================================
--- crosstool-ng.orig/scripts/functions
+++ crosstool-ng/scripts/functions
@@ -754,6 +754,16 @@ CT_Patch() {
     bundled_patch_dir="${CT_LIB_DIR}/patches/${base_file}/${ver_file}"
     local_patch_dir="${CT_LOCAL_PATCH_DIR}/${base_file}/${ver_file}"
 
+    if [ ! -d ${bundled_patch_dir} -a ! -d ${local_patch_dir} ]; then
+        #"${basename%%-*}" return incorrect base-file when package name contains '-'
+        #"${basename%-*}" return incorrect base-file when version contains '-'
+        #so first try first method, and if no dirs exists set to alternative
+        base_file="${basename%-*}"
+        ver_file="${basename##*-}"
+        bundled_patch_dir="${CT_LIB_DIR}/patches/${base_file}/${ver_file}"
+        local_patch_dir="${CT_CUSTOM_PATCH_DIR}/${base_file}/${ver_file}"
+    fi
+
     case "${CT_PATCH_ORDER}" in
         bundled)        patch_dirs=("${bundled_patch_dir}");;
         local)          patch_dirs=("${local_patch_dir}");;

-- 


--
For unsubscribe information see http://sourceware.org/lists.html#faq

  parent reply	other threads:[~2010-04-09 19:33 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100409190419.325379428@bohmer.net>
2010-04-09 19:33 ` [CT-NG:patch 09/19] Allow choice for elf format when building bare metal cross compiler Remy Bohmer
2010-04-11 14:47   ` Yann E. MORIN
2010-04-09 19:33 ` [CT-NG:patch 06/19] Update CT_DoSaveState and CT_DoRestoreState to check for existence Remy Bohmer
2010-04-11 13:59   ` Yann E. MORIN
2010-04-12 12:28     ` Bart van der Meulen
2010-04-12 15:12       ` Arnaud Lacombe
2010-04-12 20:43         ` Yann E. MORIN
2010-04-12 20:42       ` Yann E. MORIN
2010-04-09 19:33 ` [CT-NG:patch 13/19] Add Linux - Mingw32 sample Remy Bohmer
2010-04-09 19:33 ` [CT-NG:patch 10/19] Add ARCH_CPU for m68k architecture Remy Bohmer
2010-04-11 15:03   ` Yann E. MORIN
2010-04-09 19:33 ` [CT-NG:patch 03/19] Build candian baremetal compiler Remy Bohmer
2010-04-11 13:40   ` Yann E. MORIN
     [not found]     ` <i2l87271a2c1004120533g10be9d4ge8c5d8bdb69742f8@mail.gmail.com>
2010-04-12 12:35       ` Bart van der Meulen
2010-04-09 19:33 ` [CT-NG:patch 11/19] Add mingw as kernel type Remy Bohmer
2010-04-11 15:25   ` Yann E. MORIN
2010-04-09 19:33 ` [CT-NG:patch 05/19] Force autoreconf for mpfr Remy Bohmer
2010-04-11 13:56   ` Yann E. MORIN
2010-04-12 22:24   ` Yann E. MORIN
2010-04-09 19:33 ` [CT-NG:patch 01/19] Add option to not install the wrapper scripts Remy Bohmer
2010-04-09 22:25   ` Arnaud Lacombe
2010-04-11 13:20   ` Yann E. MORIN
2010-04-09 19:33 ` [CT-NG:patch 12/19] Add mingw target libraries Remy Bohmer
2010-04-11 15:45   ` Yann E. MORIN
2010-04-11 16:10     ` Arnaud Lacombe
2010-04-09 19:33 ` [CT-NG:patch 04/19] Update check for need of g++ Remy Bohmer
2010-04-11 13:43   ` Yann E. MORIN
2010-04-09 19:33 ` [CT-NG:patch 16/19] Fix PPL build for MINGW Remy Bohmer
2010-04-09 19:33 ` Remy Bohmer [this message]
2010-04-11 14:06   ` [CT-NG:patch 07/19] Adapt CTPatch function to handle dash in package name Yann E. MORIN
2010-04-09 19:33 ` [CT-NG:patch 02/19] Symlink to cc not always installed correctly Remy Bohmer
2010-04-11 13:26   ` Yann E. MORIN
2010-04-09 19:34 ` [CT-NG:patch 15/19] First setup for cygwin as target Remy Bohmer
2010-04-11 20:30   ` Yann E. MORIN
2010-04-12 12:44     ` Bart van der Meulen
2010-04-09 19:34 ` [CT-NG:patch 18/19] Fix wrong host compiler usage on canadian build with baremetal target Remy Bohmer
2010-04-09 19:34 ` [CT-NG:patch 17/19] Fix linking of PPL (it does not link with stdc++ automaticly) Remy Bohmer
2010-04-09 19:34 ` [CT-NG:patch 19/19] The m68k processor does not like unaligned access in memcpy Remy Bohmer
2010-04-12 20:56   ` Yann E. MORIN
2010-04-09 19:34 ` [CT-NG:patch 08/19] Prevent trailing - in CT_TARGET Remy Bohmer
2010-04-11 14:11   ` Yann E. MORIN
2010-04-09 19:34 ` [CT-NG:patch 14/19] add bugurl and compiler version to core gcc compiler Remy Bohmer
2010-04-11 15:50   ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4bbf8104.0f67f10a.695a.64e5@mx.google.com \
    --to=linux@bohmer.net \
    --cc=bartvdrmeulen@gmail.com \
    --cc=crossgcc@sourceware.org \
    --cc=yann.morin.1998@anciens.enib.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).