scripts/functions: make CT_Patch dumber
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Apr 11 23:18:10 2010 +0200 (2010-04-11)
changeset 1901bdb3a98e064b
parent 1900 835379d47869
child 1902 faade25219ed
scripts/functions: make CT_Patch dumber

It is the responsibility of the caller to split the package name from
its version. It already knows that.
scripts/build/binutils/binutils.sh
scripts/build/binutils/elf2flt.sh
scripts/build/cc/gcc.sh
scripts/build/companion_libs/cloog.sh
scripts/build/companion_libs/gmp.sh
scripts/build/companion_libs/libelf.sh
scripts/build/companion_libs/mpc.sh
scripts/build/companion_libs/mpfr.sh
scripts/build/companion_libs/ppl.sh
scripts/build/companion_tools/100-m4.sh
scripts/build/companion_tools/200-autoconf.sh
scripts/build/companion_tools/300-automake.sh
scripts/build/companion_tools/400-libtool.sh
scripts/build/debug/000-template.sh
scripts/build/debug/100-dmalloc.sh
scripts/build/debug/200-duma.sh
scripts/build/debug/300-gdb.sh
scripts/build/debug/400-ltrace.sh
scripts/build/debug/500-strace.sh
scripts/build/kernel/linux.sh
scripts/build/libc/eglibc.sh
scripts/build/libc/glibc.sh
scripts/build/libc/newlib.sh
scripts/build/libc/uClibc.sh
scripts/functions
     1.1 --- a/scripts/build/binutils/binutils.sh	Sun Apr 11 23:17:25 2010 +0200
     1.2 +++ b/scripts/build/binutils/binutils.sh	Sun Apr 11 23:18:10 2010 +0200
     1.3 @@ -12,7 +12,7 @@
     1.4  # Extract binutils
     1.5  do_binutils_extract() {
     1.6      CT_Extract "binutils-${CT_BINUTILS_VERSION}"
     1.7 -    CT_Patch "binutils-${CT_BINUTILS_VERSION}"
     1.8 +    CT_Patch "binutils" "${CT_BINUTILS_VERSION}"
     1.9  }
    1.10  
    1.11  # Build binutils
     2.1 --- a/scripts/build/binutils/elf2flt.sh	Sun Apr 11 23:17:25 2010 +0200
     2.2 +++ b/scripts/build/binutils/elf2flt.sh	Sun Apr 11 23:18:10 2010 +0200
     2.3 @@ -22,7 +22,7 @@
     2.4  # Extract elf2flt
     2.5  do_elf2flt_extract() {
     2.6      CT_Extract "elf2flt-cvs-${CT_ELF2FLT_VERSION}"
     2.7 -    CT_Patch "elf2flt-cvs-${CT_ELF2FLT_VERSION}"
     2.8 +    CT_Patch "elf2flt-cvs" "${CT_ELF2FLT_VERSION}"
     2.9  }
    2.10  
    2.11  # Build elf2flt
     3.1 --- a/scripts/build/cc/gcc.sh	Sun Apr 11 23:17:25 2010 +0200
     3.2 +++ b/scripts/build/cc/gcc.sh	Sun Apr 11 23:18:10 2010 +0200
     3.3 @@ -28,7 +28,7 @@
     3.4  # Extract gcc
     3.5  do_cc_extract() {
     3.6      CT_Extract "gcc-${CT_CC_VERSION}"
     3.7 -    CT_Patch "gcc-${CT_CC_VERSION}"
     3.8 +    CT_Patch "gcc" "${CT_CC_VERSION}"
     3.9  
    3.10      # Copy ecj-latest.jar to ecj.jar at the top of the GCC source tree
    3.11      if [ "${CT_CC_LANG_JAVA_USE_ECJ}" = "y"                     \
     4.1 --- a/scripts/build/companion_libs/cloog.sh	Sun Apr 11 23:17:25 2010 +0200
     4.2 +++ b/scripts/build/companion_libs/cloog.sh	Sun Apr 11 23:18:10 2010 +0200
     4.3 @@ -29,7 +29,7 @@
     4.4          *)      _t="-${CT_CLOOG_VERSION}";;
     4.5      esac
     4.6      CT_Pushd "${CT_SRC_DIR}/cloog-ppl${_t}"
     4.7 -    CT_Patch nochdir "cloog-ppl-${CT_CLOOG_VERSION}"
     4.8 +    CT_Patch nochdir "cloog-ppl" "${CT_CLOOG_VERSION}"
     4.9      CT_Popd
    4.10  }
    4.11  
     5.1 --- a/scripts/build/companion_libs/gmp.sh	Sun Apr 11 23:17:25 2010 +0200
     5.2 +++ b/scripts/build/companion_libs/gmp.sh	Sun Apr 11 23:18:10 2010 +0200
     5.3 @@ -18,7 +18,7 @@
     5.4  # Extract GMP
     5.5  do_gmp_extract() {
     5.6      CT_Extract "gmp-${CT_GMP_VERSION}"
     5.7 -    CT_Patch "gmp-${CT_GMP_VERSION}"
     5.8 +    CT_Patch "gmp" "${CT_GMP_VERSION}"
     5.9  }
    5.10  
    5.11  if [ "${CT_GMP}" = "y" ]; then
     6.1 --- a/scripts/build/companion_libs/libelf.sh	Sun Apr 11 23:17:25 2010 +0200
     6.2 +++ b/scripts/build/companion_libs/libelf.sh	Sun Apr 11 23:18:10 2010 +0200
     6.3 @@ -16,7 +16,7 @@
     6.4  
     6.5  do_libelf_extract() {
     6.6      CT_Extract "libelf-${CT_LIBELF_VERSION}"
     6.7 -    CT_Patch "libelf-${CT_LIBELF_VERSION}"
     6.8 +    CT_Patch "libelf" "${CT_LIBELF_VERSION}"
     6.9  }
    6.10  
    6.11  if [ "${CT_LIBELF}" = "y" ]; then
     7.1 --- a/scripts/build/companion_libs/mpc.sh	Sun Apr 11 23:17:25 2010 +0200
     7.2 +++ b/scripts/build/companion_libs/mpc.sh	Sun Apr 11 23:18:10 2010 +0200
     7.3 @@ -19,7 +19,7 @@
     7.4  # Extract MPC
     7.5  do_mpc_extract() {
     7.6      CT_Extract "mpc-${CT_MPC_VERSION}"
     7.7 -    CT_Patch "mpc-${CT_MPC_VERSION}"
     7.8 +    CT_Patch "mpc" "${CT_MPC_VERSION}"
     7.9  }
    7.10  
    7.11  do_mpc() {
     8.1 --- a/scripts/build/companion_libs/mpfr.sh	Sun Apr 11 23:17:25 2010 +0200
     8.2 +++ b/scripts/build/companion_libs/mpfr.sh	Sun Apr 11 23:18:10 2010 +0200
     8.3 @@ -19,7 +19,7 @@
     8.4  # Extract MPFR
     8.5  do_mpfr_extract() {
     8.6      CT_Extract "mpfr-${CT_MPFR_VERSION}"
     8.7 -    CT_Patch "mpfr-${CT_MPFR_VERSION}"
     8.8 +    CT_Patch "mpfr" "${CT_MPFR_VERSION}"
     8.9  
    8.10      # OK, Gentoo have a sanity check that libtool.m4 and ltmain.sh have the
    8.11      # same version number. Unfortunately, some tarballs of MPFR are not
     9.1 --- a/scripts/build/companion_libs/ppl.sh	Sun Apr 11 23:17:25 2010 +0200
     9.2 +++ b/scripts/build/companion_libs/ppl.sh	Sun Apr 11 23:18:10 2010 +0200
     9.3 @@ -21,7 +21,7 @@
     9.4  # Extract PPL
     9.5  do_ppl_extract() {
     9.6      CT_Extract "ppl-${CT_PPL_VERSION}"
     9.7 -    CT_Patch "ppl-${CT_PPL_VERSION}"
     9.8 +    CT_Patch "ppl" "${CT_PPL_VERSION}"
     9.9  }
    9.10  
    9.11  do_ppl() {
    10.1 --- a/scripts/build/companion_tools/100-m4.sh	Sun Apr 11 23:17:25 2010 +0200
    10.2 +++ b/scripts/build/companion_tools/100-m4.sh	Sun Apr 11 23:18:10 2010 +0200
    10.3 @@ -9,7 +9,7 @@
    10.4  
    10.5  do_companion_tools_m4_extract() {
    10.6      CT_Extract "m4-${CT_M4_VERSION}"
    10.7 -    CT_Patch "m4-${CT_M4_VERSION}"
    10.8 +    CT_Patch "m4" "${CT_M4_VERSION}"
    10.9  }
   10.10  
   10.11  do_companion_tools_m4_build() {
    11.1 --- a/scripts/build/companion_tools/200-autoconf.sh	Sun Apr 11 23:17:25 2010 +0200
    11.2 +++ b/scripts/build/companion_tools/200-autoconf.sh	Sun Apr 11 23:18:10 2010 +0200
    11.3 @@ -9,7 +9,7 @@
    11.4  
    11.5  do_companion_tools_autoconf_extract() {
    11.6      CT_Extract "autoconf-${CT_AUTOCONF_VERSION}"
    11.7 -    CT_Patch "autoconf-${CT_AUTOCONF_VERSION}"
    11.8 +    CT_Patch "autoconf" "${CT_AUTOCONF_VERSION}"
    11.9  }
   11.10  
   11.11  do_companion_tools_autoconf_build() {
    12.1 --- a/scripts/build/companion_tools/300-automake.sh	Sun Apr 11 23:17:25 2010 +0200
    12.2 +++ b/scripts/build/companion_tools/300-automake.sh	Sun Apr 11 23:18:10 2010 +0200
    12.3 @@ -9,7 +9,7 @@
    12.4  
    12.5  do_companion_tools_automake_extract() {
    12.6      CT_Extract "automake-${CT_AUTOMAKE_VERSION}"
    12.7 -    CT_Patch "automake-${CT_AUTOMAKE_VERSION}"
    12.8 +    CT_Patch "automake" "${CT_AUTOMAKE_VERSION}"
    12.9  }
   12.10  
   12.11  do_companion_tools_automake_build() {
    13.1 --- a/scripts/build/companion_tools/400-libtool.sh	Sun Apr 11 23:17:25 2010 +0200
    13.2 +++ b/scripts/build/companion_tools/400-libtool.sh	Sun Apr 11 23:18:10 2010 +0200
    13.3 @@ -9,7 +9,7 @@
    13.4  
    13.5  do_companion_tools_libtool_extract() {
    13.6      CT_Extract "libtool-${CT_LIBTOOL_VERSION}"
    13.7 -    CT_Patch "libtool-${CT_LIBTOOL_VERSION}"
    13.8 +    CT_Patch "libtool" "${CT_LIBTOOL_VERSION}"
    13.9  }
   13.10  
   13.11  do_companion_tools_libtool_build() {
    14.1 --- a/scripts/build/debug/000-template.sh	Sun Apr 11 23:17:25 2010 +0200
    14.2 +++ b/scripts/build/debug/000-template.sh	Sun Apr 11 23:18:10 2010 +0200
    14.3 @@ -11,7 +11,7 @@
    14.4  do_debug_foobar_extract() {
    14.5      # For example:
    14.6      # CT_Extract "foobar-${CT_FOOBAR_VERSION}"
    14.7 -    # CT_Patch "foobar-${CT_FOOBAR_VERSION}"
    14.8 +    # CT_Patch "foobar" "${CT_FOOBAR_VERSION}"
    14.9      :
   14.10  }
   14.11  
    15.1 --- a/scripts/build/debug/100-dmalloc.sh	Sun Apr 11 23:17:25 2010 +0200
    15.2 +++ b/scripts/build/debug/100-dmalloc.sh	Sun Apr 11 23:18:10 2010 +0200
    15.3 @@ -6,7 +6,7 @@
    15.4  
    15.5  do_debug_dmalloc_extract() {
    15.6      CT_Extract "dmalloc-${CT_DMALLOC_VERSION}"
    15.7 -    CT_Patch "dmalloc-${CT_DMALLOC_VERSION}"
    15.8 +    CT_Patch "dmalloc" "${CT_DMALLOC_VERSION}"
    15.9  }
   15.10  
   15.11  do_debug_dmalloc_build() {
    16.1 --- a/scripts/build/debug/200-duma.sh	Sun Apr 11 23:17:25 2010 +0200
    16.2 +++ b/scripts/build/debug/200-duma.sh	Sun Apr 11 23:18:10 2010 +0200
    16.3 @@ -12,11 +12,7 @@
    16.4  do_debug_duma_extract() {
    16.5      CT_Extract "duma_${CT_DUMA_VERSION}"
    16.6      CT_Pushd "${CT_SRC_DIR}/duma_${CT_DUMA_VERSION}"
    16.7 -    # Even if DUMA uses _ and not -, crosstool-NG uses the dash to split the
    16.8 -    # name from the version in order to find the appropriate patches
    16.9 -    # YEM: FIXME: make CT_Patch more intelligent, Eg.: CT_Patch duma _ "${CT_DUMA_VERSION}"
   16.10 -    CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.duma-${CT_DUMA_VERSION}.extracted"
   16.11 -    CT_Patch nochdir "duma-${CT_DUMA_VERSION}"
   16.12 +    CT_Patch nochdir "duma" "${CT_DUMA_VERSION}"
   16.13      CT_Popd
   16.14  }
   16.15  
    17.1 --- a/scripts/build/debug/300-gdb.sh	Sun Apr 11 23:17:25 2010 +0200
    17.2 +++ b/scripts/build/debug/300-gdb.sh	Sun Apr 11 23:18:10 2010 +0200
    17.3 @@ -57,17 +57,17 @@
    17.4  
    17.5      if [ "${do_gdb}" = "y" ]; then
    17.6          CT_Extract "gdb-${CT_GDB_VERSION}"
    17.7 -        CT_Patch "gdb-${CT_GDB_VERSION}"
    17.8 +        CT_Patch "gdb" "${CT_GDB_VERSION}"
    17.9      fi
   17.10  
   17.11      if [ "${do_insight}" = "y" ]; then
   17.12          CT_Extract "insight-${CT_GDB_VERSION}"
   17.13 -        CT_Patch "insight-${CT_GDB_VERSION}"
   17.14 +        CT_Patch "insight" "${CT_GDB_VERSION}"
   17.15      fi
   17.16  
   17.17      if [ "${do_ncurses}" = "y" ]; then
   17.18          CT_Extract "ncurses-${CT_DEBUG_GDB_NCURSES_VERSION}"
   17.19 -        CT_Patch "ncurses-${CT_DEBUG_GDB_NCURSES_VERSION}"
   17.20 +        CT_Patch "ncurses" "${CT_DEBUG_GDB_NCURSES_VERSION}"
   17.21      fi
   17.22  }
   17.23  
    18.1 --- a/scripts/build/debug/400-ltrace.sh	Sun Apr 11 23:17:25 2010 +0200
    18.2 +++ b/scripts/build/debug/400-ltrace.sh	Sun Apr 11 23:18:10 2010 +0200
    18.3 @@ -13,7 +13,7 @@
    18.4  
    18.5  do_debug_ltrace_extract() {
    18.6      CT_Extract "ltrace-${CT_LTRACE_VERSION}"
    18.7 -    CT_Patch "ltrace-${CT_LTRACE_VERSION}"
    18.8 +    CT_Patch "ltrace" "${CT_LTRACE_VERSION}"
    18.9  }
   18.10  
   18.11  do_debug_ltrace_build() {
    19.1 --- a/scripts/build/debug/500-strace.sh	Sun Apr 11 23:17:25 2010 +0200
    19.2 +++ b/scripts/build/debug/500-strace.sh	Sun Apr 11 23:18:10 2010 +0200
    19.3 @@ -8,7 +8,7 @@
    19.4  
    19.5  do_debug_strace_extract() {
    19.6      CT_Extract "strace-${CT_STRACE_VERSION}"
    19.7 -    CT_Patch "strace-${CT_STRACE_VERSION}"
    19.8 +    CT_Patch "strace" "${CT_STRACE_VERSION}"
    19.9  }
   19.10  
   19.11  do_debug_strace_build() {
    20.1 --- a/scripts/build/kernel/linux.sh	Sun Apr 11 23:17:25 2010 +0200
    20.2 +++ b/scripts/build/kernel/linux.sh	Sun Apr 11 23:18:10 2010 +0200
    20.3 @@ -23,7 +23,7 @@
    20.4  do_kernel_extract() {
    20.5      if [ "${CT_KERNEL_LINUX_USE_CUSTOM_HEADERS}" != "y" ]; then
    20.6          CT_Extract "linux-${CT_KERNEL_VERSION}"
    20.7 -        CT_Patch "linux-${CT_KERNEL_VERSION}"
    20.8 +        CT_Patch "linux" "${CT_KERNEL_VERSION}"
    20.9      fi
   20.10      return 0
   20.11  }
    21.1 --- a/scripts/build/libc/eglibc.sh	Sun Apr 11 23:17:25 2010 +0200
    21.2 +++ b/scripts/build/libc/eglibc.sh	Sun Apr 11 23:18:10 2010 +0200
    21.3 @@ -94,7 +94,7 @@
    21.4  # Extract eglibc
    21.5  do_libc_extract() {
    21.6      CT_Extract "eglibc-${CT_LIBC_VERSION}"
    21.7 -    CT_Patch "eglibc-${CT_LIBC_VERSION}"
    21.8 +    CT_Patch "eglibc" "${CT_LIBC_VERSION}"
    21.9  
   21.10      # C library addons
   21.11      for addon in $(do_libc_add_ons_list " "); do
   21.12 @@ -110,7 +110,7 @@
   21.13          # directory, returns true!
   21.14          [ -d "${addon}" ] || ln -s "eglibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
   21.15          [ -d "eglibc-${addon}-${CT_LIBC_VERSION}" ] || ln -s "${addon}" "eglibc-${addon}-${CT_LIBC_VERSION}"
   21.16 -        CT_Patch nochdir "eglibc-${addon}-${CT_LIBC_VERSION}"
   21.17 +        CT_Patch nochdir "eglibc" "${addon}-${CT_LIBC_VERSION}"
   21.18          CT_Popd
   21.19      done
   21.20  
    22.1 --- a/scripts/build/libc/glibc.sh	Sun Apr 11 23:17:25 2010 +0200
    22.2 +++ b/scripts/build/libc/glibc.sh	Sun Apr 11 23:18:10 2010 +0200
    22.3 @@ -38,7 +38,7 @@
    22.4      CT_Extract "glibc-${CT_LIBC_VERSION}"
    22.5  
    22.6      CT_Pushd "${CT_SRC_DIR}/glibc-${CT_LIBC_VERSION}"
    22.7 -    CT_Patch nochdir "glibc-${CT_LIBC_VERSION}"
    22.8 +    CT_Patch nochdir "glibc" "${CT_LIBC_VERSION}"
    22.9  
   22.10      # C library addons
   22.11      for addon in "${addons_list[@]}"; do
   22.12 @@ -54,7 +54,7 @@
   22.13          # directory, returns true!
   22.14          [ -d "${addon}" ] || CT_DoExecLog ALL ln -s "glibc-${addon}-${CT_LIBC_VERSION}" "${addon}"
   22.15          [ -d "glibc-${addon}-${CT_LIBC_VERSION}" ] || CT_DoExecLog ALL ln -s "${addon}" "glibc-${addon}-${CT_LIBC_VERSION}"
   22.16 -        CT_Patch nochdir "glibc-${addon}-${CT_LIBC_VERSION}"
   22.17 +        CT_Patch nochdir "glibc" "${addon}-${CT_LIBC_VERSION}"
   22.18      done
   22.19  
   22.20      # The configure files may be older than the configure.in files
    23.1 --- a/scripts/build/libc/newlib.sh	Sun Apr 11 23:17:25 2010 +0200
    23.2 +++ b/scripts/build/libc/newlib.sh	Sun Apr 11 23:18:10 2010 +0200
    23.3 @@ -34,7 +34,7 @@
    23.4  
    23.5  do_libc_extract() {
    23.6      CT_Extract "newlib-$(libc_newlib_version)"
    23.7 -    CT_Patch "newlib-$(libc_newlib_version)"
    23.8 +    CT_Patch "newlib" "$(libc_newlib_version)"
    23.9  
   23.10      if [ "${CT_ATMEL_AVR32_HEADERS}" = "y" ]; then
   23.11          CT_Extract "avr32headers"
    24.1 --- a/scripts/build/libc/uClibc.sh	Sun Apr 11 23:17:25 2010 +0200
    24.2 +++ b/scripts/build/libc/uClibc.sh	Sun Apr 11 23:18:10 2010 +0200
    24.3 @@ -22,13 +22,13 @@
    24.4  # Extract uClibc
    24.5  do_libc_extract() {
    24.6      CT_Extract "uClibc-${CT_LIBC_VERSION}"
    24.7 -    CT_Patch "uClibc-${CT_LIBC_VERSION}"
    24.8 +    CT_Patch "uClibc" "${CT_LIBC_VERSION}"
    24.9  
   24.10      # uClibc locales
   24.11      if [ "${CT_LIBC_UCLIBC_LOCALES}" = "y" ]; then
   24.12          CT_Pushd "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}/extra/locale"
   24.13          CT_Extract nochdir "uClibc-locale-030818"
   24.14 -        CT_Patch nochdir "uClibc-locale-030818"
   24.15 +        CT_Patch nochdir "uClibc" "locale-030818"
   24.16          CT_Popd
   24.17      fi
   24.18  
    25.1 --- a/scripts/functions	Sun Apr 11 23:17:25 2010 +0200
    25.2 +++ b/scripts/functions	Sun Apr 11 23:18:10 2010 +0200
    25.3 @@ -708,10 +708,15 @@
    25.4  
    25.5  # Patches the specified component
    25.6  # See CT_Extract, above, for explanations on 'nochdir'
    25.7 -# Usage: CT_Patch [nochdir] <basename>
    25.8 +# Usage: CT_Patch [nochdir] <packagename> <packageversion>
    25.9 +# If the package directory is *not* packagename-packageversion, then
   25.10 +# the caller must cd into the proper directory first, and call us
   25.11 +# with nochdir
   25.12  CT_Patch() {
   25.13      local nochdir="$1"
   25.14 -    local basename
   25.15 +    local pkgname
   25.16 +    local version
   25.17 +    local pkgdir
   25.18      local base_file
   25.19      local ver_file
   25.20      local d
   25.21 @@ -719,40 +724,40 @@
   25.22      local bundled_patch_dir
   25.23      local local_patch_dir
   25.24  
   25.25 +    pkgname="$1"
   25.26 +    version="$2"
   25.27 +    pkgdir="${pkgname}-${version}"
   25.28 +
   25.29      if [ "${nochdir}" = "nochdir" ]; then
   25.30          shift
   25.31          nochdir="$(pwd)"
   25.32      else
   25.33 -        nochdir="${CT_SRC_DIR}/${1}"
   25.34 +        nochdir="${CT_SRC_DIR}/${pkgdir}"
   25.35      fi
   25.36  
   25.37 -    basename="$1"
   25.38 -    base_file="${basename%%-*}"
   25.39 -    ver_file="${basename#*-}"
   25.40 -
   25.41      # Check if already patched
   25.42 -    if [ -e "${CT_SRC_DIR}/.${basename}.patched" ]; then
   25.43 -        CT_DoLog DEBUG "Already patched '${basename}'"
   25.44 +    if [ -e "${CT_SRC_DIR}/.${pkgdir}.patched" ]; then
   25.45 +        CT_DoLog DEBUG "Already patched '${pkgdir}'"
   25.46          return 0
   25.47      fi
   25.48  
   25.49      # Check if already partially patched
   25.50 -    if [ -e "${CT_SRC_DIR}/.${basename}.patching" ]; then
   25.51 -        CT_DoLog ERROR "The '${basename}' sources were partially patched."
   25.52 +    if [ -e "${CT_SRC_DIR}/.${pkgdir}.patching" ]; then
   25.53 +        CT_DoLog ERROR "The '${pkgdir}' sources were partially patched."
   25.54          CT_DoLog ERROR "Please remove first:"
   25.55 -        CT_DoLog ERROR " - the source dir for '${basename}', in '${CT_SRC_DIR}'"
   25.56 -        CT_DoLog ERROR " - the file '${CT_SRC_DIR}/.${basename}.extracted'"
   25.57 -        CT_DoLog ERROR " - the file '${CT_SRC_DIR}/.${basename}.patching'"
   25.58 +        CT_DoLog ERROR " - the source dir for '${pkgdir}', in '${CT_SRC_DIR}'"
   25.59 +        CT_DoLog ERROR " - the file '${CT_SRC_DIR}/.${pkgdir}.extracted'"
   25.60 +        CT_DoLog ERROR " - the file '${CT_SRC_DIR}/.${pkgdir}.patching'"
   25.61          CT_Abort "I'll stop now to avoid any carnage..."
   25.62      fi
   25.63 -    touch "${CT_SRC_DIR}/.${basename}.patching"
   25.64 +    touch "${CT_SRC_DIR}/.${pkgdir}.patching"
   25.65  
   25.66      CT_Pushd "${nochdir}"
   25.67  
   25.68 -    CT_DoLog EXTRA "Patching '${basename}'"
   25.69 +    CT_DoLog EXTRA "Patching '${pkgdir}'"
   25.70  
   25.71 -    bundled_patch_dir="${CT_LIB_DIR}/patches/${base_file}/${ver_file}"
   25.72 -    local_patch_dir="${CT_LOCAL_PATCH_DIR}/${base_file}/${ver_file}"
   25.73 +    bundled_patch_dir="${CT_LIB_DIR}/patches/${pkgname}/${version}"
   25.74 +    local_patch_dir="${CT_LOCAL_PATCH_DIR}/${pkgname}/${version}"
   25.75  
   25.76      case "${CT_PATCH_ORDER}" in
   25.77          bundled)        patch_dirs=("${bundled_patch_dir}");;
   25.78 @@ -787,8 +792,8 @@
   25.79          done
   25.80      fi
   25.81  
   25.82 -    CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.${basename}.patched"
   25.83 -    CT_DoExecLog DEBUG rm -f "${CT_SRC_DIR}/.${basename}.patching"
   25.84 +    CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.${pkdir}.patched"
   25.85 +    CT_DoExecLog DEBUG rm -f "${CT_SRC_DIR}/.${pkdir}.patching"
   25.86  
   25.87      CT_Popd
   25.88  }