Alright, done. Pcompile 0.1.2, now installing pcompile to /root/my-applications/bin (you can change it in the pet/tgz if you want to, this is more of a bugfix and minor change to see if it works, then I'd suggest building a pet that puts it where it should go. )

Works great by making the pcompile_build directory, which makes for figuring out what got built where easier.

Used it to build the new Glade3, which didn't help in my GUI developing any because it doesn't seem to include things -- and it wouldn't have mattered, because gtkdialog3 requires certain libs that should be included with GTK but aren't, to make Glade files readable as interfaces... so back to the drawing board. Though I did find techno's handy-dandy reference of different functions to copy paste... so I think I'll do that, and then just copy out some stuff and do some copypasta to make it work with the checkboxes.

And I think now I've figured out how to do it. Thanks to your tutorial, and a little help here and there, I've figured out the elusive "notebook" tag, which has made doing this easier, though it's still not pretty.

In any case, it'll be better-ish for those tabs.
I might think it would be a good idea to split the actual file for the dialog to another file, and pcompile be designed to call that dialog and parse the results, then send those to src2all -- since it's a standalone program and can run easily without more than one argument, since it by default just takes a tarball of various types and compiles builds and pets it.

The only thing that concerns me is trying to figure out how to make pcompile pass arguments that have an = in them, as those were previously a challenge... I recall that was funky.

Okay. I'm at a wall here, so until I can figure that out I can't fix the "= in entry" bug we had before.

Instead of sed'ing out the " and = chars beforehand, then grepping, I grep first to get down to the varname="value" level.
From there I strip out the 'varname=' entirely, leaving me with "value".

I can sed out the first ", but I'm trying to kill the second ", and having a hell of a time figuring out a way. All the options with sed seem to match first occurrence, and anything with " in it needs to be preserved, but the last " does NOT need to be preserved, imho.

That is why I was suggesting integrating src2all - maybe a newer version of sed/grep/cat etc... who knows? I never figured that one out, but it is not applicable if you don't have to pass the parameters outside of the script (just paste src2all into the end of pcompile and fix $1, $2 and $3 to use the parameters in pcompile - noone really uses src2all directly - that is what T2 and src2pkg are for)_________________Web Programming - Pet Packaging 100 & 101

actually if you look back at Barry's post maybe you can decode and apply it - at the time it was completely foreign to me - now its still like a 3rd language as I continue to learn the useful bash commands_________________Web Programming - Pet Packaging 100 & 101

First echo's out the value, sends it to grep to pull only WORD1, strips WORD1= (gets rid of that first =, sed's the first ", then does a end-strip of the last ".

Provided gtkdialog doesn't change its behavior for passing back values... this should work. I'd honestly be happy if there was a way to do it without sed...

And I've found that I can do it with that same expansion.
I'm building this as a complex function (well, not THAT complex) but so I can just remember what is happening without quite as hard to read...?

well hell, I got nearly everything I wanted... but I use an eval statement to push a value back OUT to the calling argument from a function... and it strips double quotes, and freaks out with single quotes.

Here's the code I have so far...

Code:

function pc_strip () # pc_strip arg1 arg2.
{
# arg1 should be the name of the var to strip with.
# arg2 should be the name of the variable from gtkdialog.

Apparently, ${x#$2=\"} says: Take $x, strip out from it the contents of $2 plus = plus ", from teh beginning.
Then, ${x%\"} says "take $x, strip the " from the end"
That gets rid of all the questionables, but if the user passes quotes in their args, unfortunately in that "echo $x " - that was arg1" line, it shows them, but when pushed back onto $arg1 using the eval the quotes get nuked by our good friend eval. How to resolve? I do want to do this with functions, so that the actual text in the script is more legible, and to minimize retyped stuff.

actually if you look back at Barry's post maybe you can decode and apply it - at the time it was completely foreign to me - now its still like a 3rd language as I continue to learn the useful bash commands

Honestly if I can't get it to keep the quotes it's no really big deal, but oh well.

If I don't have any idea by tomorrow how to get those quotes through, I'll just have it pass back and say whatever. As it is, it's still tremendous that I can get this to work that well.

I'm thinking, for checkboxes, I think there MAY be a way to have it be independent of the entries, but I don't know. I'm thinking this program is becoming complex enough I may look into freebasic for it... because that might be faster.

Sadly, no, inside the string quoted stuff is passed without the loveliness of the backslash. I tried RELIGIOUSLY to change it, but it wouldn't take.

At this point I'm about giving up on keeping those quotes, since it's a compile-time option setting usually quotes shouldn't be there.

amigo wrote:

You need the 'g' global option to sed:

sed 's/\"//g'

I know /g is a global functionality, I don't require that to nuke things. In fact I've nuked sed from usage entirely except in one instance that I can think of.

At this time I'm gonna go ahead and punch it in as a function and try to see if I can't make it checkbox-independent (meaning that ANY checkboxes, if name-formatted correctly, will be handled by some form of loop to add their function in -- this way furhter editing of the code won't be required if the actual interface is changed to add new 'defaults'.

Oh, and the flags strings you mentioned will be hardcoded - I'm not gonna try to have those pass, simply because they're quote-surrounded, and I'm getting absolutely sick of quotes.

Hope you don't feel bothered that I kinda threadjacked here and started making additions, but you hadn't updated it in a while and I saw room for other niceties <G> Hell maybe my version'll fizzle out and I'll recommend going back to the 0.1.0 (which worked rather well aside from the two glitches I fixed through 0.1.1...

So I just realized... since "eval" does some quote stripping all to hell... I don't NEED to strip quotes. I just eval it out, and make it go back out there, and the function instantly shortens in size and in content.

New function code:

Code:

function pc_strip () # pc_strip arg1 arg2.
{
# arg1 should be the name of the var to strip with.
# arg2 should be the name of the variable from gtkdialog.

I feel efficient. Well, not as efficient, I'm doing memory dereferences in a function in bash, but theoretically since all these functions are bash-internals, they should run much faster than an outside program like sed!

EDIT: Oooh, and single quotes are fine!!! I think that'll do pig! That'll do! HAHAHAHHA!

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum