1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-14 05:25:06 -05:00

OS400/initscript.sh: fix db2_name() module name generation

Allow repeatable file name length reduction on file names with underscore or
dash characters. This is done in order to better support libcurl's existing
source file names and allow OS/400 package to build out of the box again.
This commit is contained in:
Yang Tse 2012-04-12 19:13:23 +02:00
parent 8ed40acac6
commit e19917296f

View File

@ -157,6 +157,10 @@ db2_name()
basename "${1}" | basename "${1}" |
tr 'a-z-' 'A-Z_' | tr 'a-z-' 'A-Z_' |
sed -e 's/\..*//' \ sed -e 's/\..*//' \
-e 's/\([^_]\)[^_]*_\(.*\)/\1\2/' \
-e 's/\([^_]\)\([^_]\)[^_]*_\(.*\)/\1\2\3/' \
-e 's/\([^_]\)\([^_]\)\([^_]\)[^_]*_\(.*\)/\1\2\3\4/' \
-e 's/\([^_]\)\([^_]\)\([^_]\)\([^_]\)[^_]*_\(.*\)/\1\2\3\4\5/' \
-e 's/^\(..........\).*/\1/' -e 's/^\(..........\).*/\1/'
} }