Re: script to update my ports tree

2007-06-25 Thread Daniel Bye
Olivier Regnier wrote:
 Hi everyone,
 
 I made a shell script in /etc/periodic/daily/610.update-ports-tree and
 in my /etc/periodic.conf, this line : daily_update_ports_tree_enable=YES.
 
 The problem is simple, my script doesn't start at all.
 
 Can you help me please ?
 
 Thank you :)


There is a syntax error in the script - you have missed the ;; from the
end of the first case statement. Try putting that in and see what
happens. You need something like this, or the script will just fall off
the last case statement, which does nothing:

case $var in
  yes)
do stuff here
;;
  *) ;;
esac


Also, you can simplify the script somewhat - you don't need to jump
through all those hoops with sed and awk to create a supfile on the fly
- just put this in your /etc/make.conf file, which does the same as your
selectserver() function:

SUP_UPDATE= yes
SUP=/usr/bin/csup
SUPFLAGS=   -g
SUPHOST=`/usr/local/bin/fastest_cvsup -Qc uk,fr,nl`
SUPFILE=/etc/cvsup/system

The -Q option to fastest_cvsup returns just the hostname of the fastest
server, so no need to set up an enormous pipeline of tools. Alter the
rest of the script to call 'make update' from /usr/ports, and you're done.

Alternatively, you can use portsnap(8) instead - it automatically
selects one of the available mirrors and uses it. However, you will need
to do a bit of work to set this up - remove your ports tree (no,
seriously - follow along, this is good), then run:

# portsnap fetch extract

Now your script just needs to call

# portsnap fetch update

and that's it. This has the advantage that you don't need to cd to
/usr/ports for it to work.

HTH, one way or another...

Dan
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: script to update my ports tree

2007-06-25 Thread Jonathan Horne
On Monday 25 June 2007 13:24:09 Daniel Bye wrote:
 Olivier Regnier wrote:
  Hi everyone,
 
  I made a shell script in /etc/periodic/daily/610.update-ports-tree and
  in my /etc/periodic.conf, this line :
  daily_update_ports_tree_enable=YES.
 
  The problem is simple, my script doesn't start at all.
 
  Can you help me please ?
 
  Thank you :)

 There is a syntax error in the script - you have missed the ;; from the
 end of the first case statement. Try putting that in and see what
 happens. You need something like this, or the script will just fall off
 the last case statement, which does nothing:

 case $var in
   yes)
 do stuff here
 ;;
   *) ;;
 esac


 Also, you can simplify the script somewhat - you don't need to jump
 through all those hoops with sed and awk to create a supfile on the fly
 - just put this in your /etc/make.conf file, which does the same as your
 selectserver() function:

 SUP_UPDATE= yes
 SUP=/usr/bin/csup
 SUPFLAGS=   -g
 SUPHOST=`/usr/local/bin/fastest_cvsup -Qc uk,fr,nl`
 SUPFILE=/etc/cvsup/system

 The -Q option to fastest_cvsup returns just the hostname of the fastest
 server, so no need to set up an enormous pipeline of tools. Alter the
 rest of the script to call 'make update' from /usr/ports, and you're done.

 Alternatively, you can use portsnap(8) instead - it automatically
 selects one of the available mirrors and uses it. However, you will need
 to do a bit of work to set this up - remove your ports tree (no,
 seriously - follow along, this is good), then run:

 # portsnap fetch extract

 Now your script just needs to call

 # portsnap fetch update

 and that's it. This has the advantage that you don't need to cd to
 /usr/ports for it to work.

 HTH, one way or another...

 Dan
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
 [EMAIL PROTECTED]

easiest way, is to add this to /etc/crontab

15  15  *   *   *   rootportsnap cron update 
 /dev/null 21

cheers,
-- 
Jonathan Horne
http://dfwlpiki.dfwlp.org
[EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: script to update my ports tree

2007-06-25 Thread Olivier Regnier

Daniel Bye a écrit :

Olivier Regnier wrote:
  

Hi everyone,

I made a shell script in /etc/periodic/daily/610.update-ports-tree and
in my /etc/periodic.conf, this line : daily_update_ports_tree_enable=YES.

The problem is simple, my script doesn't start at all.

Can you help me please ?

Thank you :)




There is a syntax error in the script - you have missed the ;; from the
end of the first case statement. Try putting that in and see what
happens. You need something like this, or the script will just fall off
the last case statement, which does nothing:

case $var in
  yes)
do stuff here
;;
  *) ;;
esac


Also, you can simplify the script somewhat - you don't need to jump
through all those hoops with sed and awk to create a supfile on the fly
- just put this in your /etc/make.conf file, which does the same as your
selectserver() function:

SUP_UPDATE= yes
SUP=/usr/bin/csup
SUPFLAGS=   -g
SUPHOST=`/usr/local/bin/fastest_cvsup -Qc uk,fr,nl`
SUPFILE=/etc/cvsup/system

The -Q option to fastest_cvsup returns just the hostname of the fastest
server, so no need to set up an enormous pipeline of tools. Alter the
rest of the script to call 'make update' from /usr/ports, and you're done.

Alternatively, you can use portsnap(8) instead - it automatically
selects one of the available mirrors and uses it. However, you will need
to do a bit of work to set this up - remove your ports tree (no,
seriously - follow along, this is good), then run:

# portsnap fetch extract

Now your script just needs to call

# portsnap fetch update

and that's it. This has the advantage that you don't need to cd to
/usr/ports for it to work.

HTH, one way or another...

Dan
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]
  

Hello, thank you for theses informations :)
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]