Beta Firefox 3.6.6


mcobit said:
I have the latest version downloaded above and before i started it, I deleted the firefox folder from pandora/appdata on the sd and from /pandora/appdata on the nand.
Whe I run this, it seems to create a new firefox folder in both locations: on the nand an d on the sd.

Is this intended?
It's not intended. I'm guessing I still don't understand the PND system. More reading required. :(
 
Last edited by a moderator:
hdonk said:
mcobit said:
I have the latest version downloaded above and before i started it, I deleted the firefox folder from pandora/appdata on the sd and from /pandora/appdata on the nand.
Whe I run this, it seems to create a new firefox folder in both locations: on the nand an d on the sd.

Is this intended?
It's not intended. I'm guessing I still don't understand the PND system. More reading required. :(

Just to clarify: A PND's CWD is its appdata folder, so by setting HOME to the CWD, you should fix the problem.

EDIT: See my above post to find some commands that might help you.

-God Ginrai
 
Last edited by a moderator:
God Ginrai said:
hdonk said:
mcobit said:
I have the latest version downloaded above and before i started it, I deleted the firefox folder from pandora/appdata on the sd and from /pandora/appdata on the nand.
Whe I run this, it seems to create a new firefox folder in both locations: on the nand an d on the sd.

Is this intended?
It's not intended. I'm guessing I still don't understand the PND system. More reading required. :(

Just to clarify: A PND's CWD is its appdata folder, so by setting HOME to the CWD, you should fix the problem.

EDIT: See my above post to find some commands that might help you.

-God Ginrai
I don't believe that's correct - the CWD is specified in the PXML, which in the case of Firefox is the root of the mounted pnd filesystem. Can you give a link to where you're getting that info from? Cheers.
 
Last edited by a moderator:
hdonk said:
God Ginrai said:
hdonk said:
mcobit said:
I have the latest version downloaded above and before i started it, I deleted the firefox folder from pandora/appdata on the sd and from /pandora/appdata on the nand.
Whe I run this, it seems to create a new firefox folder in both locations: on the nand an d on the sd.

Is this intended?
It's not intended. I'm guessing I still don't understand the PND system. More reading required. :(

Just to clarify: A PND's CWD is its appdata folder, so by setting HOME to the CWD, you should fix the problem.

EDIT: See my above post to find some commands that might help you.

-God Ginrai
I don't believe that's correct - the CWD is specified in the PXML, which in the case of Firefox is the root of the mounted pnd filesystem. Can you give a link to where you're getting that info from? Cheers.

Pandora Wiki said:
Recommended layout of a pnd directory structure, ie: how to make a well behaved pnd file

These are guidelines to make pnd-files 'well behaved', and to help move towards a consistent pnd structure.
  • Always include your icon png-file and PXML.xml file in the _Root_ of the pnd-file; this is for reasons that folks may well unpack the pnd-file, and then repack it; in doing so, if the icon and PXML.xml (normally appended to the .iso to become a .pnd) will be lost, unless the user or tool is being careful. Thus, it is wise to include them within the .iso, to make things so the iso is the entire pnd application, in unpacked form.
  • Use a 'reasonably unique' unique-id of course (to identify your application.) This is used for many internal uses, so uniqueness is pretty wise.
  • Use an 'application relevent' appdata name; make it as unique as you have to, but consider being less unique; a random example could be .. possibly there may be several quake1 ports; they could all share the same appdata (same config files, same data files), but if you intend on having different config or data files than other quake1's, make your appdata named differently.
  • Always include a documentation 'info' link, if your app has any setup requirements, has popup help screens that the user needs to know a key to pop up, or other essential trivia; feel free to make the doc link as complete as you like, since its all within the pnd file. (ie: Include the full DosBox documentation if you want to, in your DosBox pnd :)
  • Try to set up the appdata directory for the user; if you need a 'roms' or 'image' directory in the appdata (such as in the case of an Atari ST emulator needing a location to house the TOS OS image, say), then do a 'mkdir' in your 'runscript', to create it. Thus the user will find a (example) Hatari appdata directory, and within, any directories he needs (possibly empty.) This just makes it obvious for the user where to put stuff.
  • Try using rudimentary zenity scripts to pop up imporant pre-run information, if the application can't do so; ie: Hatari itself has a very fine GUI in it, but if the Atari ST TOS image is not present, it just exits and fails to run, so the GUI doesn't have time to do anything useful. In this case, it could be wise to use a 1 line zenity script that checks before the emu runs for the file in question, then pop up a dialog box saying 'put this file /here', so the user knows what the heck happened
  • Always Always Always write your 'state info' to current-working-directory (ie: ./foo, and not ~/foo). The pnd-system will redirect this to the users appdata of course, keeping things clean and predictable. If you're just porting an app, that has ~ all over the darned place, and you don't want to muck up the code.. just have your 'runscript' do something like 'set $HOME=.' and you're good to go!
  • Runscripts; the PXML.xml can specify to run your binary, or you can run a .sh script that in turn runs your binary, say. This lets you do various tests, set up LD_LIBRARY_PATH, or other mischief before your binary gets run. Very handy. I often have PXML.xml run 'runfoo.sh', and runfoo.sh in turn runs ./foo after setting things up, making directories, etc.
  • For data that is not kept in your appdata directory, try to keep it local to the current SD _or_ better still, search both SD. ie: libpnd uses a basic but really handy system for iterating across a list of directories (including glob type expansion); so you can tell it something like /media/*/foo:/tmp and it'll check every mounted device (including both SD slots) in the 'foo' directory, as well as /tmp; you can have it call your code as it looks through, or you can ask libpnd to find a file for you and report where it was found, across all your searchpaths; you don't have to use libpnd's code to do it, you coudl write oyur own (using libpnd as an example if you need the help), as its pretty easy to build (20 lines of code maybe?) Anyway, the trick is to be multi-SD aware, and bonus marks for handling if theres a USB mounted drive etc as well. (Example; I coded minimenu so that when it caches out a preview picture, it checks for free space first, and tries first on the same SD that the pnd is mounting from, and then across a searchpath of alternate locations to cache to; this way the user can customize the caching, and it can be on various devices.)

Here's the link to the Page: http://www.pandorawiki.org/Pnd

-God Ginrai
 
Last edited by a moderator:
hdonk said:
I don't believe that's correct - the CWD is specified in the PXML, which in the case of Firefox is the root of the mounted pnd filesystem. Can you give a link to where you're getting that info from? Cheers.
The CWD (startdir) can be specified in the PXML, but it should be a relative path (= _not_ starting with '/', that is NAND root). And startdir is an optional attribute, default is ".". After you're sure it's starting in the right folder, you can set home to be there like this:
export HOME="$(pwd)"
 
Last edited by a moderator:
urjaman said:
hdonk said:
I don't believe that's correct - the CWD is specified in the PXML, which in the case of Firefox is the root of the mounted pnd filesystem. Can you give a link to where you're getting that info from? Cheers.
The CWD (startdir) can be specified in the PXML, but it should be a relative path (= _not_ starting with '/', that is NAND root). And startdir is an optional attribute, default is ".". After you're sure it's starting in the right folder, you can set home to be there like this:
export HOME="$(pwd)"

$(pwd) or $(cwd)?

-God Ginrai
 
Last edited by a moderator:
God Ginrai said:
urjaman said:
hdonk said:
I don't believe that's correct - the CWD is specified in the PXML, which in the case of Firefox is the root of the mounted pnd filesystem. Can you give a link to where you're getting that info from? Cheers.
The CWD (startdir) can be specified in the PXML, but it should be a relative path (= _not_ starting with '/', that is NAND root). And startdir is an optional attribute, default is ".". After you're sure it's starting in the right folder, you can set home to be there like this:
export HOME="$(pwd)"

$(pwd) or $(cwd)?

-God Ginrai
pwd = print working directory
$( <command> ) = this is replaced with the commands output
"" = so that the resulting path handles spaces properly
thus, $(pwd)
 
Last edited by a moderator:
Ok, so I've had a play.
I hadn't realised that through the magic of overlayed filesystems that writing to the cwd would write in to the (correct?) appdata directory.

So I've changed the run script to the following:
Code:
#!/bin/sh
if [ \! -e .mozilla ]; then
   if [ -e ${HOME}/.mozilla ]; then
      gksudo --description 'Copying old settings directory' "cp -a ${HOME}/.mozilla ."
      if [ $? \!\=0 ]; then
         zenity --error --title="Problem" \
        --text "Copy of old settings failed" --timeout 6
        exit 1
      fi
      mv ${HOME}/.mozilla ${HOME}/.mozilla-old
   else
      gksudo --description 'Settings directory setup' "mkdir .mozilla"
      if [ $? \!\=0 ]; then
         zenity --error --title="Problem" \
        --text "Creating new settings directory failed" --timeout 6
        exit 1
      fi
      gksudo --description 'Settings directory setup' "chown ${USER} .mozilla"
      if [ $? \!\=0 ]; then
         zenity --error --title="Problem" \
        --text "Changing ownership of settings directory failed" --timeout 6
        exit 1
      fi
   fi
fi

export HOME=.
./bin/firefox
The idea being that:
1) If you already have a .mozilla directory, it will be moved to the appdata directory.
2) If you don't have a .mozilla directory, it will be created in the appdata directory.
3) The ownership will be correct (This is added because I was testing with root and my login user and had a conflict)

If you guys are happy with this, I'll repackage. I'm not doing it until you are though :)
 
hdonk said:
Ok, so I've had a play.
I hadn't realised that through the magic of overlayed filesystems that writing to the cwd would write in to the (correct?) appdata directory.

So I've changed the run script to the following:
Code:
#!/bin/sh
if [ \! -e .mozilla ]; then
   if [ -e ${HOME}/.mozilla ]; then
      gksudo --description 'Copying old settings directory' "cp -a ${HOME}/.mozilla ."
      if [ $? \!\=0 ]; then
         zenity --error --title="Problem" \
        --text "Copy of old settings failed" --timeout 6
        exit 1
      fi
      mv ${HOME}/.mozilla ${HOME}/.mozilla-old
   else
      gksudo --description 'Settings directory setup' "mkdir .mozilla"
      if [ $? \!\=0 ]; then
         zenity --error --title="Problem" \
        --text "Creating new settings directory failed" --timeout 6
        exit 1
      fi
      gksudo --description 'Settings directory setup' "chown ${USER} .mozilla"
      if [ $? \!\=0 ]; then
         zenity --error --title="Problem" \
        --text "Changing ownership of settings directory failed" --timeout 6
        exit 1
      fi
   fi
fi

export HOME=.
./bin/firefox
The idea being that:
1) If you already have a .mozilla directory, it will be moved to the appdata directory.
2) If you don't have a .mozilla directory, it will be created in the appdata directory.
3) The ownership will be correct (This is added because I was testing with root and my login user and had a conflict)

If you guys are happy with this, I'll repackage. I'm not doing it until you are though :)
Umm, why do you need sudo to copy the files? I mean if you can mv them (just after that cp) you should be able to cp them too. For chown i understand if you really think people have run firefox as root but with HOME set to their home and have an ext2 card (oh what a case...), and with that cp command below, never. FAT32 cards can't store user names /permissions, so as long as the old .mozilla dir can be read (and you already assumed you can move it...), all should be fine. Also you could run cp like this: cp -dR --preserve=timestamps , which is equivalent to cp -a but will not attempt to preserve mode and ownership (both not useful on FAT32).
 
Last edited by a moderator:
urjaman said:
hdonk said:
Ok, so I've had a play.
I hadn't realised that through the magic of overlayed filesystems that writing to the cwd would write in to the (correct?) appdata directory.

So I've changed the run script to the following:
Code:
#!/bin/sh
if [ \! -e .mozilla ]; then
   if [ -e ${HOME}/.mozilla ]; then
      gksudo --description 'Copying old settings directory' "cp -a ${HOME}/.mozilla ."
      if [ $? \!\=0 ]; then
         zenity --error --title="Problem" \
        --text "Copy of old settings failed" --timeout 6
        exit 1
      fi
      mv ${HOME}/.mozilla ${HOME}/.mozilla-old
   else
      gksudo --description 'Settings directory setup' "mkdir .mozilla"
      if [ $? \!\=0 ]; then
         zenity --error --title="Problem" \
        --text "Creating new settings directory failed" --timeout 6
        exit 1
      fi
      gksudo --description 'Settings directory setup' "chown ${USER} .mozilla"
      if [ $? \!\=0 ]; then
         zenity --error --title="Problem" \
        --text "Changing ownership of settings directory failed" --timeout 6
        exit 1
      fi
   fi
fi

export HOME=.
./bin/firefox
The idea being that:
1) If you already have a .mozilla directory, it will be moved to the appdata directory.
2) If you don't have a .mozilla directory, it will be created in the appdata directory.
3) The ownership will be correct (This is added because I was testing with root and my login user and had a conflict)

If you guys are happy with this, I'll repackage. I'm not doing it until you are though :)
Umm, why do you need sudo to copy the files? I mean if you can mv them (just after that cp) you should be able to cp them too. For chown i understand if you really think people have run firefox as root but with HOME set to their home and have an ext2 card (oh what a case...), and with that cp command below, never. FAT32 cards can't store user names /permissions, so as long as the old .mozilla dir can be read (and you already assumed you can move it...), all should be fine. Also you could run cp like this: cp -dR --preserve=timestamps , which is equivalent to cp -a but will not attempt to preserve mode and ownership (both not useful on FAT32).

I agree with urjaman's sentiments.

-God Ginrai
 
Last edited by a moderator:
God Ginrai said:
urjaman said:
hdonk said:
Ok, so I've had a play.
I hadn't realised that through the magic of overlayed filesystems that writing to the cwd would write in to the (correct?) appdata directory.

So I've changed the run script to the following:
Code:
#!/bin/sh
if [ \! -e .mozilla ]; then
   if [ -e ${HOME}/.mozilla ]; then
      gksudo --description 'Copying old settings directory' "cp -a ${HOME}/.mozilla ."
      if [ $? \!\=0 ]; then
         zenity --error --title="Problem" \
        --text "Copy of old settings failed" --timeout 6
        exit 1
      fi
      mv ${HOME}/.mozilla ${HOME}/.mozilla-old
   else
      gksudo --description 'Settings directory setup' "mkdir .mozilla"
      if [ $? \!\=0 ]; then
         zenity --error --title="Problem" \
        --text "Creating new settings directory failed" --timeout 6
        exit 1
      fi
      gksudo --description 'Settings directory setup' "chown ${USER} .mozilla"
      if [ $? \!\=0 ]; then
         zenity --error --title="Problem" \
        --text "Changing ownership of settings directory failed" --timeout 6
        exit 1
      fi
   fi
fi

export HOME=.
./bin/firefox
The idea being that:
1) If you already have a .mozilla directory, it will be moved to the appdata directory.
2) If you don't have a .mozilla directory, it will be created in the appdata directory.
3) The ownership will be correct (This is added because I was testing with root and my login user and had a conflict)

If you guys are happy with this, I'll repackage. I'm not doing it until you are though :)
Umm, why do you need sudo to copy the files? I mean if you can mv them (just after that cp) you should be able to cp them too. For chown i understand if you really think people have run firefox as root but with HOME set to their home and have an ext2 card (oh what a case...), and with that cp command below, never. FAT32 cards can't store user names /permissions, so as long as the old .mozilla dir can be read (and you already assumed you can move it...), all should be fine. Also you could run cp like this: cp -dR --preserve=timestamps , which is equivalent to cp -a but will not attempt to preserve mode and ownership (both not useful on FAT32).

I agree with urjaman's sentiments.

-God Ginrai
I don't! I use ext2, so permissions & ownership are important to me, so I'd rather go overkill than underkill.
The sudo is needed in case the destination is non-current-user owned. The mv renames directories in the user's home dir, so no extra privs are needed. It's all been added to cope with edge conditions that I have run into.
As for using -ne instead of \!\=, I use -ne for string comparisons & \!\= for numerical comparisons, as a stylistic thing. As for the escapes, I've encountered versions of busybox bash that don't recognise those operators without the escape. So as it does no harm, I'd rather have them in there.
Anyway, enough of the discussion of my coding style. The question was whether this achieves what you want in terms of configuration in the right place. Given the nitpicking hasn't covered that, I'm assuming it's ok, and I'm going ahead with packaging it up. If you're not happy, make your own version. Ner ner ner. (Picks up toys and goes sulk)
:D B) :D
 
Last edited by a moderator:
hdonk said:
As for using -ne instead of \!\=, I use -ne for string comparisons & \!\= for numerical comparisons, as a stylistic thing. As for the escapes, I've encountered versions of busybox bash that don't recognise those operators without the escape. So as it does no harm, I'd rather have them in there.

It's not a problem of coding style, but a problem of conformance as per : http://www.gnu.org/software/bash/manual/bashref.html#Bash-Conditional-Expressions

!= operator compare strings
-ne -eq etc operators compare integer...
And to be standard sh compliant string comparaison have to be done this way :
if [[ "string1" != "string2" ]];then

but I guess your script work so never mind....
 
Last edited by a moderator:
sebt3 said:
hdonk said:
As for using -ne instead of \!\=, I use -ne for string comparisons & \!\= for numerical comparisons, as a stylistic thing. As for the escapes, I've encountered versions of busybox bash that don't recognise those operators without the escape. So as it does no harm, I'd rather have them in there.

It's not a problem of coding style, but a problem of conformance as per : http://www.gnu.org/software/bash/manual/bashref.html#Bash-Conditional-Expressions

!= operator compare strings
-ne -eq etc operators compare integer...
And to be standard sh compliant string comparaison have to be done this way :
if [[ "string1" != "string2" ]];then

but I guess your script work so never mind....
You're absolutely right, that is the compliant way, but as both ways works, I've used the way that makes sense to me - symbols list >, <, =, etc for numbers and -ne -le -lt, whatever for strings just (to me) looks right. It may not be POSIX, but IDC. :rolleyes:
D!
 
Last edited by a moderator:
hdonk said:
I don't! I use ext2, so permissions & ownership are important to me, so I'd rather go overkill than underkill.
The sudo is needed in case the destination is non-current-user owned. The mv renames directories in the user's home dir, so no extra privs are needed. It's all been added to cope with edge conditions that I have run into.
As for using -ne instead of \!\=, I use -ne for string comparisons & \!\= for numerical comparisons, as a stylistic thing. As for the escapes, I've encountered versions of busybox bash that don't recognise those operators without the escape. So as it does no harm, I'd rather have them in there.
Anyway, enough of the discussion of my coding style. The question was whether this achieves what you want in terms of configuration in the right place. Given the nitpicking hasn't covered that, I'm assuming it's ok, and I'm going ahead with packaging it up. If you're not happy, make your own version. Ner ner ner. (Picks up toys and goes sulk)
:D B) :D
Random comments follow. Not copying ownership => you will own the copied files == good thing (as you dont need to chown them FFS). You can add permissions to copyable things which would in this case (i think) do no harm, but dont see a reason to copy them. I think a pnd shouldnt have to handle the case of it's cwd being unwritable by the current user. Busybox doesnt have bash. It has a few shells, most of you've propably met ash as a busybox shell (There's others, like hush & msh (i <3 msh))). I think its ok to escape those "!"'s as there seems to be no ill effect.
 
Last edited by a moderator:
urjaman said:
[andom comments follow. Not copying ownership => you will own the copied files == good thing (as you dont need to chown them FFS). You can add permissions to copyable things which would in this case (i think) do no harm, but dont see a reason to copy them. I think a pnd shouldnt have to handle the case of it's cwd being unwritable by the current user. Busybox doesnt have bash. It has a few shells, most of you've propably met ash as a busybox shell (There's others, like hush & msh (i <3 msh))). I think its ok to escape those "!"'s as there seems to be no ill effect.
You know, I agree with you re the ownership it, etc - and I'm close to being persuaded to do it your way on the assumption that everything is hunky dory in the setup the PND is being run. However if I do it that way and people run in to problems, I *will* blame it on you - 'urjaman made me do it!' :)
As I said I made it this way because I ran in to problems due to how I've been using my Pandora - multi users, changing default UID numbers, doing testing as root, etc, and doing it this way worked around those problems.
 
Last edited by a moderator:
hdonk said:
urjaman said:
[andom comments follow. Not copying ownership => you will own the copied files == good thing (as you dont need to chown them FFS). You can add permissions to copyable things which would in this case (i think) do no harm, but dont see a reason to copy them. I think a pnd shouldnt have to handle the case of it's cwd being unwritable by the current user. Busybox doesnt have bash. It has a few shells, most of you've propably met ash as a busybox shell (There's others, like hush & msh (i <3 msh))). I think its ok to escape those "!"'s as there seems to be no ill effect.
You know, I agree with you re the ownership it, etc - and I'm close to being persuaded to do it your way on the assumption that everything is hunky dory in the setup the PND is being run. However if I do it that way and people run in to problems, I *will* blame it on you - 'urjaman made me do it!' :)
As I said I made it this way because I ran in to problems due to how I've been using my Pandora - multi users, changing default UID numbers, doing testing as root, etc, and doing it this way worked around those problems.

I'm fine with that. As far as the setup being fine, it looks right to me, BUT I am not too well versed in bash scripting, so I don't know all that is going on there.

-God Ginrai
 
Last edited by a moderator:
There's a PND with the gksudo version & the HOME=. script here:

firefox366-3.pnd

I'll have it on the appstore when it uploads ok.

Edit: On that note, I'm going to catch some Zzzs. Ice time 6am!
 
hdonk said:
There's a PND with the gksudo version & the HOME=. script here:

firefox366-3.pnd

I'll have it on the appstore when it uploads ok.

Edit: On that note, I'm going to catch some Zzzs. Ice time 6am!

Awesome. Will test it out and let you know how everything works. Thanks a bunch. ^_^

EDIT: Sadly, this PND does not even run for me. :(

-God Ginrai
 
Last edited by a moderator:
hdonk said:
There's a PND with the gksudo version & the HOME=. script here:

firefox366-3.pnd

I'll have it on the appstore when it uploads ok.

Edit: On that note, I'm going to catch some Zzzs. Ice time 6am!
You forgot chmod +x firefox.sh, thus this wont run.
 
Last edited by a moderator:
Back
Top