Mailinglist Archive: opensuse-bugs (13385 mails)

< Previous Next >
[Bug 300678] GDM sets XDG_DATA_DIRS incorrectly
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Tue, 16 Oct 2007 08:02:18 -0600 (MDT)
  • Message-id: <20071016140218.E485FCC7AC@xxxxxxxxxxxxxxxxxxxxxx>
https://bugzilla.novell.com/show_bug.cgi?id=300678#c34


Dr. Werner Fink <werner@xxxxxxxxxx> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |ASSIGNED
Info Provider|werner@xxxxxxxxxx |




--- Comment #34 from Dr. Werner Fink <werner@xxxxxxxxxx> 2007-10-16 08:02:18
MST ---
There is no way to use ${x//y/z/} in ash therefore I'd like to suggest to
use sed but only once:


uniquefy_search_path ()
{
OIFS="$IFS"
IFS='
'
set -- $(echo ${1+"$@"} | sed -r 's@/*:|([^\\]):@\1\n@g;H;x;s@/\n@\n@')
IFS="$OIFS"

_y=""
for _x ; do
case ":${_y}:" in
*:"${_x}":*) continue
esac
_y=${_y:+"$_y:"}${_x}
done
echo "${_y}"
unset _y _x
}

uniquefy_search_path b:a:c:a
uniquefy_search_path a:b:a:c
uniquefy_search_path ' a: b: a:c:a '
uniquefy_search_path ' a: b: a:\:c:a :\:c'

uniquefy_search_path /b/:/a/:/c/:/a/
uniquefy_search_path /a/:/b/:/a/:/c/
uniquefy_search_path '/ a/:/ b/:/ a/:/c/:/a /'
uniquefy_search_path '/ a/x/:/ b/x/:/ a/x/:/\:c:/a /x/:/\:c'
uniquefy_search_path '/ a/x/:/ b/x/:/ a/x/:/\:c/x/:/a /x/:/\:c/x/'
uniquefy_search_path '/ a/x/:/ b/x/:/ a/x/:/\:/c/x/:/a /x/:/\:/c/x/'

note that the IFS is set this way because the ash also does not know
about $'\n' as ksh or bash do. The method

IFS='
'

only includes the newline, there is no space of tabulator included.


--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

< Previous Next >