Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (16) </ ... 4 5 6 7 8 [9] 10 11 12 13 14 ... >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: MyDSL info parser, prototype< Next Oldest | Next Newest >
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Mar. 19 2008,12:07 QUOTE

Quote (roberts @ Mar. 17 2008,21:39)
All of your scripts specify
Quote
#!/home/dsl/bin/murgaLua-0.6.4

Which would naturally lead one such assumption as it is not needed in DSL unless features that are only available in 0.6.4.were being attempted.

I see.

I use the newer interpreter when testing newer features. It is not a requirement, though. Anything I write for use in DSL should be useable with murgaLua 0.5.5. The features of newer versions are used only if they are available....
Code Sample
if Fl_Browser.column_widths then
 results:column_widths({results:w()/2,150,0})
 spacer="\t"
else spacer="\t\t" -- force some extra space for older versions


Sometimes I remove the interpreter line when uploading, but usually I don't think about it.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: Mar. 30 2008,03:52 QUOTE

Might be an issue with os.rename and the new mydslBrowser.lua formerly known as mydsl info parser.

It becomes apparent with the standard grub pendive installation, where the first partition is fat32 and the second is ext2.

Upon first invocation of the script, you can see the download of the mydslinfo.bz2 occur via wget but the result is:

"Cannot read database /mnt/sda1/mydsl/mydslinfo.bz2"
"Please try updating again.

Upon each attempt at such results in the same message, each with another copy of mydslinfo.bz2 named as a lua tempfile. in the /tmp directory  An endless loop.

Appears that line:

os.rename(tempfile,listfile)

quietly fails.

This can duplicated by:
Code Sample

#!/bin/lua
listfile = "/mnt/sda1/mydsl/mydslinfo.bz2"
tempfile = "/tmp/lua_xCjkEa"
os.rename(tempfile,listfile)


Where /mnt/sda1 is fat32 and /tmp is ext2.

This issue involves 4.3RC1.

This was not an issue in early versions of the script.
Back to top
Profile PM WEB 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Mar. 30 2008,10:34 QUOTE

I assume "early versions" would be prior to March 15, when the messy version (i.e. overwriting with an empty file) of the updatedb function was still being used.

Considering the apparent simplicity of the function, I can't see how the script itself is faulty (not saying I'm genius of course).
Perhaps there is an issue with fat32 + os.rename. The error you mentioned occurs if the database file is empty or non-existent, so I'm guessing it's not being moved. I can't think of any reason for this other than a problem with rename.

I assume the temp file download completes, since you didn't get the error "Database check failed".

What happens if you replace os.rename(tempfile,listfile) with os.execute("sudo mv -f "..tempfile.." "..listfile)?


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: Mar. 30 2008,13:41 QUOTE

I think that what I said with the first six words that I posted as well as the code posted. os.rename fails. I was just pointing that fact out.

Naturally the native mv works across different filesystems or we would all in trouble

sudo is not needed with the os.execute of the mv command as the target mydsl/ is setup with proper permissions.

I will make that adjustment to your script.
Back to top
Profile PM WEB 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Mar. 30 2008,13:54 QUOTE

Quote
sudo is not needed with the os.execute of the mv command as the target mydsl/ is setup with proper permissions.
I just thought there might be a chance of problems with moving (as opposed to copying) from fat32. I have no experience with it, and know you're smart enough to notice that sudo is there =o)

Thanks. I'll make the change on my end too.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
76 replies since Jan. 13 2008,15:39 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (16) </ ... 4 5 6 7 8 [9] 10 11 12 13 14 ... >/
reply to topic new topic new poll
Quick Reply: MyDSL info parser

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code