public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2017-10-02 14:32 Michael Haubenwallner
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Haubenwallner @ 2017-10-02 14:32 UTC (permalink / raw
  To: gentoo-commits

commit:     b65b2fa48ef6e149ef42e66cb229302369812d24
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Mon Oct  2 14:31:22 2017 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Mon Oct  2 14:32:02 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b65b2fa4

profiles/prefix/winnt: p.use.mask asm for openssl

 profiles/prefix/windows/winnt/package.use.mask | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/profiles/prefix/windows/winnt/package.use.mask b/profiles/prefix/windows/winnt/package.use.mask
new file mode 100644
index 00000000000..51b019b65f2
--- /dev/null
+++ b/profiles/prefix/windows/winnt/package.use.mask
@@ -0,0 +1,6 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Michael Haubenwallner <haubi@gentoo.org> (02 Oct 2017)
+# requires nasm, which is hard to use via parity atm
+dev-libs/openssl asm


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2018-01-24 16:23 Michael Haubenwallner
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Haubenwallner @ 2018-01-24 16:23 UTC (permalink / raw
  To: gentoo-commits

commit:     22b59662d21039f8f3246d12a2ac0bbb93d35683
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 24 16:10:36 2018 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Wed Jan 24 16:22:45 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=22b59662

prefix/winnt/profiles.bashrc: improve winnt helpers

With Gentoo Parity wrapping the Visual Studio compiler, build systems
unaware of Windows can create .so import libraries just fine.  But
Windows aware build systems do prefer .lib import libraries, so we do
create .lib -> .so symlinks, resolved by Gentoo Parity later on again.

Additionally, they don't know about the additional .dll to install.  So
we wrap the cp utility to also copy the dll when the library is copied.

 profiles/prefix/windows/winnt/profile.bashrc | 159 +++++++++++++++++++++++++--
 1 file changed, 149 insertions(+), 10 deletions(-)

diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index f1c5c365338..7d1251609c0 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -1,4 +1,4 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # On windows, binary files (executables, shared libraries) in use
@@ -13,6 +13,20 @@
 # Need to explicitly set PKG_CONFIG_PATH for cross EPREFIX.
 export PKG_CONFIG_PATH="${EPREFIX}/lib/pkgconfig:${EPREFIX}/usr/lib/pkgconfig"
 
+windows_setup_dllhelper() {
+	case ${CATEGORY}/${PN} in
+	sys-libs/zlib |\
+	'')
+		# When a package build system does not know about Windows at all,
+		# still it can be built for Windows using Gentoo Parity.
+		# But as there is another file to install (the real dll),
+		# and installation is done using cp, we override cp to
+		# additionally copy the dll when the library is copied.
+		windows_setup_dllhelper_cp
+		;;
+	esac
+}
+
 windows_cleanup_removed_files() {
 	local removedlist=$1
 	rm -f "${removedlist}".new
@@ -78,17 +92,36 @@ windows_prepare_file() {
 
 post_src_install() {
 	cd "${ED}"
-	find . -name '*.exe' | while read f; do
-		if file "${f}" | grep "GUI" > /dev/null 2>&1; then
-			if test ! -f "${f%.exe}"; then
-				einfo "Windows GUI Executable $f will have no symlink."
+	find . -name '*.exe' -o -name '*.dll.a' -o -name '*.so' |
+	while read f
+	do
+		f=${f#./}
+		case ${f} in
+		*.exe)
+			if file "./${f}" | grep "GUI" > /dev/null 2>&1; then
+				if test ! -f "./${f%.exe}"; then
+					einfo "Windows GUI Executable $f will have no symlink."
+				fi
+			else
+				if test ! -f "./${f%.exe}"; then
+					ebegin "creating ${f%.exe} -> ${f} for console accessibility."
+					eend $(ln -sf "$(basename "${f}")" "./${f%.exe}" && echo 0 || echo 1)
+				fi
 			fi
-		else
-			if test ! -f "${f%.exe}"; then
-				ebegin "creating ${f%.exe} -> ${f} for console accessibility."
-				eend $(ln -sf "$(basename "${f}")" "${f%.exe}" && echo 0 || echo 1)
+			;;
+		*.dll.a)
+			if test ! -f "./${f%.a}.lib"; then
+				ebegin "creating ${f%.a}.lib -> ${f##*/} for libtool linkability"
+				eend $(ln -sf "$(basename "${f}")" "./${f%.a}.lib" && echo 0 || echo 1)
 			fi
-		fi
+			;;
+		*.so)
+			if test ! -f "${f%.so}.dll.lib"; then
+				ebegin "creating ${f%.so}.dll.lib -> ${f##*/} for libtool linkability"
+				eend $(ln -sf "$(basename "${f}")" "./${f%.so}.dll.lib" && echo 0 || echo 1)
+			fi
+			;;
+		esac
 	done
 }
 
@@ -149,3 +182,109 @@ pre_pkg_postrm() {
 	local removedlist="${EROOT}var/lib/portage/files2bremoved"
 	windows_cleanup_removed_files $removedlist
 }
+
+windows_setup_dllhelper_cp() {
+	if ! [[ $(type -P cp) -ef ${T}/dllhelper/cp ]]
+	then
+		mkdir -p "${T}/dllhelper"
+		cat > "${T}/dllhelper/cp" <<'EOCP'
+#!/usr/bin/env bash
+
+mysrcs=()
+myopts=()
+mydest=
+force_dest_file_opt=
+
+nextargs=( "$@" )
+
+while [[ $# > 0 ]]
+do
+	arg=${1}
+	shift
+	case ${arg} in
+	--)
+		mysrcs+=( "${@}" )
+		break
+		;;
+	-S)
+		myopts+=( "${arg}" ${1+"$1"} )
+		${1:+shift}
+		;;
+	-t)
+		mydest="${1-}"
+		${1:+shift}
+		;;
+	-T)
+		force_dest_file_opt=${arg}
+		;;
+	-*)
+		myopts+=( "${arg}" )
+		;;
+	*)
+		mysrcs+=( "${arg}" )
+		;;
+	esac
+done
+
+me=${0##*/}
+nextPATH=
+oIFS=$IFS
+IFS=:
+for p in ${PATH}
+do
+	[[ ${p}/${me} -ef ${0} ]] && continue
+	nextPATH+=${nextPATH:+:}${p}
+done
+IFS=${oIFS}
+
+PATH=${nextPATH}
+
+${me} "${nextargs[@]}"
+ret=$?
+[[ ${ret} == 0 ]] || exit ${ret}
+
+if [[ -z ${mydest} ]]
+then
+	[[ ${#mysrcs[@]} < 2 ]] && exit 0
+	: "${mysrcs[@]}" "${#mysrcs[@]}"
+	mydest=${mysrcs[${#mysrcs[@]}-1]}
+	unset mysrcs[${#mysrcs[@]}-1]
+elif [[ ${#mysrcs[@]} == 0 ]]
+then
+	exit 0
+fi
+
+for src in ${mysrcs[@]}
+do
+	ret=0
+	[[ ${src##*/} != lib*.so* ]] && continue
+	for ext in dll pdb
+	do
+		[[ ${src##*/} == *.${ext} ]] && continue
+		[[ -f ${src} && -f ${src}.${ext} ]] || continue
+		if [[ -d ${mydest} && ! -n ${force_dest_file_opt} ]]
+		then
+			# When copying to directory we keep the basename.
+			${me} -T "${myopts[@]}" "${src}.${ext}" "${mydest}/${src##*/}.${ext}"
+			ret=$?
+		elif [[ ${mydest##*/} == ${src##*/} ]]
+		then
+			# Copy the dll only when we keep the basename.
+			${me} -T "${myopts[@]}" "${src}.${ext}" "${mydest}.${ext}"
+			ret=$?
+		fi
+		[[ ${ret} == 0 ]] || exit ${ret}
+	done
+done
+
+exit 0
+EOCP
+		chmod +x "${T}/dllhelper/cp"
+		PATH="${T}/dllhelper:${PATH}"
+	fi
+}
+
+if [[ ${EBUILD_PHASE} == 'setup' ]]
+then
+	windows_setup_dllhelper
+fi


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2018-06-11  1:53 Matt Turner
  0 siblings, 0 replies; 14+ messages in thread
From: Matt Turner @ 2018-06-11  1:53 UTC (permalink / raw
  To: gentoo-commits

commit:     caa418013a6658092c728e5c3543bbc677e44187
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 11 01:50:08 2018 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Mon Jun 11 01:50:08 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=caa41801

profiles/prefix/winnt: Remove super dead package.mask entry

 profiles/prefix/windows/winnt/package.mask | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/profiles/prefix/windows/winnt/package.mask b/profiles/prefix/windows/winnt/package.mask
index 0af713753d9..0b9c2c93389 100644
--- a/profiles/prefix/windows/winnt/package.mask
+++ b/profiles/prefix/windows/winnt/package.mask
@@ -1,8 +1,2 @@
 
 # Distributed under the terms of the GNU General Public License v2
-
-
-# Markus Duft <mduft@gentoo.org> (30 Sep 2009)
-# the patch does not currently apply, and needs some work.
->=x11-proto/xproto-7.0.16
-


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2019-03-13  8:22 Michał Górny
  0 siblings, 0 replies; 14+ messages in thread
From: Michał Górny @ 2019-03-13  8:22 UTC (permalink / raw
  To: gentoo-commits

commit:     2e94310ff383220318b562041e7e237ede86a8e7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 13 08:20:18 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Mar 13 08:20:18 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e94310f

profiles: Remove obsolete use.mask entry

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 profiles/prefix/windows/winnt/use.mask | 1 -
 1 file changed, 1 deletion(-)

diff --git a/profiles/prefix/windows/winnt/use.mask b/profiles/prefix/windows/winnt/use.mask
index ac0a32f6af1..5b60cad0f8a 100644
--- a/profiles/prefix/windows/winnt/use.mask
+++ b/profiles/prefix/windows/winnt/use.mask
@@ -38,7 +38,6 @@ ipod
 ipv6
 lm_sensors
 ncurses
-netboot
 opengl
 oss
 pcmcia


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2019-03-20  8:39 Michael Haubenwallner
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Haubenwallner @ 2019-03-20  8:39 UTC (permalink / raw
  To: gentoo-commits

commit:     22c4e0424b2f0b8861c6aa278cb2e5269ed40896
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 18 14:45:59 2019 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Wed Mar 20 08:38:38 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=22c4e042

profiles/prefix/winnt/profile.bashrc: drop exe-in-use handling

Unlike Interix, Cygwin is able to "remove" executables in use, as in
transparently moving them to trashbin.  Broken for EAPI 7, dropped.

Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 profiles/prefix/windows/winnt/profile.bashrc | 121 ---------------------------
 1 file changed, 121 deletions(-)

diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index 7d1251609c0..3c12c651967 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -27,69 +27,6 @@ windows_setup_dllhelper() {
 	esac
 }
 
-windows_cleanup_removed_files() {
-	local removedlist=$1
-	rm -f "${removedlist}".new
-
-	if [[ -r ${removedlist} ]]; then
-		rm -f "${removedlist}".old
-	fi
-	# restore in case of system fault
-	if [[ -r ${removedlist}.old ]]; then
-		mv "${removedlist}"{.old,}
-	fi
-
-	touch "${removedlist}"{,.new} # ensure they exist
-
-	while read rmstem; do
-		# try to remove previously recorded files
-		for f in "${ROOT}${rmstem}"*; do
-			ebegin "trying to remove ${f}"
-			rm -f "${f}" > /dev/null 2>&1
-			eend $?
-		done
-		# but keep it in list if still exists
-		for f in "${ROOT}${rmstem}"*; do
-			[[ -f ${f} ]] && echo "${rmstem}" >> "${removedlist}".new
-			break
-		done
-	done < "${removedlist}"
-
-	# update the list
-	mv "${removedlist}"{,.old}
-	mv "${removedlist}"{.new,}
-	rm "${removedlist}".old
-}
-
-windows_find_removed_slot() {
-	local f=$1
-	local n=0
-	while [[ ${n} -lt 100 && -f "${f}${n}" ]]; do
-		n=$((n=n+1))
-	done
-
-	if [[ ${n} -ge 100 ]]; then
-		echo "too many (>=100) old text files busy of '${f}'" >&2
-		exit 1
-	fi
-
-	echo $n
-}
-
-windows_prepare_file() {
-	local failed=0
-	my_mv=mv
-
-	[[ "${1}" == */mv ]] && my_mv="${1}.new"
-	[[ -f "${1}.new" ]] && rm -f "${1}.new"
-
-	cp -p "${1}" "${1}.new" || failed=1
-	${my_mv} "${1}" "${2}" || failed=1
-	${my_mv} "${1}.new" "${1}" || failed=1
-
-	echo $failed
-}
-
 post_src_install() {
 	cd "${ED}"
 	find . -name '*.exe' -o -name '*.dll.a' -o -name '*.so' |
@@ -125,64 +62,6 @@ post_src_install() {
 	done
 }
 
-post_pkg_preinst() {
-	local removedlist="${EROOT}var/lib/portage/files2bremoved"
-	windows_cleanup_removed_files $removedlist
-	
-	# now go for current package
-	cd "${D}"
-	find ".${EROOT}" -type f | xargs -r /usr/bin/file | grep ' PE ' | while read f t
-	do
-		f=${f#./} # find prints: "./path/to/file"
-		f=${f%:} # file prints: "file-argument: type-of-file"
-		test -r "${ROOT}${f}" || continue
-		rmstem="${f}.removedbyportage"
-		# keep list of old busy text files unique
-		grep "^${rmstem}$" "${removedlist}" >/dev/null \
-			|| echo "${rmstem}" >> "${removedlist}"
-
-		local n=$(windows_find_removed_slot ${ROOT}${rmstem})
-		ebegin "backing up text file ${ROOT}${f} (${n})"
-		eend $(windows_prepare_file "${ROOT}${f}" "${ROOT}${rmstem}${n}")
-	done
-}
-
-post_pkg_prerm() {
-	local removedlist="${EROOT}var/lib/portage/files2bremoved"
-	save_IFS=$IFS
-	IFS='
-';
-	local MY_PR=${PR}
-	[[ ${MY_PR} == r0 ]] && MY_PR=
-	local -a contents=($(<"${EROOT}var/db/pkg/${CATEGORY}/${P}${MY_PR:+-}${MY_PR}/CONTENTS"));
-	IFS=$save_IFS
-	local -a cont
-	for content in "${contents[@]}"; do
-		cont=($content)
-		f=${cont[1]}
-		f=${f#/}
-
-		test -r "${ROOT}${f}" || continue
-
-		if /usr/bin/file "${ROOT}${f}" | grep ' PE ' > /dev/null; then
-			# $f should be an absolute path to the installed file
-			rmstem="${f}.removedbyportage"
-
-			grep "^${rmstem}$" "${removedlist}" > /dev/null \
-				|| echo "${rmstem}" >> "${removedlist}"
-
-			local n=$(windows_find_removed_slot ${ROOT}${rmstem})
-			ebegin "preparing ${ROOT}${f} for unmerge ($n)"
-			eend $(windows_prepare_file "${ROOT}${f}" "${ROOT}${rmstem}${n}")
-		fi
-	done
-}
-
-pre_pkg_postrm() {
-	local removedlist="${EROOT}var/lib/portage/files2bremoved"
-	windows_cleanup_removed_files $removedlist
-}
-
 windows_setup_dllhelper_cp() {
 	if ! [[ $(type -P cp) -ef ${T}/dllhelper/cp ]]
 	then


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2019-06-24 11:08 Michael Haubenwallner
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Haubenwallner @ 2019-06-24 11:08 UTC (permalink / raw
  To: gentoo-commits

commit:     3326692aad3350ef104471ba2500207754c4129f
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 24 11:01:25 2019 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Mon Jun 24 11:07:51 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3326692a

prefix/winnt/profile.bashrc: move usr/lib/*.dll to usr/bin/

When dlls or executables are created without the parity loader in place,
dlls may not be found when not in usr/bin.
So better move dlls from usr/lib to usr/bin, much like Cygwin does.

Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 profiles/prefix/windows/winnt/profile.bashrc | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index 4e60691a494..c0eaec08a6d 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -62,6 +62,17 @@ post_src_install() {
 			;;
 		esac
 	done
+	find usr/$(get_libdir) -maxdepth 1 -type f -name '*.dll' |
+	while read f
+	do
+		if test ! -f usr/bin/${f##*/}; then
+			ebegin "moving ${f} to usr/bin for native loader"
+			dodir usr/bin || die
+			mv -f "${f}" usr/bin || die
+			ln -sf "../bin/${f##*/}" "${f}"
+			eend $?
+		fi
+	done
 }
 
 windows_setup_dllhelper_cp() {


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2019-06-24 11:08 Michael Haubenwallner
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Haubenwallner @ 2019-06-24 11:08 UTC (permalink / raw
  To: gentoo-commits

commit:     95a51fc1bd0282f10c6c97cc6a3cbaca4c9163b8
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 24 11:00:21 2019 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Mon Jun 24 11:07:50 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95a51fc1

prefix/winnt/profile.bashrc: inform on DLL cp wrapper setup

Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 profiles/prefix/windows/winnt/profile.bashrc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index 3c12c651967..4e60691a494 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -22,7 +22,9 @@ windows_setup_dllhelper() {
 		# But as there is another file to install (the real dll),
 		# and installation is done using cp, we override cp to
 		# additionally copy the dll when the library is copied.
+		ebegin "Setting up wrapper to copy the DLL along the LIB"
 		windows_setup_dllhelper_cp
+		eend $?
 		;;
 	esac
 }


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2019-06-24 12:15 Michael Haubenwallner
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Haubenwallner @ 2019-06-24 12:15 UTC (permalink / raw
  To: gentoo-commits

commit:     91830d78d6f352ee1450263b6466fda5f7c8003c
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 24 12:12:59 2019 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Mon Jun 24 12:14:55 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91830d78

prefix/winnt/profile.bashrc: first, check if usr/lib does exist

And fail if creating the back hardlink does fail.

Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 profiles/prefix/windows/winnt/profile.bashrc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index c0eaec08a6d..b8def6390de 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -62,6 +62,7 @@ post_src_install() {
 			;;
 		esac
 	done
+	[[ -d usr/$(get_libdir) ]] &&
 	find usr/$(get_libdir) -maxdepth 1 -type f -name '*.dll' |
 	while read f
 	do
@@ -69,7 +70,7 @@ post_src_install() {
 			ebegin "moving ${f} to usr/bin for native loader"
 			dodir usr/bin || die
 			mv -f "${f}" usr/bin || die
-			ln -sf "../bin/${f##*/}" "${f}"
+			ln -sf "../bin/${f##*/}" "${f}" || die
 			eend $?
 		fi
 	done


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2020-03-11 15:51 Michael Haubenwallner
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Haubenwallner @ 2020-03-11 15:51 UTC (permalink / raw
  To: gentoo-commits

commit:     029b4387d4d6201c1e83ad8a5d6a9c49ede5a389
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 11 14:21:10 2020 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Wed Mar 11 15:47:17 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=029b4387

prefix/winnt/profile.bashrc: ensure NAME.lib, libNAME.so

Libtool for winnt does create NAME.lib (for windows'ish build tools) and
libNAME.so (for libtool when .la was removed) import libs now, but
Cygwin'ish or MinGW'ish build tools may create .dll.lib or .dll.a.
Have the libNAME.so symlink point to them, to be found by libtool.

Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 profiles/prefix/windows/winnt/profile.bashrc | 116 +++++++++++++++++++++------
 1 file changed, 90 insertions(+), 26 deletions(-)

diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index b8def6390de..b9496a65232 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -13,6 +13,34 @@
 # Need to explicitly set PKG_CONFIG_PATH for cross EPREFIX.
 export PKG_CONFIG_PATH="${EPREFIX}/lib/pkgconfig:${EPREFIX}/usr/lib/pkgconfig"
 
+#######################################################################
+#
+# Unix aware build tools may provide (e.g. pkg-config) and accept
+# (e.g. gcc) the -lNAME linker option.  While they create libNAME.so
+# as the import library, they may be unaware of the additional dll.
+# The dllhelper wrappers take care of copying the real dll when
+# copying the libNAME.so.
+#
+# Cygwin and MinGW aware build tools may create the import library
+# as libNAME.dll.a or libNAME.dll.lib, and are aware of the dll,
+# while a subsequent linker step still receives the -lNAME option.
+#
+# MSVC aware build tools may provide (e.g. icu-config) and accept
+# (e.g. cl.exe) the NAME.lib linker option, maybe with full path,
+# and are aware of the dll.
+#
+# Libtool does accept both the Unix and MSVC variants now, but does
+# search for the libNAME(.la|.dll|.so|.a) file upon -lNAME, in order.
+#
+# As Gentoo ebuilds may remove libNAME.la, we need the libNAME.so
+# because we don't want to have libNAME.dll as an import library.
+#
+# Here, for whatever import library name we find, make sure there
+# is both the NAME.lib and the libNAME.so for linkability via both
+# the -lNAME and the NAME.lib linker option.
+#
+#######################################################################
+
 windows_setup_dllhelper() {
 	case ${CATEGORY}/${PN} in
 	sys-libs/zlib |\
@@ -30,46 +58,82 @@ windows_setup_dllhelper() {
 }
 
 post_src_install() {
-	cd "${ED}"
-	find . -name '*.exe' -o -name '*.dll.a' -o -name '*.so' |
+	cd "${ED}" || return 0
+	#
+	# File names being treated as import library:
+	#  libNAME.so
+	#     NAME.lib
+	#  libNAME.dll.lib
+	#  libNAME.dll.a
+	#
+	# File names being ignored as static library:
+	#  libNAME.lib
+	#  libNAME.a
+	#
+	# File names being warned about as suspect:
+	#     NAME.so
+	#     NAME.a
+	#     NAME.dll.lib
+	#     NAME.dll.a
+	#
+	find . -name '*.so' -o -name '*.lib' -o -name '*.a' |
 	while read f
 	do
 		f=${f#./}
-		case ${f} in
-		*.exe)
-			if file "./${f}" | grep "GUI" > /dev/null 2>&1; then
-				if test ! -f "./${f%.exe}"; then
-					einfo "Windows GUI Executable $f will have no symlink."
-				fi
-			else
-				if test ! -f "./${f%.exe}"; then
-					ebegin "creating ${f%.exe} -> ${f} for console accessibility."
-					eend $(ln -sf "$(basename "${f}")" "./${f%.exe}" && echo 0 || echo 1)
-				fi
-			fi
+		libdir=$(dirname "${f}")
+		libfile=${f##*/}
+		libname=
+		case ${libfile} in
+		lib.so) ;; # paranoia
+		lib*.so)
+			libname=${libfile%.so}
+			libname=${libname#lib}
 			;;
-		*.dll.a)
-			if test ! -f "./${f%.a}.lib"; then
-				ebegin "creating ${f%.a}.lib -> ${f##*/} for libtool linkability"
-				eend $(ln -sf "$(basename "${f}")" "./${f%.a}.lib" && echo 0 || echo 1)
-			fi
+		lib.dll.lib) ;; # paranoia
+		lib*.dll.lib)
+			libname=${libfile%.dll.lib}
+			libname=${libname#lib}
 			;;
-		*.so)
-			if test ! -f "${f%.so}.dll.lib"; then
-				ebegin "creating ${f%.so}.dll.lib -> ${f##*/} for libtool linkability"
-				eend $(ln -sf "$(basename "${f}")" "./${f%.so}.dll.lib" && echo 0 || echo 1)
-			fi
+		lib.lib) ;; # paranoia
+		lib*.lib) continue ;; # ignore static library
+		.lib) ;; # paranoia
+		*.lib)
+			libname=${libfile%.lib}
 			;;
+		lib.dll.a) ;; # paranoia
+		lib*.dll.a)
+			libname=${libfile%.dll.a}
+			libname=${libname#lib}
+			;;
+		lib.a) ;; # paranoia
+		lib*.a) continue ;; # ignore static library
 		esac
+		if [[ -z ${libname} ]]; then
+			ewarn "Ignoring suspect file with library extension: ${f}"
+			continue
+		fi
+
+		NAMElib=${libname}.lib
+		libNAMEso=lib${libname}.so
+		if [[ ! -e ./${libdir}/${NAMElib} ]]; then
+			ebegin "creating ${NAMElib} copied from ${f##*/} for MSVC linkability"
+			cp -pf "./${libdir}/${libfile}" "./${libdir}/${NAMElib}" || die
+			eend $?
+		fi
+		if [[ ! -e "./${libdir}/${libNAMEso}" ]]; then
+			ebegin "creating ${libNAMEso} symlink to ${f##*/} for libtool linkability"
+			ln -sf "${libfile}" "./${libdir}/${libNAMEso}" || die
+			eend $?
+		fi
 	done
 	[[ -d usr/$(get_libdir) ]] &&
 	find usr/$(get_libdir) -maxdepth 1 -type f -name '*.dll' |
 	while read f
 	do
-		if test ! -f usr/bin/${f##*/}; then
+		if [[ ! -f usr/bin/${f##*/} ]]; then
 			ebegin "moving ${f} to usr/bin for native loader"
 			dodir usr/bin || die
-			mv -f "${f}" usr/bin || die
+			mv -f "${f}" usr/bin/ || die
 			ln -sf "../bin/${f##*/}" "${f}" || die
 			eend $?
 		fi


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2020-03-11 15:51 Michael Haubenwallner
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Haubenwallner @ 2020-03-11 15:51 UTC (permalink / raw
  To: gentoo-commits

commit:     f68a3873380140c91e7ea1d8d4872649cf8d1aee
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 11 14:24:51 2020 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Wed Mar 11 15:47:17 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f68a3873

prefix/winnt/profile.bashrc: rename funcs to winnt_

Provide the winnt_post_src_install and call that one in post_src_install
rather than performing all the operation directly in post_src_install.

Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 profiles/prefix/windows/winnt/profile.bashrc | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index 0670a48a5b1..c613a56cd98 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -48,7 +48,7 @@ export PKG_CONFIG_PATH="${EPREFIX}/lib/pkgconfig:${EPREFIX}/usr/lib/pkgconfig"
 #
 #######################################################################
 
-windows_setup_dllhelper() {
+winnt_setup_dllhelper() {
 	case ${CATEGORY}/${PN} in
 	sys-libs/zlib |\
 	'')
@@ -58,13 +58,17 @@ windows_setup_dllhelper() {
 		# and installation is done using cp, we override cp to
 		# additionally copy the dll when the library is copied.
 		ebegin "Setting up wrapper to copy the DLL along the LIB"
-		windows_setup_dllhelper_cp
+		winnt_setup_dllhelper_cp
 		eend $?
 		;;
 	esac
 }
 
 post_src_install() {
+	winnt_post_src_install
+}
+
+winnt_post_src_install() {
 	cd "${ED}" || return 0
 	#
 	# File names being treated as import library:
@@ -185,7 +189,7 @@ post_src_install() {
 	done
 }
 
-windows_setup_dllhelper_cp() {
+winnt_setup_dllhelper_cp() {
 	if ! [[ $(type -P cp) -ef ${T}/dllhelper/cp ]]
 	then
 		mkdir -p "${T}/dllhelper"
@@ -288,5 +292,5 @@ EOCP
 
 if [[ ${EBUILD_PHASE} == 'setup' ]]
 then
-	windows_setup_dllhelper
+	winnt_setup_dllhelper
 fi


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2020-03-11 15:51 Michael Haubenwallner
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Haubenwallner @ 2020-03-11 15:51 UTC (permalink / raw
  To: gentoo-commits

commit:     1eb082db1646e66713be974d53ba71bd7737300d
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 11 14:22:47 2020 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Wed Mar 11 15:47:17 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1eb082db

prefix/winnt/profile.bashrc: ensure libNAME.lib, libNAME.a

Libtool for winnt does create libNAME.lib as the static library, but
some build tools may expect libNAME.a.
Non-libtool build tools may also create a static library NAME.lib, which
needs to be duplicated to both libNAME.lib and libNAME.a, but not to
libNAME.so just because it does match the shared library naming scheme.
Also, do not provide symlinks but real files only, for some build tools
may source the MSVC environment and use the native toolchain.

Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 profiles/prefix/windows/winnt/profile.bashrc | 95 ++++++++++++++++++++--------
 1 file changed, 70 insertions(+), 25 deletions(-)

diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index b9496a65232..0670a48a5b1 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -35,9 +35,16 @@ export PKG_CONFIG_PATH="${EPREFIX}/lib/pkgconfig:${EPREFIX}/usr/lib/pkgconfig"
 # As Gentoo ebuilds may remove libNAME.la, we need the libNAME.so
 # because we don't want to have libNAME.dll as an import library.
 #
-# Here, for whatever import library name we find, make sure there
-# is both the NAME.lib and the libNAME.so for linkability via both
-# the -lNAME and the NAME.lib linker option.
+# The static library may be created as libNAME.a, libNAME.lib or even
+# NAME.lib - the latter we need to check for static or import library.
+#
+# For whatever import library file we find, make sure there is both the
+# NAME.lib and the libNAME.so for dynamic linkability via all the
+# -lNAME, the NAME.lib and the libNAME.so linker option.
+#
+# For whatever static library file we find, make sure there is both the
+# libNAME.lib and the libNAME.a for static linkability via all the
+# -lNAME, the libNAME.lib and the libNAME.a linker option.
 #
 #######################################################################
 
@@ -62,12 +69,13 @@ post_src_install() {
 	#
 	# File names being treated as import library:
 	#  libNAME.so
-	#     NAME.lib
+	#     NAME.lib if CHOST-dumpbin yields 'DLL name'
 	#  libNAME.dll.lib
 	#  libNAME.dll.a
 	#
-	# File names being ignored as static library:
+	# File names being treated as static library:
 	#  libNAME.lib
+	#     NAME.lib if CHOST-dumpbin lacks 'DLL name'
 	#  libNAME.a
 	#
 	# File names being warned about as suspect:
@@ -83,46 +91,83 @@ post_src_install() {
 		libdir=$(dirname "${f}")
 		libfile=${f##*/}
 		libname=
+		NAMElib=    # import lib to create
+		libNAMEso=  # import lib to create
+		libNAMElib= # static lib to create
+		libNAMEa=   # static lib to create
 		case ${libfile} in
-		lib.so) ;; # paranoia
-		lib*.so)
+		lib*.so) # found import library
 			libname=${libfile%.so}
 			libname=${libname#lib}
+			NAMElib=${libname}.lib
+			libNAMEso=lib${libname}.so
 			;;
-		lib.dll.lib) ;; # paranoia
-		lib*.dll.lib)
+		*.so) ;; # warn
+		lib*.dll.lib) # found import library
 			libname=${libfile%.dll.lib}
 			libname=${libname#lib}
+			NAMElib=${libname}.lib
+			libNAMEso=lib${libname}.so
 			;;
-		lib.lib) ;; # paranoia
-		lib*.lib) continue ;; # ignore static library
-		.lib) ;; # paranoia
-		*.lib)
-			libname=${libfile%.lib}
+		*.dll.lib) ;; # warn
+		*.lib) # found static or import library
+			${CHOST}-dumpbin.exe /headers "./${libdir}/${libfile}" | grep -q 'DLL name'
+			case "${PIPESTATUS[*]}" in
+			'0 0') # found import library
+				libname=${libfile%.lib}
+				libname=${libname#lib}
+				NAMElib=${libname}.lib
+				libNAMEso=lib${libname}.so
+				;;
+			'0 1') # found static library
+				libname=${libfile%.lib}
+				libname=${libname#lib}
+				libNAMEa=lib${libname}.a
+				libNAMElib=lib${libname}.lib
+				;;
+			*)
+				die "Cannot run ${CHOST}-dumpbin on ${libdir}/${libfile}"
+				;;
+			esac
 			;;
-		lib.dll.a) ;; # paranoia
-		lib*.dll.a)
+		lib*.dll.a) # found import library
 			libname=${libfile%.dll.a}
 			libname=${libname#lib}
+			NAMElib=${libname}.lib
+			libNAMEso=lib${libname}.so
+			;;
+		*.dll.a) ;; # warn
+		lib*.a) # found static library
+			libname=${libfile%.a}
+			libname=${libname#lib}
+			libNAMEa=lib${libname}.a
+			libNAMElib=lib${libname}.lib
 			;;
-		lib.a) ;; # paranoia
-		lib*.a) continue ;; # ignore static library
+		*.a) ;; # warn
 		esac
 		if [[ -z ${libname} ]]; then
 			ewarn "Ignoring suspect file with library extension: ${f}"
 			continue
 		fi
 
-		NAMElib=${libname}.lib
-		libNAMEso=lib${libname}.so
-		if [[ ! -e ./${libdir}/${NAMElib} ]]; then
-			ebegin "creating ${NAMElib} copied from ${f##*/} for MSVC linkability"
+		if [[ ${NAMElib} && ! -e ./${libdir}/${NAMElib} ]]; then
+			ebegin "creating ${NAMElib} from ${libfile} for MSVC linkability"
 			cp -pf "./${libdir}/${libfile}" "./${libdir}/${NAMElib}" || die
 			eend $?
 		fi
-		if [[ ! -e "./${libdir}/${libNAMEso}" ]]; then
-			ebegin "creating ${libNAMEso} symlink to ${f##*/} for libtool linkability"
-			ln -sf "${libfile}" "./${libdir}/${libNAMEso}" || die
+		if [[ ${libNAMElib} && ! -e ./${libdir}/${libNAMElib} ]]; then
+			ebegin "creating ${libNAMElib} from ${libfile} for MSVC linkability"
+			cp -pf "./${libdir}/${libfile}" "./${libdir}/${libNAMElib}" || die
+			eend $?
+		fi
+		if [[ ${libNAMEso} && ! -e ./${libdir}/${libNAMEso} ]]; then
+			ebegin "creating ${libNAMEso} from ${f##*/} for POSIX linkability"
+			cp -pf "./${libdir}/${libfile}" "./${libdir}/${libNAMEso}" || die
+			eend $?
+		fi
+		if [[ ${libNAMEa} && ! -e ./${libdir}/${libNAMEa} ]]; then
+			ebegin "creating ${libNAMEa} from ${f##*/} for POSIX linkability"
+			cp -pf "./${libdir}/${libfile}" "./${libdir}/${libNAMEa}" || die
 			eend $?
 		fi
 	done


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2020-03-11 15:51 Michael Haubenwallner
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Haubenwallner @ 2020-03-11 15:51 UTC (permalink / raw
  To: gentoo-commits

commit:     bdace9d42fa6b66f5524e1684c9a19b8d2117155
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 11 14:26:12 2020 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Wed Mar 11 15:47:18 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdace9d4

prefix/winnt/profile.bashrc: no symlink usr/lib/NAME.dll

While moving usr/lib/NAME.dll into usr/bin/ is necessary, creating the
symlink usr/lib/NAME.dll -> ../bin/NAME.dll is problematic, because the
libtool .exe wrapper may add usr/lib to PATH, causing the native loader
to fail when attempting to load a dll but discovering a cygwin symlink.
Also, need to resolve symlinks while moving from usr/lib into usr/bin.

Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 profiles/prefix/windows/winnt/profile.bashrc | 30 +++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index c613a56cd98..215ad93a943 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -175,18 +175,30 @@ winnt_post_src_install() {
 			eend $?
 		fi
 	done
-	[[ -d usr/$(get_libdir) ]] &&
-	find usr/$(get_libdir) -maxdepth 1 -type f -name '*.dll' |
-	while read f
-	do
-		if [[ ! -f usr/bin/${f##*/} ]]; then
-			ebegin "moving ${f} to usr/bin for native loader"
+	if [[ -d usr/$(get_libdir) ]]
+	then
+		# The native loader does not understand symlinks to dlls,
+		# seen to be created by dev-libs/icu eventually.  For any
+		# dll we find in usr/lib we need to perform a real copy to
+		# usr/bin, to resolve potential symlinks (seen from icu),
+		# and perform the remove from usr/lib afterwards, to not
+		# break symlinks later on discovered by find.
+		local toremove=()
+		local f
+		while read f
+		do
+			[[ -f usr/bin/${f##*/} ]] && continue
+			ebegin "moving ${f} to usr/bin for the native loader"
 			dodir usr/bin || die
-			mv -f "${f}" usr/bin/ || die
-			ln -sf "../bin/${f##*/}" "${f}" || die
+			cp -f "${f}" usr/bin/ || die
 			eend $?
+			toremove=( "${toremove[@]}" "${f}" )
+		done < <(find usr/$(get_libdir) -maxdepth 1 -name '*.dll')
+		if [[ ${#toremove[@]} -gt 0 ]]
+		then
+			rm -f "${toremove[@]}" || die "removing dlls from usr/$(get_libdir) failed"
 		fi
-	done
+	fi
 }
 
 winnt_setup_dllhelper_cp() {


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2020-03-11 15:51 Michael Haubenwallner
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Haubenwallner @ 2020-03-11 15:51 UTC (permalink / raw
  To: gentoo-commits

commit:     83a5d2e8d027d92c92bd9864b2f7cf463f1267a1
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 11 14:27:32 2020 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Wed Mar 11 15:47:18 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=83a5d2e8

prefix/winnt/profile.bashrc: leave PKG_CONFIG_PATH alone

These days, app-portage/prefix-toolkit does set up proper
PKG_CONFIG_PATH for the stacked Prefix.

Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>

 profiles/prefix/windows/winnt/profile.bashrc | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index 215ad93a943..1a70e77b1cb 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -10,9 +10,6 @@
 # and should be dropped once portage does sth. like this itself.
 #
 
-# Need to explicitly set PKG_CONFIG_PATH for cross EPREFIX.
-export PKG_CONFIG_PATH="${EPREFIX}/lib/pkgconfig:${EPREFIX}/usr/lib/pkgconfig"
-
 #######################################################################
 #
 # Unix aware build tools may provide (e.g. pkg-config) and accept


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/
@ 2020-04-19 15:02 Sergei Trofimovich
  0 siblings, 0 replies; 14+ messages in thread
From: Sergei Trofimovich @ 2020-04-19 15:02 UTC (permalink / raw
  To: gentoo-commits

commit:     7846712858fa0f77b912b55029330909fe983acc
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 19 15:02:07 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Apr 19 15:02:07 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78467128

profiles/prefix/windows/winnt/profile.bashrc: fix lexicographical number compare

Closes: https://bugs.gentoo.org/705272
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 profiles/prefix/windows/winnt/profile.bashrc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/prefix/windows/winnt/profile.bashrc b/profiles/prefix/windows/winnt/profile.bashrc
index 1a70e77b1cb..9420300435c 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -212,7 +212,7 @@ force_dest_file_opt=
 
 nextargs=( "$@" )
 
-while [[ $# > 0 ]]
+while [[ $# -gt 0 ]]
 do
 	arg=${1}
 	shift
@@ -260,7 +260,7 @@ ret=$?
 
 if [[ -z ${mydest} ]]
 then
-	[[ ${#mysrcs[@]} < 2 ]] && exit 0
+	[[ ${#mysrcs[@]} -lt 2 ]] && exit 0
 	: "${mysrcs[@]}" "${#mysrcs[@]}"
 	mydest=${mysrcs[${#mysrcs[@]}-1]}
 	unset mysrcs[${#mysrcs[@]}-1]


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-04-19 15:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-24 11:08 [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/windows/winnt/ Michael Haubenwallner
  -- strict thread matches above, loose matches on Subject: below --
2020-04-19 15:02 Sergei Trofimovich
2020-03-11 15:51 Michael Haubenwallner
2020-03-11 15:51 Michael Haubenwallner
2020-03-11 15:51 Michael Haubenwallner
2020-03-11 15:51 Michael Haubenwallner
2020-03-11 15:51 Michael Haubenwallner
2019-06-24 12:15 Michael Haubenwallner
2019-06-24 11:08 Michael Haubenwallner
2019-03-20  8:39 Michael Haubenwallner
2019-03-13  8:22 Michał Górny
2018-06-11  1:53 Matt Turner
2018-01-24 16:23 Michael Haubenwallner
2017-10-02 14:32 Michael Haubenwallner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox