This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[CT-NG:patch 07/19] Adapt CTPatch function to handle dash in package name


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]