diff options
| author | Dani Moncayo | 2014-11-09 00:31:44 +0100 |
|---|---|---|
| committer | Dani Moncayo | 2014-11-09 00:31:44 +0100 |
| commit | a6d74ed37be16adb07a0b36e440edfbd231d3cb8 (patch) | |
| tree | dd563f3979f22aa0fdae6c15b3a36dcb152cb707 | |
| parent | 0ced1de32cc69645b0398c7401f8c0af5a6fcfd5 (diff) | |
| download | emacs-a6d74ed37be16adb07a0b36e440edfbd231d3cb8.tar.gz emacs-a6d74ed37be16adb07a0b36e440edfbd231d3cb8.zip | |
Revert 118323.
| -rwxr-xr-x | build-aux/msys-to-w32 | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/build-aux/msys-to-w32 b/build-aux/msys-to-w32 index 1f9fda49fff..f8c37222889 100755 --- a/build-aux/msys-to-w32 +++ b/build-aux/msys-to-w32 | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | # Convert a MSYS path list to absolute, Windows-native format. | 2 | # Convert a MSYS path list to Windows-native format. |
| 3 | # Status is zero if successful, nonzero otherwise. | 3 | # Status is zero if successful, nonzero otherwise. |
| 4 | 4 | ||
| 5 | # Copyright (C) 2013-2014 Free Software Foundation, Inc. | 5 | # Copyright (C) 2013-2014 Free Software Foundation, Inc. |
| @@ -25,20 +25,20 @@ usage="usage: ${me} PATHLIST" | |||
| 25 | help="$usage | 25 | help="$usage |
| 26 | or: ${me} OPTION | 26 | or: ${me} OPTION |
| 27 | 27 | ||
| 28 | Convert a MSYS path list to absolute, Windows-native format. | 28 | Convert a MSYS path list to Windows-native format. |
| 29 | 29 | ||
| 30 | PATHLIST should be a colon-separated list of MSYS paths, which will be | 30 | PATHLIST should be a colon-separated list of MSYS paths, which will be |
| 31 | written to the standard output after performing these transformations: | 31 | written to the standard output after performing these transformations: |
| 32 | 32 | ||
| 33 | 1. Discard empty paths. | 33 | 1. Discard empty paths. |
| 34 | 2. Replace: '\' with '/', '//' with '/' and ':' with ';'. | 34 | 2. Replace: '\' with '/', '//' with '/' and ':' with ';'. |
| 35 | 3. Translate each path to absolute, Windows-native format. | 35 | 3. Translate each path to Windows-native format. |
| 36 | 36 | ||
| 37 | Paths starting with '%emacs_dir%' will be passed verbatim to the | 37 | Relative paths or paths starting with '%emacs_dir%' will be passed |
| 38 | standard output. | 38 | verbatim to the standard output. |
| 39 | 39 | ||
| 40 | Each non existing path will be translated by looking for its deepest | 40 | Each non existing absolute path will be translated by looking for its |
| 41 | existing directory, which will be translated and the remainder | 41 | deepest existing directory, which will be translated and the remainder |
| 42 | appended. | 42 | appended. |
| 43 | 43 | ||
| 44 | Options: | 44 | Options: |
| @@ -81,6 +81,9 @@ do | |||
| 81 | if [ "${p:0:11}" = "%emacs_dir%" ] | 81 | if [ "${p:0:11}" = "%emacs_dir%" ] |
| 82 | then | 82 | then |
| 83 | w32p=$p | 83 | w32p=$p |
| 84 | elif [ "${p:0:1}" != "/" ] | ||
| 85 | then | ||
| 86 | w32p=$p | ||
| 84 | elif [ -d "$p" ] | 87 | elif [ -d "$p" ] |
| 85 | then | 88 | then |
| 86 | w32p=$(cd "$p" && pwd -W) | 89 | w32p=$(cd "$p" && pwd -W) |
| @@ -92,23 +95,17 @@ do | |||
| 92 | p=${p//\/\///} | 95 | p=${p//\/\///} |
| 93 | p=${p%/} | 96 | p=${p%/} |
| 94 | 97 | ||
| 95 | p1=$p # last candidate tried | 98 | p1=$p |
| 96 | while : | 99 | while : |
| 97 | do | 100 | do |
| 98 | p2=${p1%/*} # next candidate to try | 101 | p1=${p1%/*} |
| 99 | [ "$p2" = "$p1" ] && { | 102 | [ -z "$p1" ] && p1="/" && break |
| 100 | # No more candidates to try | 103 | [ -d "$p1" ] && break |
| 101 | echo "Invalid path '$p'." >&2 | ||
| 102 | exit 1 | ||
| 103 | } | ||
| 104 | [ -z "$p2" ] && p2="/" && break | ||
| 105 | [ -d "$p2" ] && break | ||
| 106 | p1=$p2 | ||
| 107 | done | 104 | done |
| 108 | 105 | ||
| 109 | # translate the existing part and append the rest | 106 | # translate the existing part and append the rest |
| 110 | w32p=$(cd "${p2}" && pwd -W) | 107 | w32p=$(cd "${p1}" && pwd -W) |
| 111 | remainder=${p#$p2} | 108 | remainder=${p#$p1} |
| 112 | w32p+=/${remainder#/} | 109 | w32p+=/${remainder#/} |
| 113 | fi | 110 | fi |
| 114 | 111 | ||