Thread: [Bashburn-info] Some more changes coming at you.
Brought to you by:
bashburn
|
From: Steven W. O. <st...@sy...> - 2008-08-29 02:44:21
|
Lots of little cleanup stuff.
Lots more reduction in the number of processes that get created.
Henceforth and forthwith, all local variables should be lower case. All
global variables should be uppercase. This is a *very* old trick I learned
on an old and now very defunct operating system that required it.
I'm finding lots of global variables that are being set when the simple
return value of a function could suffice.
I'm finding a few places where a global variable is set unconditionally
and then tested later to see if something should be done. All ripped out.
More case insensitive stuff ripped out.
All of the read commands are now read -e. Anders, I was not able to
reproduce your problem that you earlier described: " enter a number and
press backspace, the prompt gets deleted". If you still see the problem, I
will need more explicit info on how to reproduce.
I fixed the menu header problem.
is_dir_empty is now actually used all the places where it should have been
before. Also, it is now greatly simplified.
delete_data had an interesting idea
while true
do
read soemthing
if something
then
do something
break
else
do something else
break
fi
done
instead, how about
read soemthing
if something
then
do something
else
do something else
fi
Look Ma! No loops!
Here's a good one:
echo $(du -shL ${BBBURNDIR}) | cut -d ' ' -f 1
becomes
du -shL ${BBBURNDIR} | cut -d $'\t' -f 1
break or continue is wrong unless you're actually in a loop!
I see a number of things like this:
if something
then
do something
wait for enter
else
do something else
wait for enter
fi
I factored out the wait for enter. In some cases it was slightly dramatic.
Sombody should please look at what I did in audiofunc.sh in named. The
comment says
# If nothing is entered at the prompt then exit loop.
continue
I assumed the comment was wrong and not the code. It's now restructured.
Here's a good one:
if [[ "$answer" == y ]]
then
return 0
else
return 1
fi
is now
[[ "$answer" == y ]]
Remember that status is always equal to the last thing you did.
in xmmsread, I broke out a small bit of awk magic and saved a process:
done < <(grep -s [Mm][Pp]3 "${FILE}" | grep -v EXTINF)
vs
done < <(awk 'BEGIN{IGNORECASE=1} /mp3/ && !/EXTINF/' "${file}")
Guys, PLEASE look at what I've done. I'm getting lonely here and I need
you guys to keep me honest. I never make any misteaks but there's this
thing called Murphy's Ultimate corollary: If it could have gone wrong
earlier and it didn't, then it ultimately would have been beneficial for
it to have.
--
Time flies like the wind. Fruit flies like a banana. Stranger things have .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net
|
|
From: Nick W. <ni...@uk...> - 2008-08-29 12:42:52
|
On Thu, 28 Aug 2008 22:44:29 -0400 (EDT) "Steven W. Orr" <st...@sy...> wrote: > Guys, PLEASE look at what I've done. I'm getting lonely here and I > need you guys to keep me honest. I never make any misteaks but > there's this thing called Murphy's Ultimate corollary: If it could > have gone wrong earlier and it didn't, then it ultimately would have > been beneficial for it to have. Steve, I have recently got a new box (AMD64) and have been busy transferring data and stuff the last 14 days or so. I think this will be a good time to get latest svn BB and test it out, as I have yet to set up the burner on this thing. Stay tuned... Nick P.S. my trouble is I maybe use the burner once or twice a year, so never really can test, if you see what I mean. -- Free Software Foundation Associate Member 5508 |
|
From: Steven W. O. <st...@sy...> - 2008-08-29 14:17:35
|
On Friday, Aug 29th 2008 at 07:50 -0000, quoth Nick Warne: =>On Thu, 28 Aug 2008 22:44:29 -0400 (EDT) =>"Steven W. Orr" <st...@sy...> wrote: => => =>> Guys, PLEASE look at what I've done. I'm getting lonely here and I =>> need you guys to keep me honest. I never make any misteaks but =>> there's this thing called Murphy's Ultimate corollary: If it could =>> have gone wrong earlier and it didn't, then it ultimately would have =>> been beneficial for it to have. => =>Steve, => =>I have recently got a new box (AMD64) and have been busy transferring =>data and stuff the last 14 days or so. => =>I think this will be a good time to get latest svn BB and test it out, =>as I have yet to set up the burner on this thing. => =>Stay tuned... => =>Nick =>P.S. my trouble is I maybe use the burner once or twice a year, so =>never really can test, if you see what I mean. I'm thinking in terms of functional testing but I'm also thinking in terms of code review. If people can, please look at the code and see if you can find anything to discuss or if you see anything suspicious. -- Time flies like the wind. Fruit flies like a banana. Stranger things have .0. happened but none stranger than this. Does your driver's license say Organ ..0 Donor?Black holes are where God divided by zero. Listen to me! We are all- 000 individuals! What if this weren't a hypothetical question? steveo at syslang.net |
|
From: A. L. <and...@gm...> - 2008-08-29 19:20:17
|
Tried out the latest revision and there are a few things I want to report: * Header text is not printed. (When exiting the word BashBurn is not printed either, so the exit message says "Thank you for using <blank>..." * The prompt still disappears if you enter a number, do not press enter but backspace instead. * The menus act a little strangely. It seems that if you at a menu at the prompt just press enter without first entering a number, you are sent to the first entry of the menu. For instance at the main menu you are sent to the audio menu and at the define data menu you are sent to the shell where you copy/link data. Correct response should be to show a message telling the user to enter a number. * Trying to burn audio files shows the error message: "/opt/BashBurn/burning/burning.sh: line 41: return: check_for: numeric argument required" though I can't see why that message would pop up since a number is returned. That's all for now. I'll return with more findings later (If I find any that is...). On Fri, Aug 29, 2008 at 4:17 PM, Steven W. Orr <st...@sy...> wrote: > On Friday, Aug 29th 2008 at 07:50 -0000, quoth Nick Warne: > > =>On Thu, 28 Aug 2008 22:44:29 -0400 (EDT) > =>"Steven W. Orr" <st...@sy...> wrote: > => > => > =>> Guys, PLEASE look at what I've done. I'm getting lonely here and I > =>> need you guys to keep me honest. I never make any misteaks but > =>> there's this thing called Murphy's Ultimate corollary: If it could > =>> have gone wrong earlier and it didn't, then it ultimately would have > =>> been beneficial for it to have. > => > =>Steve, > => > =>I have recently got a new box (AMD64) and have been busy transferring > =>data and stuff the last 14 days or so. > => > =>I think this will be a good time to get latest svn BB and test it out, > =>as I have yet to set up the burner on this thing. > => > =>Stay tuned... > => > =>Nick > =>P.S. my trouble is I maybe use the burner once or twice a year, so > =>never really can test, if you see what I mean. > > I'm thinking in terms of functional testing but I'm also thinking in terms > of code review. If people can, please look at the code and see if you can > find anything to discuss or if you see anything suspicious. > > -- > Time flies like the wind. Fruit flies like a banana. Stranger things have .0. > happened but none stranger than this. Does your driver's license say Organ ..0 > Donor?Black holes are where God divided by zero. Listen to me! We are all- 000 > individuals! What if this weren't a hypothetical question? > steveo at syslang.net > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Bashburn-info mailing list > Bas...@li... > https://lists.sourceforge.net/lists/listinfo/bashburn-info > -- Anders Lindén http://bashburn.sf.net |