Skip to content

Commit 5cb6396

Browse files
committed
changes to keep Yad compatibility
1 parent f9a109b commit 5cb6396

7 files changed

Lines changed: 39 additions & 48 deletions

File tree

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ Since 8.0.0 version, project is housed at github ( https://github.com/BashGui ).
248248
Credits.
249249

250250
Thanks to Bash, Yad, Gtkdialog, Xdialog, Kdialog, Zenity, Cdialog, and Whiptail authors, this library was nothing without their work. Many thanks.
251-
Thanks to Frank Dietermann for suggestion though to make EBG "posix compliant" (vers. 11.X.X )
251+
Thanks to Frank Dietermann for suggestion though to make EBG "posix compliant" (since vers. 11.X.X )
252252
Thanks to Jose Joao Dias de Almeida for the makefile tip.
253253
Thanks to Chris "cgat" for his many ideas and suggestions that lead to version's "5.X.X" EasyBashGUI "revolution".
254254
Thanks to Davide Depau for his tests and support, and his effort to make EasyBashGUI Debian policy compliant, and finally for his man page.

lib/easybashgui.lib

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#########################
1010
#
11-
# Copyright (C) 2019 Vittorio Cagnetta
11+
# Copyright (C) 2020 Vittorio Cagnetta
1212
#
1313
# Author: Vittorio Cagnetta <vaisarger@gmail.com>
1414
#
@@ -35,7 +35,7 @@
3535
#####################################
3636
#####################################
3737
#
38-
LIB_VERSION="12.0.3"
38+
LIB_VERSION="12.0.4"
3939
LIB_NAME="easybashgui.lib"
4040
LIB_URL="https://github.com/BashGui/easybashgui"
4141
LIB_AUTHOR="Vittorio Cagnetta"
@@ -85,6 +85,15 @@ height=378
8585
#
8686
##
8787
#
88+
typing_tac="$(type 'tac' 2> /dev/null )"
89+
[ ${#typing_tac} -eq 0 ] && shopt -s expand_aliases && alias tac="sed '1'\!'G;h;$'\!'d'"
90+
: tac
91+
#
92+
typing_seq="$(type 'seq' 2> /dev/null )"
93+
[ ${#typing_seq} -eq 0 ] && seq() { for ((index=${1}; index<=${2}; index++)); do echo "${index}"; done; } && export -f seq
94+
#
95+
##
96+
#
8897
# gsed...
8998
for word in sed gsed
9099
do
@@ -93,7 +102,7 @@ for word in sed gsed
93102
done
94103
[ "${mascotte}" = "Beastie" ] && : #later we'll check for gsed binary...
95104
[ "${mascotte}" = "Tux" ] && shopt -s expand_aliases && alias gsed=sed #gsed is no more a function...
96-
typing_gsed="$(type "gsed" 2> /dev/null )"
105+
typing_gsed="$(type 'gsed' 2> /dev/null )"
97106
if [ ${#typing_gsed} -eq 0 ]
98107
then
99108
[ "${mascotte}" = "Beastie" ] && echo -e "\n\n\n\nYou need to install \"gsed\" ( GNU Sed ) port/package to use ${LIB_NAME}...\nSorry :(\n\n\n\n" 1>&2
@@ -3064,7 +3073,10 @@ if [ "${mode}" = "yad" ]
30643073
testo="${@}"
30653074
#
30663075
testo_yad="$(echo "${testo}" | tr -d '<>' )"
3067-
yes | \
3076+
#
3077+
yess() { while : ; do echo 'y' ; sleep 0.1 ; done ; }
3078+
#yes | \
3079+
yess | \
30683080
${dialogo} --title "${supertitle:-EasyBashGUI}: please wait" --progress --pulsate --auto-kill --text "$(echo -e "${testo_yad}" )" ${dimensione_finestra} &>/dev/null &
30693081
#
30703082
export wait_for__PID="${!}"
@@ -3387,7 +3399,8 @@ if [ "${mode}" = "yad" ]
33873399
dir="${HOME}/"
33883400
fi
33893401
#
3390-
fselect="--file-selection"
3402+
[ $(yad --help | grep "\-\-file\-selection" | wc -c ) -gt 0 ] && fselect="--file-selection" || fselect="--file"
3403+
#
33913404
dim_finestra="${dimensione_finestra}"
33923405
eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: file select\" ${fselect} --filename \"${dir}\" ${dim_finestra} 2> /dev/null 1> "${dir_tmp}/${file_tmp}"
33933406
#
@@ -3754,7 +3767,8 @@ if [ "${mode}" = "yad" ]
37543767
dir="${HOME}/"
37553768
fi
37563769
#
3757-
dselect="--file-selection --directory"
3770+
[ $(yad --help | grep "\-\-file\-selection" | wc -c ) -gt 0 ] && dselect="--file-selection --directory" || dselect="--file --directory"
3771+
#
37583772
dim_finestra="${dimensione_finestra}"
37593773
eval ${dialogo} --title \"${supertitle:-EasyBashGUI}: dir. select\" ${dselect} --filename \"${dir}\" ${dim_finestra} 2> /dev/null 1> "${dir_tmp}/${file_tmp}"
37603774
#exit_if_user_closes_window

lib/easybashlib

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# easybashlib - EasyBash Library...
22
#
3-
# Hint: If you are just using a random editor, try Geany.
4-
#
53
# For more lib modules and improvement ideas see:
64
# http://dberkholz.com/2011/04/07/bash-shell-scripting-libraries/
75

@@ -179,8 +177,6 @@ function eb_error_output()
179177
#####################
180178

181179

182-
183-
184180
function eb_kill_process_tree_of_pid() {
185181
# Grows a process tree that can kill an existing process tree beginning with
186182
# the given PID as parent.
@@ -231,15 +227,11 @@ function eb_kill_process_tree_of_pid() {
231227
fi
232228
done
233229

234-
235230
}
236231

237232

238233

239234

240-
241-
242-
243235
# Define a mechanism for automatic clean up on exit, based upon the idea
244236
# http://www.linuxjournal.com/content/use-bash-trap-statement-cleanup-temporary-files
245237
#
@@ -297,15 +289,11 @@ ebg_add_on_exit()
297289

298290

299291

300-
301-
302-
303292
###############
304293
# Directories #
305294
###############
306295

307296

308-
309297
# determine eb_conf_dir
310298
if [ "${USERPROFILE:-undefined}" = undefined ]
311299
then
@@ -351,7 +339,6 @@ eb_debug_output "eb_log_dir is set to $eb_log_dir"
351339

352340

353341

354-
355342
# determine eb_persistence_dir
356343
if [ "${USERPROFILE:-undefined}" = undefined ]
357344
then
@@ -440,14 +427,11 @@ fi
440427

441428

442429

443-
444-
445430
##########
446431
# Checks #
447432
##########
448433

449434

450-
451435
function eb_gen_check_code()
452436
# Generates code to check the tests given as parameters (all tests if none was specified).
453437
# Usefull to run selections of tests in context as needed.
@@ -533,29 +517,28 @@ function eb_check_local()
533517
eb_map() {
534518
#parameters: action, storage_type, key, value, process_name
535519

536-
[ "$#" -lt 2 ] && exit 1
537-
local action="$1"
538-
local storage_type="$2"
539-
local mapname="$3"
540-
local key="$4"
541-
local value="$5"
520+
[ "${#}" -lt 2 ] && exit 1
521+
local action="${1}"
522+
local storage_type="${2}"
523+
local mapname="${3}"
524+
local key="${4}"
525+
local value="${5}"
542526
local process_name="${6:-${eb_runtime_invoke_name}}"
543527
local mapdir
544528

545-
if [ "$storage_type" = "persistent" ]
546-
then
529+
if [ "${storage_type}" = "persistent" ]
530+
then
547531
mapdir="${eb_persistence_basedir}/${process_name}/eb_key-value-maps"
548532
else
549533
mapdir="$(eb_get_state_dir ${process_name})/eb_key-value-maps"
550534
fi
551535

552-
if [ "$action" = "put" ]
553-
then
536+
if [ "${action}" = "put" ]
537+
then
554538
[ -d "${mapdir}/${mapname}" ] || mkdir -p "${mapdir}/${mapname}"
555539
echo $value >"${mapdir}/${mapname}/${key}"
556-
557-
elif [ "$action" = "get" ]
558-
then
540+
elif [ "${action}" = "get" ]
541+
then
559542
cat "${mapdir}/${mapname}/${key}"
560543
fi
561544
}

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#EBGlib=$(wildcard easybashgui_[0-9].[0-9].[0-9])
2-
VERSION=12.0.3
2+
VERSION=12.0.4
33

44
#cartelle di destinazione
55
DESTDIR ?= ""

src/easybashgui

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#
1313
#########################
1414
#
15-
# Copyright (C) 2019 Vittorio Cagnetta
15+
# Copyright (C) 2020 Vittorio Cagnetta
1616
#
1717
# Author: Vittorio Cagnetta <vaisarger@gmail.com>
1818
# Author: Christian ? <https://launchpad.net/~cgat-1>
@@ -74,12 +74,9 @@
7474
# Improvement thanks to Stefano Borini's answer at
7575
# http://stackoverflow.com/questions/78497/design-patterns-or-best-practices-for-shell-scripts
7676
#
77-
# TODO
78-
# Load newest version of module if there are several available?
79-
# something like if [ -e $(eb_incl__absolute_path)/$module_*.*.* ] ?
8077
#
8178
###################################################################
82-
MODULE_VERSION="12.0.3"
79+
MODULE_VERSION="12.0.4"
8380
MODULE_NAME="easybashgui"
8481
libexec_dir="/usr/lib/easybashgui"
8582
###################################################################

src/easybashgui-debug

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#
1313
#########################
1414
#
15-
# Copyright (C) 2019 Vittorio Cagnetta
15+
# Copyright (C) 2020 Vittorio Cagnetta
1616
#
1717
# Author: Vittorio Cagnetta <vaisarger@gmail.com>
1818
# Author: Christian ? <https://launchpad.net/~cgat-1>
@@ -74,12 +74,9 @@
7474
# Improvement thanks to Stefano Borini's answer at
7575
# http://stackoverflow.com/questions/78497/design-patterns-or-best-practices-for-shell-scripts
7676
#
77-
# TODO
78-
# Load newest version of module if there are several available?
79-
# something like if [ -e $(eb_incl__absolute_path)/$module_*.*.* ] ?
8077
#
8178
###################################################################
82-
MODULE_VERSION="12.0.3"
79+
MODULE_VERSION="12.0.4"
8380
MODULE_NAME="easybashgui-debug"
8481
###################################################################
8582
#

src/easydialog-legacy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
#########################
44
#
5-
# Copyright (C) 2013 Vittorio Cagnetta
5+
# Copyright (C) 2020 Vittorio Cagnetta
66
#
77
# Author: Vittorio Cagnetta <vaisarger@gmail.com>
88
#

0 commit comments

Comments
 (0)