Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 26 Oct 2014, 03:50
All times are UTC - 4
 Forum index » House Training » Bugs ( Submit bugs )
Xdialog error using either remaster method
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
rrolsbe

Joined: 15 Nov 2006
Posts: 182

PostPosted: Thu 10 May 2007, 22:14    Post_subject:  Xdialog error using either remaster method
Sub_title: Neither remaster method has worked for me since 2.14
 

I get the following "Usage for Xdialog" message right after I chose the simple method option. I get an orange box indicating it is calculating then get the long dialog message below. I keep thinking someone else would post with the same error, guess I am the only one having the problem.

Dougal, is there anyway to run your remaster utility from an Xterm and not use the GUI. If not, what would be the best way to debug this problem?

Xdialog v2.3.1 by Thierry Godefroy <xdialog@free.fr> (v1.0 was
written by Alfred at Cyberone Internet <alfred@cyberone.com.au>).
Xdialog home page available at: http://xdialog.dyns.net/

Usage: Xdialog [<common options>] [<transient options>] <box option> ...

Common options:
--wmclass <name>
--rc-file <gtkrc filename>
--backtitle <backtitle>
--title <title>
--allow-close | --no-close
--screen-center | --under-mouse | --auto-placement
--center | --right | --left | --fill
--no-wrap | --wrap
--cr-wrap | --no-cr-wrap
--stderr | --stdout
--separator <character> | --separate-output
--buttons-style default|icon|text

Transient options:
--fixed-font
--password (may be repeated 2 or 3 times before --2inputsbox or --3inputsbox)
--password=1|2 (for --2inputsbox or --3inputsbox)
--editable
--time-stamp | --date-stamp
--reverse
--keep-colors
--interval <timeout>
--timeout <timeout> (in seconds)
--no-tags
--item-help (if used, the {...} parameters are needed in menus/lists widgets)
--default-item <tag>
--icon <xpm filename>
--no-ok
--no-cancel
--no-buttons
--default-no
--wizard
--help <help>
--print <printer> (1)
--check <label> [<status>]
--ok-label <label>
--cancel-label <label>
--beep
--beep-after
--begin <Yorg> <Xorg>
--ignore-eof
--smooth

Box options:
--yesno <text> <height> <width>
--msgbox <text> <height> <width>
--infobox <text> <height> <width> [<timeout>]
--gauge <text> <height> <width> [<percent>]
--progress <text> <height> <width> [<maxdots> [[-]<msglen>]]
--inputbox <text> <height> <width> [<init>]
--2inputsbox <text> <height> <width> <label1> <init1> <label2> <init2>
--3inputsbox <text> <height> <width> <label1> <init1> <label2> <init2> <label3> <init3>
--combobox <text> <height> <width> <item1> ... <itemN>
--rangebox <text> <height> <width> <min value> <max value> [<default value>]
--2rangesbox <text> <height> <width> <label1> <min1> <max1> <def1> <label2> <min2> <max2> <def2>
--3rangesbox <text> <height> <width> <label1> <min1> <max1> <def1> ... <label3> <min3> <max3> <def3>
--spinbox <text> <height> <width> <min value> <max value> <default value> <label>
--2spinsbox <text> <height> <width> <min1> <max1> <def1> <label1> <min2> <max2> <def2> <label2>
--3spinsbox <text> <height> <width> <min1> <max1> <def1> <label1> ... <min3> <max3> <def3> <label3>
--textbox <file> <height> <width>
--editbox <file> <height> <width>
--tailbox <file> <height> <width>
--logbox <file> <height> <width>
--menubox <text> <height> <width> <menu height> <tag1> <item1> {<help1>}...
--checklist <text> <height> <width> <list height> <tag1> <item1> <status1> {<help1>}...
--radiolist <text> <height> <width> <list height> <tag1> <item1> <status1> {<help1>}...
--buildlist <text> <height> <width> <list height> <tag1> <item1> <status1> {<help1>}...
--treeview <text> <height> <width> <list height> <tag1> <item1> <status1> <item_depth1> {<help1>}...
--fselect <file> <height> <width>
--dselect <directory> <height> <width>
--colorsel <text> <height> <width> [<red> <green> <blue>]
--fontsel <font name> <height> <width>
--calendar <text> <height> <width> [<day> <month> <year>]
--timebox <text> <height> <width> [<hours> <minutes> <seconds>]

Special options:
--version (prints version number to stderr and exits).
--print-version (same as above in a cdialog-compatible way).
--print-maxsize (prints maximum menu size in characters and exits).

Note that <height> and <width> are in characters and may be replaced by a single
XSIZExYSIZE[+/-XORG+/-YORG] parameter (like the one passed in the -geometry option
of X) which will represent the size of the Xdialog window in pixels. Specifying
a size of 0 0 (or 0x0) will auto-size Xdialog, while a size of -1 -1 (or -1x-1)
will maximize it.

(1) This Xdialog binary compiled with: lprshell -P<printer>
as the print command. If <printer> is "" (an empty string), the -P
option is not used.

Regards
Ron
Back to top
View user's profile Send_private_message 
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: Fri 11 May 2007, 06:37    Post_subject:  

Try this.
pupremaster.sh.gz
Description 
gz

 Download 
Filename  pupremaster.sh.gz 
Filesize  9.34 KB 
Downloaded  598 Time(s) 

_________________
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Back to top
View user's profile Send_private_message 
rrolsbe

Joined: 15 Nov 2006
Posts: 182

PostPosted: Fri 11 May 2007, 09:19    Post_subject: Attached pupremaster.sh worked great! Thanks!
Sub_title: pupremaster.sh fixed Xdialog error
 

Will this version of pupremaster be in the 2.16 final?

Regards
Ron
Back to top
View user's profile Send_private_message 
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: Fri 11 May 2007, 14:11    Post_subject:  

Beats me... There's been a similar version on the "updated remaster script" thread for a long time.
_________________
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Back to top
View user's profile Send_private_message 
leotan

Joined: 02 Sep 2013
Posts: 4

PostPosted: Tue 03 Sep 2013, 00:20    Post_subject:  

Wow, this is an ancient bug. Sorry to bring this thread back to life but the bug is still current for puppy 528 at least and this thread is at the top of the Google results so I think it's better to post the solution here. There's a little bug in remasterpup versions 2 & 3 that causes it to abort with an Xdialog usage error message whenever there is an ISO image mounted.

In particular, there's a botched regex in the handling of the VIRTUALCD variable. To fix it, replace where it says:

Code:
   
sed -e 's/on[ ].*+//'   


with this:

Code:
   
sed -e 's/on [ ]*//'   


(mind the blanks).
Back to top
View user's profile Send_private_message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Fri 06 Sep 2013, 20:24    Post_subject:  

sed tends to exhibit problems with LANG or LC_ALL settings other than "", "en_US" or "C" .

Code:
if [ "$NEW" = "yes" ]; then  ###### long skip if, cleating new sfs

VIRTUALCD=$(mount -t iso9660|grep '^/dev/loop' | sed -e 's/on[ ].*+//' -e 's/[ ]type[ ]iso9660[ ].*$//')
#VIRTUALCD="`grep -E "loop.*iso9660" /proc/mounts | cut -f 1-2 -d ' ' | tr '\n' ' '`" #110808 PANZERKOPF bug fix. 110822 reverted.
MSG="$m_14"
choice_cdd


I personally think that grep /proc/mounts is the better code line.
Back to top
View user's profile Send_private_message Visit_website 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Mon 09 Sep 2013, 21:51    Post_subject:  

leotan,

Welcome to the forum. And thanks for the bug report and the fix for older Puppies. Barry rewrote this part of the code last February, so this bug is gone from new Puppies. But your fix will be useful for anyone who runs into this problem on an old Puppy.

Actually, the problem was not a "botched regex". That line of code did just what it was expected to do. The problem was that the expectations were unrealistically limited.

Here is why.

In Puppy, clicking on a the icon for an .iso file in the file manager will mount the iso image using Puppy's filemnt script. That script mounts the file at a mount point it creates using a name which is based on the filename of the image file. For instance, clicking on /mnt/sdb1/precise-5.7.1.iso will mount the image at /mnt/+mnt+sdb1+precise-5.7.1.iso, which is also the case if filemnt is run from the command line, like so:
Code:
filemnt /mnt/sdb1/precise-5.7.1.iso

When an .iso file was mounted like that, remasterpup2 worked fine.

So the real problem was that remasterpup2 once expected all .iso files to be mounted that way, when in reality many people simply call mount, like so:
Code:
mkdir /mnt/iso
mount -o loop /mnt/sdb1/precise-5.7.1.iso /mnt/iso


In the line that had the bug, the first s command existed to change this:
Code:
/dev/loop1 on /mnt/+mnt+sdb1+precise-5.7.1.iso type iso9660 (ro,relatime)

to this:
Code:
/dev/loop1 precise-5.7.1.iso type iso9660 (ro,relatime)

The second s command then changed it to this:
Code:
/dev/loop1 precise-5.7.1.iso

This provided an easy to read item in remasterpup2's "Choose the CD/DVD drive..." list, showing the actual name of the .iso file, with no need for the user to horizontally scroll through "/mnt/+mnt+sdb1+" to bring the full name into the window.

But, as you discovered, if one just used the mount command to mount the .iso file, and the mount point didn't happen to contain a plus sign, what happened is that
Code:
/dev/loop1 on /mnt/iso type iso9660 (ro,relatime)

didn't get changed by the first s command, so after the second s command this remained:
Code:
/dev/loop1 on /mnt/iso

which confused Xdialog.


As Karl's post shows, an earlier attempt was once made to fix this bug. Unfortunately, that fix caused a failure for someone, and the fix was reverted. I don't know what circumstances caused the fix to fail, and the user didn't provide details. That fix looked OK to me. (See: http://murga-linux.com/puppy/viewtopic.php?p=547916#547916, http://murga-linux.com/puppy/viewtopic.php?p=551202#551202, http://murga-linux.com/puppy/viewtopic.php?p=554748#554748, http://murga-linux.com/puppy/viewtopic.php?p=554852#554852.)


Anyway, that is just history now, since the code for choosing $VIRTUALCD has been rewritten for new Puppies. And your suggested fix should make remasterpup2 compatible with .iso files that have been mounted with the mount command on any old Puppy that still has the bug.


By the way, in order to prevent confusion I should point out that although the bug you found in Puppy Lucid 5.2.8's remaster script has similar symptoms to the bug for which this thread was created, this is not the same bug. This thread refers to a 2007 version of a 2006 fork of the remaster script, pupremaster.sh, while the bug you found is in remasterpup2, and in a block of code that wasn't added until July 2009.
Back to top
View user's profile Send_private_message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Mon 09 Sep 2013, 22:59    Post_subject:  

Hi Norman !

I have switched to leave the /+ -crap behind in filemnt , instead added a .$$ PID to the end of the mount point .
This is not the most perfect way but until now had no double .$$ PID .

Didn't liked the view of all these long directory names .


My current way of grep ing :
Code:
grep -e '^/dev/loop[0-9]*.*iso9660' /proc/mounts | awk '{print $1 $2}'


NOTE: cut would do also like awk , because special chars like ' ' space are escaped in /proc/mounts with ascii numbers .
bash-3.00.16 unfortunately seems not to work nice using inbuild echo -e to translate special chars back into the original characters - I am using busybox echo -e to do this .

NOTE : The is tr '\n' ' ' ' is nearly never been needed in practice , takes code space and resources .
Back to top
View user's profile Send_private_message Visit_website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Mon 09 Sep 2013, 23:15    Post_subject:  

And sed would look like :
Code:
S="/dev/loop1 on /mnt/+mnt+sdb1+precise-5.7.1.iso type iso9660 (ro,relatime)"
echo "$S" | sed 's%\(/dev/loop[0-9]*\) on \(/.*\) type iso9660 (.*)%\1 \2%' | sed 's%/mnt/.*+%%'
/dev/loop1 precise-5.7.1.iso
Back to top
View user's profile Send_private_message Visit_website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Mon 09 Sep 2013, 23:55    Post_subject:  

And so looks the code in precise-5.5.0 :
Code:
#130222 fix this...
#VIRTUALCD=$(mount -t iso9660|grep '^/dev/loop' | sed -e 's/on[ ].*+//' -e 's/[ ]type[ ]iso9660[ ].*$//')
##VIRTUALCD="`grep -E "loop.*iso9660" /proc/mounts | cut -f 1-2 -d ' ' | tr '\n' ' '`" #110808 PANZERKOPF bug fix. 110822 reverted.
#VIRTUALCD="$(busybox mount | grep -E 'type udf|type iso9660' | cut -f 1,3 -d ' ' | tr '\n' ' ')"
VIRTUALCD=""
#130301 crap, earlier was using losetup-FULL from util-linux git, now using older 2.21.1, it needs -a param,
#but also truncates long lines (same as bb losetup) -- what a nuisance...
#BBLOSETUP="$(losetup-FULL -a | tr '\t' ' ' | tr -d '[:()]' | tr -s ' ')" #130301
for ONELOOP in `cat /proc/mounts | grep -E '(^/dev/loop.*)( udf | iso9660 )' | cut -f 1 -d ' ' | tr '\n' ' '` #130308 /dev/loop only
do
 oPTN="^${ONELOOP} "
 #ONEISO="$(echo "$BBLOSETUP" | grep "$oPTN" | rev | cut -f 1 -d '/' | rev)"
 ONEISO="$(cat /proc/mounts | grep "$oPTN" | cut -f 2 -d ' ' | rev | cut -f 1 -d '+' | cut -f 1 -d '/' | rev)" #130301
 [ "$ONEISO" = "" ] && continue #130301 precaution.
 VIRTUALCD="${VIRTUALCD} ${ONELOOP} ${ONEISO}"
done

LOL

Mainly for udf ...

BTW my puppy-4.3 remasterpup2 does not use any VIRTUALCD variable nor sed command Very Happy .
Back to top
View user's profile Send_private_message Visit_website 
npierce

Joined: 28 Dec 2009
Posts: 858

PostPosted: Tue 10 Sep 2013, 09:04    Post_subject:  

Karl,

Thanks for sharing your methods. It's always nice to learn about alternative ways of doing things. I especially liked your use of back references to the parenthesized subexpressions in your sed command. I often forget that cool stuff like that can be done.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Bugs ( Submit bugs )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0992s ][ Queries: 12 (0.0048s) ][ GZIP on ]