in8snotes

This portion of my site is powered by Blosxom. Blosxom is a perl script whose functionality here is extended through several plugin scripts in order to dynamically assemble a multitude of separate plain text files stored in a directory tree on the server into a cohesive, dated and RSS enabled weblog. Now in daily (r)sync with the directories on Nate's Powerbook.


home / computers / cvs-stuff

January
Sun Mon Tue Wed Thu Fri Sat
       
6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

2009
Months
JanFeb Mar
Apr May Jun
Jul Aug Sep
Oct Nov Dec

blosxom
categorytree plugin
blox plugin
calendar plugin
find plugin
breadcrumbs plugin



       
Return to in8sworld.net


Creating a new CVS repository

I successfully created a repository in ~/myproj called spec with the contents of my ~/Sites/frc/spec directory by CDing into that spec directory and issuing:

cvs import -m "FRC spec" spec specphp spec_0
It was driving me crazy, since I was always issuing the command from the myproj directory at first and it was dumping all the other projects in the myproj directory in there too. Trouble is, it didn't create a directory called spec in there, so you can't see the files there or anything. You just have to know that its been checked in? Well I'm still learning my way around.

I suppose you can list the modules easily enough.

Remember that after importing the project, rename the original directory (to move it out of the way). Then use cvs checkout to check out the project to the original location. Once you verify its all there, you can delete the original directory.

Last saved: 07/15/2007
Links: /computers/cvs-stuff / newCVSproject.txt

Logging in to CVS and adding a new module

cvs -d :pserver:user@domain.org:/usr/local/projects login

cvs import -m "Example" example exampledev ex_0

Last saved: 03/06/2006
Links: /computers/cvs-stuff / cvs-login.txt

The cvswrappers file

====================

Wrappers refers to a CVS feature which lets you control certain
settings based on the name of the file which is being operated on. The
settings are `-k' for binary files, and `-m' for nonmergeable text
files.

The `-m' option specifies the merge methodology that should be used
when a non-binary file is updated. `MERGE' means the usual CVS
behavior: try to merge the files. `COPY' means that `cvs update' will
refuse to merge files, as it also does for files specified as binary
with `-kb' (but if the file is specified as binary, there is no need to
specify `-m 'COPY''). CVS will provide the user with the two versions
of the files, and require the user using mechanisms outside CVS, to
insert any necessary changes.

*WARNING: do not use `COPY' with CVS 1.9 or earlier - such versions
of CVS will copy one version of your file over the other, wiping out
the previous contents.* The `-m' wrapper option only affects behavior
when merging is done on update; it does not affect how files are
stored. See Binary files, for more on binary files.

The basic format of the file `cvswrappers' is:

wildcard [option value][option value]...

where option is one of
-m update methodology value: MERGE or COPY
-k keyword expansion value: expansion mode

and value is a single-quote delimited value.

For example, the following command imports a directory, treating
files whose name ends in `.exe' as binary:

cvs import -I ! -W "*.exe -k 'b'" first-dir vendortag reltag

Last saved: 04/03/2005
Links: /computers/cvs-stuff / CVS-wrappers.txt

Starting the CVS server in Mandrake

Should go in /etc/xinet.d/cvs

some of this from http://enterprise.ece.mcgill.ca/~wentsern/index5.html
Make the repositories, and ensure that a group can access it.
Also ensure that new files created therein will be owned by the group.
chown -R :cvs /usr/local/projects
chmod -R g+ws /usr/local/projects

NOT NOW, but after everything is done, come back and issue
chmod -R g+rw,o-rwx usr/local/projects
to ensure the directory is not world readable.

mkdir /usr/local/projects/CVSROOT
export CVSROOT=/home/cvs
cvs import
(I think this should be "cvs init" -Nate)

Edit /etc/xinetd.d/cvs

service cvspserver
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/cvspserver
passenv = PATH * needed to add this to work!
}

Edit /etc/cvs/cvs.conf

CVS_REPOS="/home/cvs/repository1"

Restart xinetd with either of the following commands

pkill -USR1 xinetd
service xinetd restart

Check cvs server has started

sh -x /usr/sbin/cvspserver

Or you can use nmap to check if it is installed

nmap localhost

Clientside (as the user)

Add the login password to ~/.cvspass by runing

cvs -d :pserver:username@machinename.domainname.com:/home/cvs/repository1 login

Use Cervisia (Repository -> Repositories -> Add)

:pserver:username@machinename.domainname.com:/home/cvs/repository1

Note that
Checkout means to download the files from the CVS server.
Import means to upload the files to the CVS server.

more on this here
http://www.mooreds.com/weblog/archives/000234.html

Last saved: 03/29/2005
Links: /computers/cvs-stuff / CVS-mandrake.txt

CVS repositories - vendor tags?

I'm still confused about what vendor tags and release tags mean, but I can't create
a new CVS repository without assigning them, so I have developed an ad hoc method for
naming so it just works - I use a 4 letter module name, then use that name+[three letters
for "php" or some other designator for content] as the vendor tag and the 4 letter name
with an _0 appended for the release tag. I imported the prototype product php page
tonight this way:

[in8smac:~/Sites/frc/5-php-driven] in8% cvs import -m "FRC php product page" prod prodphp prod_0
I prod/.DS_Store
N prod/5-content.thtml
N prod/5-footer.thtml
N prod/5-header.thtml
N prod/fire5.css
N prod/Governors-5.htm
N prod/product.php

No conflicts created by this import

Last saved: 03/09/2005
Links: /computers/cvs-stuff / CVS-vendortags.txt

Using CVS to checkout and checkin files

I had no luck using the GUI CVS client at first so I ended up learning how to do all this on the command line:

[in8smac:~/Desktop] in8% cvs checkout spec

it told me that stuff had been released. Then I downloaded the latest files from the web and brought them to the desktop. To check them in, I ran

[in8smac:~/Desktop] in8% cvs commit

but although it worked, it only saw the index.php file (which had been in the original checkout) so I need to learn how to add files to the repository.
Well, that was easy:

[in8smac:~/Desktop/spec] in8% cvs add fire4.css

I found this site useful: http://www.network-theory.co.uk/docs/cvsmanual/index.html

cvs diff -r 1.1 index.php

allowed me to see an output of the differences between the two index.php files (version 1.1 and the newer 1.2 I just grabbed from the website). To understand the diff, just realize that "<" indicates a removal from the first file, while ">" indicates what it was changed to.

Of course, when I finally figured out that you just have to "open the sandbox" in the GUI client to see and act on all the CVS'd items you check out with the client, its far easier. The diff function in macCVSclient is nice and colored too.

Last saved: 02/28/2005
Links: /computers/cvs-stuff / CVScheckout.txt

To enable the pserver method of CVS login

Trouble with passwd file? niutil -read local@localhost /users/in8 if you see authentication_authority: ;ShadowHash;
that means you need to create a passwd file in CVSROOT

Keep in mind I have since edited my .tcshrc file to show: setenv CVSROOT_DIRECTORY "/usr/local/cvsrep"
setenv CVSROOT :pserver:in8@localhost:${CVSROOT_DIRECTORY}
Make sure you init the CVSROOT directory (where all the settings go) [in8smac:Users/in8/myproj] root# sudo cvs -d /Users/in8/myproj init

I found this:
My favorite method for generating crypted passwords is using the Perl crypt function: perl -e 'print crypt "password", "sa"' >>$CVSROOT/CVSROOT/passwd Where "sa" is the salt, or an arbitrary two character string which is used to encrypt the password. You will of course have to subsequently edit the passwd file to get the generated crypted password string into the proper location.
But it didn't work!
The better way was here:

#/usr/bin/perl
#
# Simple script to take a username and password and
# return a line suitable for pasting into the CVS
# password file.
#

($u, $p)=@ARGV;
@d=(A..Z,a..z);
$s=$d[rand(52)].$d[rand(52)];
print $u.":".crypt($p, $s).":cvs\n";

and use it like this: perl crypt in8 password the output goes into the passwd file in the CVSROOT directory.

(note: I also had to change the perms on the .cvspass file so in8 could mod it)

To start the pserver
create /etc/xinetd.d/cvspserver with service cvspserver
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/cvs
server_args = -f --allow-root=/Users/in8/myproj pserver
groups = yes
flags = REUSE
}

Last saved: 02/27/2005
Links: /computers/cvs-stuff / CVSpserver.txt