From f7d4177466c5f47004acd1a360d84feb139b43d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dec?= Date: Sun, 25 Feb 2024 17:34:23 +0000 Subject: [PATCH] Proper documentation for windows-helper eclass --- eclass/windows-helper.eclass | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/eclass/windows-helper.eclass b/eclass/windows-helper.eclass index 63abbfe..79b451b 100644 --- a/eclass/windows-helper.eclass +++ b/eclass/windows-helper.eclass @@ -1,12 +1,30 @@ +# Copyright 2020-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: windows-helper.eclass +# @MAINTAINER: +# moog621@gmail.com +# @AUTHOR: +# moog621@gmail.com +# @SUPPORTED_EAPIS: 7 +# @BLURB: Helper functions for dealing with Windows. +# @DESCRIPTION: +# This class will provide functions and build dependencies which will help with problems typical when dealing with Windows in the context of ebuilds. + BDEPEND+=" sys-apps/sed sys-apps/coreutils " +# @FUNCTION: windowshelper_convert_normal_path_to_windows_path +# @USAGE: +# @DESCRIPTION: +# This function expects a single argument - a path, nevermind if absolute or relative, because it will be implicitly converted to an absolute path. +# This function will produce a standard output comprised of the above path converted to a Windows path. Since the path is an absolute one, it will point to an analogous path in the Z: drive, which makes this path readily usable by Wine. windowshelper_convert_normal_path_to_windows_path() { - local abs_path="$1" - if ! [[ "$1" =~ '^\/' ]]; then - abs_path=$(readlink -f "$1") + local abs_path="${1}" + if ! [[ "${1}" =~ '^\/' ]]; then + abs_path=$(readlink -f "${1}") fi echo "${abs_path}" | sed 's_^_Z:_;s_/_\\_g' }