aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Moncayo2014-11-09 00:31:44 +0100
committerDani Moncayo2014-11-09 00:31:44 +0100
commita6d74ed37be16adb07a0b36e440edfbd231d3cb8 (patch)
treedd563f3979f22aa0fdae6c15b3a36dcb152cb707
parent0ced1de32cc69645b0398c7401f8c0af5a6fcfd5 (diff)
downloademacs-a6d74ed37be16adb07a0b36e440edfbd231d3cb8.tar.gz
emacs-a6d74ed37be16adb07a0b36e440edfbd231d3cb8.zip
Revert 118323.
-rwxr-xr-xbuild-aux/msys-to-w3235
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"
25help="$usage 25help="$usage
26 or: ${me} OPTION 26 or: ${me} OPTION
27 27
28Convert a MSYS path list to absolute, Windows-native format. 28Convert a MSYS path list to Windows-native format.
29 29
30PATHLIST should be a colon-separated list of MSYS paths, which will be 30PATHLIST should be a colon-separated list of MSYS paths, which will be
31written to the standard output after performing these transformations: 31written to the standard output after performing these transformations:
32 32
331. Discard empty paths. 331. Discard empty paths.
342. Replace: '\' with '/', '//' with '/' and ':' with ';'. 342. Replace: '\' with '/', '//' with '/' and ':' with ';'.
353. Translate each path to absolute, Windows-native format. 353. Translate each path to Windows-native format.
36 36
37Paths starting with '%emacs_dir%' will be passed verbatim to the 37Relative paths or paths starting with '%emacs_dir%' will be passed
38standard output. 38verbatim to the standard output.
39 39
40Each non existing path will be translated by looking for its deepest 40Each non existing absolute path will be translated by looking for its
41existing directory, which will be translated and the remainder 41deepest existing directory, which will be translated and the remainder
42appended. 42appended.
43 43
44Options: 44Options:
@@ -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