File: developer.txt
patch-22 patch-23
Line 4Line 4
and not useful to the general public. What follows is a FAQ for those
who are participating in LNX-BBC GAR development.

and not useful to the general public. What follows is a FAQ for those
who are participating in LNX-BBC GAR development.

= CVS =

== How do I check stuff into CVS? ==

First you have to make sure you check the tree out with your own
account. Your old anonymous checkouts will not be useful to you. Run
the following to get a new copy of the tree with your account attached
to it.

----8<----
export CVS_RSH=ssh
cvs -d:ext:username@cvs.lnx-bbc.org:/var/cvs co gar
----8<----

Optionally, you can check out STABLE.

----8<----
export CVS_RSH=ssh
cvs -d:ext:username@cvs.lnx-bbc.org:/var/cvs co -r STABLE gar
----8<----

Be sure to type your username for cvs.lnx-bbc.org in place of
"username"!

Now when you change something you can type "cvs diff" to see a diff of
what you changed, and "cvs ci" to check your changes in.

== Whoa! Why did cvs bring up this strange text editor? ==

That's because your $EDITOR environment variable is set to vi or nano
or ae or something. simply set it to your favorite editor like so

----8<----
export EDITOR=emacs
----8<----

and you should be good.

== CVS is a crazy system. Are there any good docs on it? ==

Possibly the best documentation on CVS is available free for download
at <http://cvsbook.red-bean.com/>. It was published in dead-tree
format by Coriolis OpenPress as _Open Source Development With CVS_
with some added material. The important stuff is up on the
aforementioned Web site though.

The book is also installed on gargoyle.lnx-bbc.org, so you can shell
in and run "pinfo cvsbook" to read it.

== I can ssh in, but I get permission denied when trying to do a CVS
checkin! ==

Whoops! Whoever made your account probably forgot to add you to the
src group! Ask to be added and try again.

== I have all these empty directories lying about. What gives? ==

Try running "cvs up -Pd". This will prune empty directories and add
any new files in the repository. In fact, it's probably best to have
the following in your ~/.cvsrc

----8<----
diff -u
rdiff -u
update -Pd
cvs -z9 -q
----8<----

The first line makes all "cvs diff" commands come in the unified
format (preferred by this project). The second line does the same for
the "rdiff" command. The third line makes all cvs update commands use
the aforementioned -Pd switches. The final line makes all cvs
commands use maximal compression and low-noise output.

== I want to move some changes from HEAD into STABLE. The CVS docs
are way too wordy. Give us a hand? ==

The easiest way is with the "rdiff" function of cvs. To get a
complete set of differences, you do:

----8<----
cvs rdiff -u -r STABLE -r HEAD gar
----8<----

(Note that you may need to specify the repository location with "-d"
or the CVSROOT environment variable if you're not in a checked out
directory)

It's a lot of stuff. If you want just the summary of
files, versions, and dates, you can use:

----8<----
cvs rdiff -u -r STABLE -r HEAD -s gar
----8<----

This command works even without a local repository, if your CVSROOT
env var points to gargoyle, or if you specify a repository with -d.

Let's say I just wanted to look at one file:

----8<----
[gargoyle(~)] cvs rdiff -u -r STABLE -r HEAD -s gar/CREDITS
File gar/CREDITS changed from revision 1.19 to 1.21
[gargoyle(~)] cvs rdiff -u -r STABLE -r HEAD gar/CREDITS
Index: gar/CREDITS
diff -u gar/CREDITS:1.19 gar/CREDITS:1.21
--- gar/CREDITS:1.19 Mon Feb 24 13:51:04 2003
+++ gar/CREDITS Fri Mar 28 15:15:42 2003
@@ -21,7 +21,7 @@
Paul "this is research, dammit" Gray
Ian "what the...?" Harding
Duncan MacKinnon
-Nick Moffitt
+Nick "makes make make sense" Moffitt
Sean "keen with the winchesters" Neakums
Niall O Broin
"Yosemite" Sam Phillips
@@ -66,6 +66,8 @@
Compression: cloop (Rusty Russell and Klaus Knopper)

Development: gar (Nick Moffitt)
+
+Disc Label Design and Artwork: Rev. Patty "icon bitch" Morin

And thanks to all the subscribers of the lnx-bbc-devel and lnx-bbc lists for
their useful questions and advice, and to all beta testers and reporters
----8<----

Now this can be run through patch:

----8<----
[gargoyle(~/gar)] cvs rdiff -u -r STABLE -r HEAD gar/CREDITS | patch -p1
patching file CREDITS
----8<----

Note that I did -p1 because the patch begins with gar/, and I am in
that directory, which is a checkout of STABLE. A subsequent "cvs
diff" shows me the same patch that rdiff did before (but with
filenames changed).




= Nightly Builds =

== So how do these nightly builds work? ==
= Nightly Builds =

== So how do these nightly builds work? ==
Line 163Line 21
The system first blows away the working dir, then checks out a fresh
copy of GAR and builds lnx-bbc.

The system first blows away the working dir, then checks out a fresh
copy of GAR and builds lnx-bbc.


Once a build succeeds, it pushes the changesets used in the build up to the
public arch mirror at http://www.lnx-bbc.org/arch/. This guarantees that when
people grab the stable arch branch, it really is code that is known to build!

== Wait, so why are they called nightly builds if they run every two
hours? ==

Historically, they ran at a quarter past noon and a quarter past
== Wait, so why are they called nightly builds if they run every two
hours? ==

Historically, they ran at a quarter past noon and a quarter past
midnight. They weren't specifically "nightly" then either. Things
change; people don't.
midnight. They weren't specifically "nightly" then either. Seasons
change; people stay the same.
== Ack! I was looking at a file in the nightly build dir and a new
build started, removing everything! ==
== Ack! I was looking at a file in the nightly build dir and a new
build started, removing everything! ==
Line 542Line 404
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=nick@zork.net

PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=nick@zork.net

*/20 * * * *                killall cvs &> /dev/null || true; cd \
/var/www/lnx-bbc.org/; cvs -Q up -Pd > /dev/null
*/15 * * * *                make -C /var/www/lnx-bbc.org/ garchive \
GARCHIVEDIR='/var/www/lnx-bbc.org/garchive/$(DISTNAME)/' > /dev/null
*/5 * * * *                make -C /var/www/lnx-bbc.org/ html > /dev/null
*/5 * * * * tla update -d /home/nick/lnx-bbc--stable--2.1/ &> /home/nick/tla.log && make -C /home/nick/lnx-bbc--stable--2.1/ html > /dev/null && ln -sf /home/nick/lnx-bbc--stable--2.1/*.{html,txt,png,css} /var/www/lnx-bbc.org/
5 0 * * * make -C /home/nick/lnx-bbc--stable--2.1/ garchive GARCHIVEDIR='/var/www/lnx-bbc.org/garchive/$(DISTNAME)/' &> /dev/null; cd /var/www/lnx-bbc.org/garchive && for i in *; do cp HEADER.html $i &> /dev/null || true; done
----8<----

----8<----

(lines broken and backwhacked to keep page width down)

Basically it does a full cvs update every 20 minutes, does a "make
garchive" every 15, and a "make html" every 5 minutes. So generally
you have to wait 25 minutes at most for your checkin to be reflected
on the Web site.