update script
Moderator: idcarlos
update script
i've rewritten the update script; i'm using dialog now for the user input parts (which in turn uses the curses library). what do you think? is there anyone who doesn't have dialog installed? that'd be an argument against it, if only a few people can use the script.
you can get the script, as usual, here.
gyözö
you can get the script, as usual, here.
gyözö
Press any key to continue or any other key to quit.
why do I never have any good news
first ill explain my setup then what happend to the update script
I have two version of bygfoot, 1.7 and 1.9
they are
/home/user/games/bygfoot/bygfoot17/bygfoot-unstable
/home/user/games/bygfoot/bygfoot19/bygfoot2-unstable
in /home/user/games/bygfoot i also have the (old) bygfoot-update script
I run it and it asks me what version and where it is (/tmp)and everything is fine. it works and i can update either 1.7 or .19
now your new script
first for some reason it failed to find cvs.im not sure why.
I isolated the function and noticed that "cvs" just didnt want to be found using your technique.However this works much better
function check_progs()
{
if [ $check -eq 0 ]; then
return
fi
echo
for i in sed tar bzip2 wget patch cvs; do
echo -n "** b-u: checking for $i... "
if $(which $i &> /dev/null); then
echo "ok"
else
echo "failed"
echo
echo "** WARNING: Didn't find working $i, maybe it's not in your PATH."
echo "** WARNING: You might not be able to use all bygfoot-update features."
fi
done
}
it uses which to find things (im told this is a better approach
but then i got these
** b-u: checking for cvs... ok
./bygfoot-update: line 665: [: too many arguments
./bygfoot-update: line 670: [: too many arguments
./bygfoot-update: line 672: [: too many arguments
./bygfoot-update: line 674: [: too many arguments
./bygfoot-update: line 286: pushd: ./bygfoot-update:: No such file or directory
./bygfoot-update: line 286: popd: directory stack empty
i looked but did not understand the script at these lines and gave up.
BTW i tried moving the script to varous places to see if i had some pathing wrong but it made no difference.
i even tried using -t and -p which i didnt understand but it made no differnece either.
sorry
first ill explain my setup then what happend to the update script
I have two version of bygfoot, 1.7 and 1.9
they are
/home/user/games/bygfoot/bygfoot17/bygfoot-unstable
/home/user/games/bygfoot/bygfoot19/bygfoot2-unstable
in /home/user/games/bygfoot i also have the (old) bygfoot-update script
I run it and it asks me what version and where it is (/tmp)and everything is fine. it works and i can update either 1.7 or .19
now your new script
first for some reason it failed to find cvs.im not sure why.
I isolated the function and noticed that "cvs" just didnt want to be found using your technique.However this works much better
function check_progs()
{
if [ $check -eq 0 ]; then
return
fi
echo
for i in sed tar bzip2 wget patch cvs; do
echo -n "** b-u: checking for $i... "
if $(which $i &> /dev/null); then
echo "ok"
else
echo "failed"
echo
echo "** WARNING: Didn't find working $i, maybe it's not in your PATH."
echo "** WARNING: You might not be able to use all bygfoot-update features."
fi
done
}
it uses which to find things (im told this is a better approach
but then i got these
** b-u: checking for cvs... ok
./bygfoot-update: line 665: [: too many arguments
./bygfoot-update: line 670: [: too many arguments
./bygfoot-update: line 672: [: too many arguments
./bygfoot-update: line 674: [: too many arguments
./bygfoot-update: line 286: pushd: ./bygfoot-update:: No such file or directory
./bygfoot-update: line 286: popd: directory stack empty
i looked but did not understand the script at these lines and gave up.
BTW i tried moving the script to varous places to see if i had some pathing wrong but it made no difference.
i even tried using -t and -p which i didnt understand but it made no differnece either.
sorry
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
What type are you?
i've changed to this approach now. your syntax is wrong, however; you have to write if which $i &> /dev/null, without the $() surrounding the command.vector wrote:if $(which $i &> /dev/null); then
it uses which to find things (im told this is a better approach
i hope this was because of the syntax error.but then i got these
** b-u: checking for cvs... ok
./bygfoot-update: line 665: [: too many arguments
./bygfoot-update: line 670: [: too many arguments
./bygfoot-update: line 672: [: too many arguments
./bygfoot-update: line 674: [: too many arguments
./bygfoot-update: line 286: pushd: ./bygfoot-update:: No such file or directory
./bygfoot-update: line 286: popd: directory stack empty
i looked but did not understand the script at these lines and gave up.
i've changed the script a bit now, let's see if it works better.
command line arguments should work, too, e.g. bygfoot-update -n -t /tmp -f rpm -T stable -A should download the current stable rpm package to /tmp without any prompts. there aren't any command line switches for cvs, though (yet).
gyözö
Press any key to continue or any other key to quit.
sorry same problem
ftpdir@mec-symonds:~/games/bygfoot$ ./bygfoot-update
bygfoot-update: A bash script keeping your Bygfoot Football Manager up-to-date.
Version 0.9.
See the file UPDATE for some more information.
Call bygfoot-update -h|--help for usage information.
** b-u: checking for sed... ok
** b-u: checking for tar... ok
** b-u: checking for bzip2... ok
** b-u: checking for wget... ok
** b-u: checking for patch... ok
** b-u: checking for cvs... ok
./bygfoot-update: line 648: [: too many arguments
./bygfoot-update: line 653: [: too many arguments
./bygfoot-update: line 655: [: too many arguments
./bygfoot-update: line 657: [: too many arguments
./bygfoot-update: line 287: pushd: ./bygfoot-update:: No such file or directory
./bygfoot-update: line 287: popd: directory stack empty
** b-u: Package dir set to
** b-u: /home/ftpdir/games/bygfoot
./bygfoot-update: line 305: [: too many arguments
** b-u: Temp dir set to
** b-u: /tmp
** b-u: Removing dialog output file /home/ftpdir/games/bygfoot/bygfoot-update-dialog.tmp.
** b-u: Cleaning up in the temp directory.
dont have time to fiddle right now mayb later
ftpdir@mec-symonds:~/games/bygfoot$ ./bygfoot-update
bygfoot-update: A bash script keeping your Bygfoot Football Manager up-to-date.
Version 0.9.
See the file UPDATE for some more information.
Call bygfoot-update -h|--help for usage information.
** b-u: checking for sed... ok
** b-u: checking for tar... ok
** b-u: checking for bzip2... ok
** b-u: checking for wget... ok
** b-u: checking for patch... ok
** b-u: checking for cvs... ok
./bygfoot-update: line 648: [: too many arguments
./bygfoot-update: line 653: [: too many arguments
./bygfoot-update: line 655: [: too many arguments
./bygfoot-update: line 657: [: too many arguments
./bygfoot-update: line 287: pushd: ./bygfoot-update:: No such file or directory
./bygfoot-update: line 287: popd: directory stack empty
** b-u: Package dir set to
** b-u: /home/ftpdir/games/bygfoot
./bygfoot-update: line 305: [: too many arguments
** b-u: Temp dir set to
** b-u: /tmp
** b-u: Removing dialog output file /home/ftpdir/games/bygfoot/bygfoot-update-dialog.tmp.
** b-u: Cleaning up in the temp directory.
dont have time to fiddle right now mayb later
Im "not sure" I like dialog
its sorta distracting.
I like seeing things scroll on the terminal and knowing where i am and seeing that all is well.
Also you cant copy paste into the dialog entry boxes.
eg i couldnt paste
/home/mark/games/bygfoot/bygfoot19
into the tmp dir entry box
The dialog is pretty, and certainly gives a gui look for users but Im just not sure .I think chips would find it much easier. I guess it comes down to those of us that are used to seeing cli or gui. Isnt this funny! 6 months ago during my move towards linux, I thought how silly it was that people were still using cli and now Im sitting here complaining about gui
Is there a way we can switch it on or off? like bygfoot-update -d meaning dont use dialog.
that way newbies can just use update and the advanced cli people can use the other?
its sorta distracting.
I like seeing things scroll on the terminal and knowing where i am and seeing that all is well.
Also you cant copy paste into the dialog entry boxes.
eg i couldnt paste
/home/mark/games/bygfoot/bygfoot19
into the tmp dir entry box
The dialog is pretty, and certainly gives a gui look for users but Im just not sure .I think chips would find it much easier. I guess it comes down to those of us that are used to seeing cli or gui. Isnt this funny! 6 months ago during my move towards linux, I thought how silly it was that people were still using cli and now Im sitting here complaining about gui
Is there a way we can switch it on or off? like bygfoot-update -d meaning dont use dialog.
that way newbies can just use update and the advanced cli people can use the other?
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
What type are you?
i like it, too, but i also like being able to choose menu entries with the arrows and return. maybe i can figure out how to make it that dialog doesn't overwrite the output.vector wrote:I like seeing things scroll on the terminal and knowing where i am and seeing that all is well.
i could with Shift-Ins.Also you cant copy paste into the dialog entry boxes.
not really. i'd have to write each menu twice, once for dialog usage and once without. let's stick with dialog for a while, it's easier to 'implement' (bash programming isn't real programming, not on my level anyway) and more comfortable; and you can still see a lot of output, e.g. when cvs downloads new files. i could also make the script create a log file with all output that you can look at afterwards.Is there a way we can switch it on or off? like bygfoot-update -d meaning dont use dialog.
gyözö
Press any key to continue or any other key to quit.
yes this is very nice now and im getting used to dialog.
i now have 1.7 and 1.9 as from the cvs and can run them independant
also not having to make intsall each time now is making the process much quicker.
vector happy
i now have 1.7 and 1.9 as from the cvs and can run them independant
also not having to make intsall each time now is making the process much quicker.
vector happy
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
What type are you?
playing with the update script
I have now wrapped it inside yet another script and you thought you were lazy
I wanted to make sure i had the latest update script version
so now I bash ./byupdate19
which :
wgets the latest update script
then runs it with a -t /home/user/games/bygfoot/bygfoot19 --cvs
I have a similar bygupdate17
It would be nice to be able to set the cvs branch from the cli?
I couldnt see a switch for this
I have now wrapped it inside yet another script and you thought you were lazy
I wanted to make sure i had the latest update script version
so now I bash ./byupdate19
which :
wgets the latest update script
then runs it with a -t /home/user/games/bygfoot/bygfoot19 --cvs
I have a similar bygupdate17
It would be nice to be able to set the cvs branch from the cli?
I couldnt see a switch for this
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
What type are you?
um... you'll have to use command-line switches. no dialog is needed then, i think. i didn't think of cygwin when i switched to dialog.chips wrote:gyboth its vector on chips (as opposed ot fish n chips
i cant find dialog in cygwin?
so couldnt check you latest update script here
but as far as i know there are command line options for everything now; tell me if you find out otherwise.
gyözö
Press any key to continue or any other key to quit.
agh yikes yeah didn think of that
i just used the old update script
chips is now runnin the latest 173 (as ./src/bygfoot) and has a team in div1
btw he has spredsheeted all his players each season.
He reckons he has a player who in season1 was Etal 6.3 and now season3 is on is 7.8... i think they were the numbers anyway he will post the details himself
i just used the old update script
chips is now runnin the latest 173 (as ./src/bygfoot) and has a team in div1
btw he has spredsheeted all his players each season.
He reckons he has a player who in season1 was Etal 6.3 and now season3 is on is 7.8... i think they were the numbers anyway he will post the details himself
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
What type are you?