# a another way to update your src



## netrookie (Sep 9, 2009)

cvsup is popular, but i get a better idea from a China web site
to update your src:


```
1. directory to contains the src
# mkdir /home/xzz/src 
# cd /home/xzz/src
# wget -c -r -nd -np [url]ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/8.0-BETA4/src[/url]
2. backup the original src
# cd /usr
# mv src src.v7.2
# mkdir src
3. md5 the src
for file in `ls /home/xzz/src`
do
md5 $file > /home/xzz/check.md5
done
# diff check.md4 /home/xzz/src/CHECKSUM.MD5
4. install the src 
# chmod 755 /home/xzz/install.sh
# /home/xzz/install.sh all
5. done
```

i think it is more convenient than cvsup.


----------



## tobe (Sep 9, 2009)

I don't get it.

```
csup stable-supfile
```
It's only one command.


----------



## tangram (Sep 9, 2009)

csup(1) is part of the base system and is written is C. It's a better alternative that net/cvsup.

Of course you can manually update src in numerous ways, ranging from csup, cvsup, install CD, svn, manually, ect. However I personally prefer csup .


----------



## Beastie (Sep 9, 2009)

tangram said:
			
		

> csup(1) is part of the base system and is written is C. It's a better alternative that net/cvsup.



Plus it supports compression!


----------



## LateNiteTV (Sep 9, 2009)

yeah i prefer csup.


----------



## fronclynne (Sep 9, 2009)

Beastie said:
			
		

> Plus it supports compression!



& doesn't transfer _all_ of the source, every time you go to update.


----------



## netrookie (Sep 10, 2009)

well, seems csup is better? i will try...


----------



## avilla@ (Sep 10, 2009)

netrookie said:
			
		

> well, seems csup is better? i will try...



from /usr/share/examples/etc/make.conf:


```
# CVSup update flags.  Edit SUPFILE settings to reflect whichever distribution
# file(s) you use on your site (see /usr/share/examples/cvsup/README for more
# information on CVSup and these files).  To use, do "make update" in /usr/src.
#
#SUP_UPDATE=
#
#SUP=            /usr/bin/csup
#SUPFLAGS=       -g -L 2
#SUPHOST=        cvsup.uk.FreeBSD.org
#SUPFILE=        /usr/share/examples/cvsup/standard-supfile
#PORTSSUPFILE=   /usr/share/examples/cvsup/ports-supfile
#DOCSUPFILE=     /usr/share/examples/cvsup/doc-supfile
```

(actually, the -g flag is a cvsup flag, useless in csup)


----------



## netrookie (Sep 10, 2009)

xzhayon said:
			
		

> from /usr/share/examples/etc/make.conf:
> 
> 
> ```
> ...


thank you, i just google from the web about the usage of csup,
i will recommend this idea to the China freebsd forum and discuss it.


----------



## inurneck (Jan 11, 2010)

I just got a new toy. It's much faster to update my source tree with this thanks. 

```
Checkout src/usr.sbin/zzz/zzz.sh
Finished successfully

real	11m49.172s
user	0m53.226s
sys	0m58.389s
[root@daemon /daemon]#
```
I completely deleted /usr/src 11 minutes. oh my.


----------



## Matty (Jan 13, 2010)

nobody using SVN?


```
for the init:
svn co svn://svn.freebsd.org/base/stable/8 /usr/src

for the update:
cd /usr/src
svn up
```


----------



## phoenix (Jan 13, 2010)

Was just about to post that.  I've been using Subversion to manage my source trees for a couple of releases now.

You forgot on important item, though -- to update between versions:

```
# cd /usr/src
# svn switch svn://svn.freebsd.org/base/[stable|releng]/[version]
```

For example, if you are running *releng/7.2* and want to move to *stable/7*, then use `# svn switch [url=svn://svn.freebsd.org/base/stable/7]svn://svn.freebsd.org/base/stable/7[/url]`.  If you want to move to 8.0, then use `# svn switch [url=svn://svn.freebsd.org/base/releng/8.0]svn://svn.freebsd.org/base/releng/8.0[/url]`.  And so on.

Support for using the SUP* variables in /etc/make.conf is coming, as well.  Then you can edit /etc/make.conf to use either csup or svn, and updates to the source tree will be the same for both:  make update


----------



## tangram (Jan 13, 2010)

I usually use csup and upon reading this thread decide to try out svn to update my src.

My supfile define the RELENG_7_2 tag. So I ran [cmd=]mkdir /usr/src/7_2 ; svn co svn://svn.freebsd.org/base/releng/7.2 /usr/src/7[/cmd].

The svn tree is 1.1G while the csup is half that size.

Any hints on what's wrong?


----------



## Matty (Jan 13, 2010)

tangram said:
			
		

> I usually use csup and upon reading this thread decide to try out svn to update my src.
> 
> My supfile define the RELENG_7_2 tag. So I ran [cmd=]mkdir /usr/src/7_2 ; svn co svn://svn.freebsd.org/base/releng/7.2 /usr/src/7[/cmd].
> 
> ...



guess it's the /usr/src/.svn


----------



## tingo (Jan 14, 2010)

The big advantage of csup is that it is already in the base; you can use it right after installing a -RELEASE, without needing to install  any ports first.


----------



## fronclynne (Jan 14, 2010)

*svn is like genuine lunar selenium*



			
				tingo said:
			
		

> The big advantage of csup is that it is already in the base; you can use it right after installing a -RELEASE, without needing to install  any ports first.



csup is a fairly recent addition to the base (early 2006 it looks like), & I believe not as full-featured as net/cvsup-without-gui, to say nothing of cvs(1).  It it pretty entrenched though, as the primary method for us rubes to get our sources caught up.

svn's license seems friendly enough, it wouldn't surprise me to see it being included in FreeBSD's base distribution some day, but most of us just need/want a straightforward way to pull the version we want down without keeping a multi-gigabyte (or some hydrocephalic wikipedian nonsense like gibbleblot) repository of atomic reversions going back to Ada Lovelace.  That csup keeps some 18M here for its bookkeeping is quite enough, thank you.


----------



## tangram (Jan 15, 2010)

Matty said:
			
		

> guess it's the /usr/src/.svn



Nope. That's only 346K.


----------



## Alt (Jan 15, 2010)

tangram said:
			
		

> Nope. That's only 346K.


Then its /usr/src/sys/.svn =) Etc. There is .svn directory in every dir, holding BASE copy while you have "working copy". So yes, it must near double disk usage...

But anyway i prefer svn =)


----------



## ptankov (Mar 9, 2010)

I'd love to use csup and I do when I'm at home. However, at work our Internet access is a bit limited - the default CVS port is 5999 and our corporate firewall blocks it. I'll try svn and if it fails I'll resort to manual.


----------



## avilla@ (Mar 10, 2010)

ptankov said:
			
		

> I'd love to use csup and I do when I'm at home. However, at work our Internet access is a bit limited - the default CVS port is 5999 and our corporate firewall blocks it. I'll try svn and if it fails I'll resort to manual.



if you have ssh access to a machine outside the firewall, you can tunnel csup through it (i don't remember how... you have to use the -l option in ssh, or similar)


----------



## ptankov (Mar 10, 2010)

xzhayon said:
			
		

> if you have ssh access to a machine outside the firewall, you can tunnel ...



Yep, did that until... the sysadmins blocked that machine as well :\


----------



## DutchDaemon (Mar 10, 2010)

I guess you could pack a tarball of /usr/src on a freshly csup'ed machine and bring it on a stick (or http/ftp it over if you can get to it).


----------



## razrx (Mar 10, 2010)

Matty said:
			
		

> nobody using SVN?
> 
> 
> ```
> ...



Maybe use svn export to strip all the meta data and simply rerun the svn export command for the updates?
It may be more data that needs fetching but I do believe you will end up with less src data on disk (compared to the svn co method).


----------

