LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-23-2017, 12:20 PM   #1
duturo1953
LQ Newbie
 
Registered: Aug 2017
Location: Miland, Italy
Distribution: Slackware64, now current
Posts: 6

Rep: Reputation: Disabled
a bug in dialog merged with Slackware64 current?


Hello to all.
I recently went to Slackware Current and found out that some of my scripts, where I use intensive dialogs, did not work anymore.
After some correction attempts, there were mistakes in the code, I found instead that there is a tiny bug in the dialog program, only in the --file option.
I did try also the dialog --file from samples of dialog itslef, but also samples did'nt function.
(checklist9 and checklist9.txt. Here the code:
Code:
#! /bin/sh
# $Id: checklist9,v 1.8 2010/01/13 10:20:03 tom Exp $
# "checklist8" using --file

. ./setup-vars

. ./setup-tempfile

$DIALOG "$@" --file checklist9.txt 2>$tempfile

retval=$?

. ./report-tempfile
Here the text:

Code:
--help-button \
	--colors \
	--backtitle "\Z1No Such\Zn Organization" \
	--separate-output \
	--title "CHECKLIST BOX" \
        --checklist "Hi, this is a checklist box. You can use this to \n\
present a list of choices which can be turned on or \n\
off. If there are more items than can fit on the \n\
screen, the list will be scrolled. You can use the \n\
\Z4UP/DOWN\Zn arrow keys, the first letter of the choice as a \n\
hot key, or the number keys 1-9 to choose an option. \n\
Press \Zb\ZrSPACE\Zn to toggle an option on/off. \n\n\
  Which of the following are fruits?" 20 61 5 \
        "Apple"      "It's an \Z1apple\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                    off \
        "Dog"        "No, that's not my dog. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                  ON  \
        "Orange"     "Yeah, that's juicy. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                     off \
        "Chicken"    "Normally not a pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                     off \
        ""           "No such pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                            off \
        "Cat"        "No, never put a dog and a cat together! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" oN  \
        "Fish"       "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"                   On  \
        "Lemon"      "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"     on

Reinstalled the Slackware64-14.2 dialog package, my scripts have resumed working perfectly.
I would like to point out to both the dialogue authors and Patrick Volkerding.

Here's an example of my scripts:

Code:
if ! ls *.iso; then
  dialog --no-cancel --title "Nessun file" --msgbox "\n\nNon c'è nessun file immagine iso nella \
  \ndirectory corrente. Esco dal programma." 10 50
  exit
fi

export NUMERO="$(ls *.iso | wc -l)"
if [ "$NUMERO" -ge 20 ]; then
    dialog --title "Spostamento e copia dei files" \
    --inputbox "\n\n\n(Anno_Numero_cd_NomeNumero\)\n\nQuale anno vuoi montare?\n\n\n" \
    0 0 "1997" 2>ANNO;
    if [ $? -eq 1 ]; then exit; fi
fi
export LANNO="$(cat ANNO)"
rm ANNO

function lodialogo(){
echo '--title "Ferrari Renato Software - Programma VirtualIso"   --no-cancel --separate-output \
--checklist "\nBenvenuti nel programma per montare \
\ni dischi immagine iso\
\nChe cosa scegli?\n\n" 0 0 0 \' > IMGvirt.txt
echo \"Uscita\" \"Esce dal programma\" "ON" \\ >> IMGvirt.txt

for CICCIO in "$LANNO"*.iso; do
  CICCIA="$(echo $CICCIO | rev | cut -f1 -d\/ | rev)"
  echo \"$CICCIO\" \"$CICCIA\" "OFF" \ \\ >> IMGvirt.txt ;
done
echo \"Tutti\" \"Tutte le immagini iso\" "OFF" >> IMGvirt.txt
dialog --file IMGvirt.txt 2>POPA
export DISCO="$(cat POPA)"
rm -f POPA
if [ `echo "$DISCO" | grep "Uscita"` ]; then
  mipulisco
  exit; 
fi
}

function mipulisco(){
rm IMGvirt.txt &>/dev/null;   
for POPA in /mnt/minihd2/dischiimg/*; do 
  sudo umount $POPA &>/dev/null; 
done
rmdir /mnt/minihd2/dischiimg/*  &>/dev/null
}

lodialogo
MICONTO=1
if echo "$DISCO" | grep "Tutti"; then export DISCO="$(ls -1 "$LANNO"*.iso)"; fi 
for CONTO in `echo "$DISCO" | cat`; do  
  export CONTA="$(echo "$CONTO" | rev | cut -f2- -d\. | rev)";
  mkdir -p /mnt/minihd2/dischiimg/"$MICONTO""_""$CONTA" &>/dev/null;
  sudo mount -o,loop "$CONTO" /mnt/minihd2/dischiimg/"$MICONTO""_""$CONTA" &>/dev/null;
  MICONTO=$((MICONTO+1));
done
kfmclient openProfile filemanagement /mnt/minihd2/dischiimg
where IMGvirt.txt is a file generate from script itself and
where dialog --file IMGvirt.txt 2>POPA is the command that don't funcion.
All other flags of dialog haven't bugs

In Slackware64-14.2 dialog package is:
dialog-1.2_20130523-x86_64-1.txz

In Slackware64-current dialog package is:
dialog-1.3_20160828-x86_64-1.txz
 
Old 08-23-2017, 02:26 PM   #2
volkerdi
Slackware Maintainer
 
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,508

Rep: Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473Reputation: 8473
This bug was noted in the ChangeLog, and we fixed our own dialog-based scripts to not use the --file option. I've tested and found that the latest dialog does not have this bug, so I'll go ahead and upgrade dialog in -current. Hopefully there will not be any new bugs.
 
9 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[BUG] Slackware64-Current shutdown dismount issue. ReaperX7 Slackware 14 11-29-2014 04:21 PM
Maybe a bug in dhcpcd-6.0.5-x86_64-2 on Slackware64-current jhw Slackware 1 10-02-2013 06:08 AM
Slackware64-current GPG Bug t35t Slackware 6 08-30-2012 05:56 AM
[SOLVED] Slackware64-Current Bug in lxc 0.7.5 Jack128 Slackware 7 08-25-2012 12:53 PM
slackware64-current glibc resolver bug? fancylad Slackware 8 01-31-2010 04:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration