| Author |
Message |
amigo
Joined: 02 Apr 2007 Posts: 1776
|
Posted: Fri 27 Mar 2009, 16:51 Post_subject:
|
|
To handle spaces in path or file names, you need to double quote the places where you are handling the paths in your scripts. You can create a couple of test paths to check the functionality. I recently added support for spaces in paths in my src2pkg program. It was a nightmare since src2pkg is around 10,000 lines of bash script with path-handling every 5-10 lines! The moral is -get that working before you add too much code -I nearly went nuts finding all the places I needed to change the code...
|
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2407 Location: Montenegro
|
Posted: Fri 27 Mar 2009, 16:57 Post_subject:
|
|
Can you see any place in my script I didn't double quote?
Cause I don't, it stays as it is if someone with more knowledge doesn't change it, I'm not making any changes from now on...
_________________

|
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2407 Location: Montenegro
|
Posted: Fri 27 Mar 2009, 17:26 Post_subject:
|
|
maybe using bash instead of sh for interpreter? It worked for my madplay dialog? Didn't want to play songs that had spaces even when double qouted, but when I change to bash it works?
_________________

|
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2407 Location: Montenegro
|
Posted: Fri 27 Mar 2009, 17:33 Post_subject:
|
|
nope, doesn't work.
_________________

|
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2407 Location: Montenegro
|
Posted: Fri 27 Mar 2009, 18:24 Post_subject:
|
|
Yaaayyy! I found it!
The problem was in basename command, replaced
| Code: | | FOLDR=`basename $(echo "$FOLDR")` |
with
| Code: | | FOLDR=`basename "$FOLDR"` |
and now everything works OK! That's all from me guys, I'm satisfied with this now!
Package reuploaded.
_________________

|
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2407 Location: Montenegro
|
Posted: Fri 27 Mar 2009, 18:45 Post_subject:
|
|
LOL, guess what? Petget cannot install pets that are placed in a directory with spaces in filename? I just tested conversion of rpms and debs on LiveCD and wanted to install them immidiately after, but I couldn't install them when clicked on them. So I thought I made something wrong with the script, so they are not packed right, but no, when I copied converted pets into my-documents, they installed OK on click!
_________________

|
|
Back to top
|
|
 |
Dingo

Joined: 11 Dec 2007 Posts: 1398 Location: somewhere at the end of rainbow...
|
Posted: Fri 27 Mar 2009, 19:34 Post_subject:
|
|
this script has no GUI? How can I make a GUi for this?
_________________ replace .co.cc with .info to get access to stuff I posted in forum
dropbox 2GB free
OpenOffice for Puppy Linux
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3845
|
Posted: Fri 27 Mar 2009, 19:44 Post_subject:
|
|
I've posted some stuff on gtkdialog here:
http://www.murga-linux.com/puppy/viewtopic.php?t=40361
you can use that and/or Xdialog to make a simple gui
I like to use Xdialog from within a gtkdialog script to get inputs and display messages ... makes it somewhat smaller
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2407 Location: Montenegro
|
Posted: Fri 27 Mar 2009, 19:49 Post_subject:
|
|
| Dingo wrote: | | this script has no GUI? How can I make a GUi for this? |
I thought it was more simple to do right click in rox -> Convert pet
There's a line for Xdialog in there too, if you want it that way, just uncomment line 2 from script and comment line 3
Open /usr/local/bin/deb2pet in geany (and/or rpm2pet)
| Code: |
#DEB=`Xdialog --title "Select file" --wrap --fselect *.deb 0 0 2>&1`
DEB=$1 |
^Just uncomment line where it says Xdialog, and comment the one under that
EDIT: There's a line at the bottom which says rox, u can uncomment that too if you want folder containing the pet to open after conversion
There's a version in the main post that works with xdialog and has a menu entry under utilities
_________________

|
|
Back to top
|
|
 |
DMcCunney
Joined: 02 Feb 2009 Posts: 894
|
Posted: Sat 28 Mar 2009, 13:46 Post_subject:
|
|
| dejan555 wrote: | | LOL, guess what? Petget cannot install pets that are placed in a directory with spaces in filename? |
Why do you have a directory with spaces in the filename?
Windows permits that particular abomination, but *nix is generally allergic to it. Various globbing routines don't understand that the space is part of the directory name without special quoting, and will attempt to treat what comes after the space as a separate argument.
It should not be a surprise that PetGet will fail in that circumstance.
______
Dennis
|
|
Back to top
|
|
 |
Runemaster

Joined: 05 Aug 2006 Posts: 180 Location: Albany, GA U.S.
|
Posted: Sat 28 Mar 2009, 14:53 Post_subject:
help meh plz! |
|
I have no idea what im doing wrong (im pretty sure it's me doing something wrong.
ok installed deb2pet and rpm2pet and if i was supposed to put it in a specific folder then i guess i didnt see it because I read all the posts
So i download a .deb or .rpm file and i right click on it and click on turn into pet or whatever it is and it creates a tar files out of the deb or rpm file and makes a blank word document called whatever the file was and adds the .pet extension to it and nothing will do anything.
if this is what it is supposed to do then i got lost in translation and it doesent do what i thought it would do.
any help is greatly appreciated.
_________________ Adventurer: I seek knowledge and strength.
Seer:Knowledge comes from experience.....Strength comes from battleaxes.
|
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2407 Location: Montenegro
|
Posted: Sat 28 Mar 2009, 16:13 Post_subject:
|
|
| DMcCunney wrote: |
Why do you have a directory with spaces in the filename?
|
I normally don't, only wanted to be sure that if someone did have it, he/she doesn't have errors when trying to convert. Me personally don't use folders with spaces.
@Runemaster
Don't know what you're exactly saying, script is supposed to repack deb or rpm package to pet, so any contents that where in deb are now in converted pet, if this doesn't work I'll have to test this again, maybe I damaged something in script when changing that basename command, if anyone else had this problem please post it here. Runemaster, you can also try installing some other version that is attached and see if works, but I tested this last one, and it worked? Also, did you install unrpm, undeb pet, I think older puppy versions didn't have undeb?
_________________

|
|
Back to top
|
|
 |
droope

Joined: 31 Jul 2008 Posts: 814 Location: Uruguay, Mercedes
|
Posted: Sat 28 Mar 2009, 22:05 Post_subject:
|
|
We should figure a way of making it look for libraries. Nowhere near impossible. Nowhere near my possibilities tho
|
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2407 Location: Montenegro
|
Posted: Sun 29 Mar 2009, 05:38 Post_subject:
|
|
You mean like checking dependencies?
Petget does it while installing pet.
And for deb2pet and rpm2pet you only need to installunrpm.undeb.pet from MU's post from the first page
_________________

|
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2407 Location: Montenegro
|
Posted: Fri 10 Apr 2009, 05:03 Post_subject:
|
|
Converting multiple packages at once:
If you use rox right click version of the script, you can convert multiple packages this way. Put all debs in one folder, then open terminal in that folder and type:
| Code: |
for i in *.deb; do deb2pet "$i"; done
|
_________________

|
|
Back to top
|
|
 |
|