head	1.45;
access;
symbols;
locks; strict;
comment	@# @;


1.45
date	2012.02.27.18.15.49;	author mux;	state dead;
branches;
next	1.44;

1.44
date	2006.03.07.12.02.13;	author mux;	state Exp;
branches;
next	1.43;

1.43
date	2006.03.06.00.36.23;	author mux;	state Exp;
branches;
next	1.42;

1.42
date	2006.03.01.05.08.11;	author mux;	state Exp;
branches;
next	1.41;

1.41
date	2006.03.01.04.39.03;	author mux;	state Exp;
branches;
next	1.40;

1.40
date	2006.03.01.04.38.07;	author mux;	state Exp;
branches;
next	1.39;

1.39
date	2006.03.01.04.17.39;	author mux;	state Exp;
branches;
next	1.38;

1.38
date	2006.03.01.02.32.19;	author mux;	state Exp;
branches;
next	1.37;

1.37
date	2006.02.27.20.09.47;	author mux;	state Exp;
branches;
next	1.36;

1.36
date	2006.02.22.21.40.55;	author mux;	state Exp;
branches;
next	1.35;

1.35
date	2006.01.27.17.13.49;	author mux;	state Exp;
branches;
next	1.34;

1.34
date	2006.01.24.01.21.22;	author mux;	state Exp;
branches;
next	1.33;

1.33
date	2006.01.20.13.38.17;	author mux;	state Exp;
branches;
next	1.32;

1.32
date	2006.01.20.01.41.00;	author mux;	state Exp;
branches;
next	1.31;

1.31
date	2005.07.09.18.37.14;	author mux;	state Exp;
branches;
next	1.30;

1.30
date	2005.06.25.16.57.07;	author mux;	state Exp;
branches;
next	1.29;

1.29
date	2005.05.27.23.34.41;	author mux;	state Exp;
branches;
next	1.28;

1.28
date	2005.05.27.23.21.39;	author mux;	state Exp;
branches;
next	1.27;

1.27
date	2005.05.22.23.14.18;	author mux;	state Exp;
branches;
next	1.26;

1.26
date	2005.05.21.22.37.06;	author mux;	state Exp;
branches;
next	1.25;

1.25
date	2005.05.11.18.42.37;	author mux;	state Exp;
branches;
next	1.24;

1.24
date	2005.05.11.18.38.48;	author mux;	state Exp;
branches;
next	1.23;

1.23
date	2005.05.04.13.08.19;	author mux;	state Exp;
branches;
next	1.22;

1.22
date	2004.06.18.19.35.39;	author mux;	state Exp;
branches;
next	1.21;

1.21
date	2004.04.05.10.26.38;	author mux;	state Exp;
branches;
next	1.20;

1.20
date	2004.04.04.17.18.44;	author mux;	state Exp;
branches;
next	1.19;

1.19
date	2004.03.21.22.59.51;	author mux;	state Exp;
branches;
next	1.18;

1.18
date	2004.02.15.20.16.50;	author mux;	state Exp;
branches;
next	1.17;

1.17
date	2004.02.15.16.19.01;	author mux;	state Exp;
branches;
next	1.16;

1.16
date	2004.02.10.13.23.04;	author mux;	state Exp;
branches;
next	1.15;

1.15
date	2004.02.05.17.25.16;	author mux;	state Exp;
branches;
next	1.14;

1.14
date	2004.02.05.17.19.53;	author mux;	state Exp;
branches;
next	1.13;

1.13
date	2004.02.05.17.19.31;	author mux;	state Exp;
branches;
next	1.12;

1.12
date	2004.02.05.16.39.36;	author mux;	state Exp;
branches;
next	1.11;

1.11
date	2003.11.04.00.01.03;	author mux;	state Exp;
branches;
next	1.10;

1.10
date	2003.10.27.12.13.48;	author mux;	state Exp;
branches;
next	1.9;

1.9
date	2003.10.14.19.48.22;	author mux;	state Exp;
branches;
next	1.8;

1.8
date	2003.10.13.17.16.36;	author mux;	state Exp;
branches;
next	1.7;

1.7
date	2003.10.12.23.56.15;	author mux;	state Exp;
branches;
next	1.6;

1.6
date	2003.10.12.14.28.57;	author mux;	state Exp;
branches;
next	1.5;

1.5
date	2003.10.12.09.33.35;	author mux;	state Exp;
branches;
next	1.4;

1.4
date	2003.10.11.23.20.54;	author mux;	state Exp;
branches;
next	1.3;

1.3
date	2003.10.11.23.09.12;	author mux;	state Exp;
branches;
next	1.2;

1.2
date	2003.10.11.22.55.46;	author mux;	state Exp;
branches;
next	1.1;

1.1
date	2003.10.11.22.45.49;	author mux;	state Exp;
branches;
next	;


desc
@@


1.45
log
@Retire the old csup code from the projcvs repository. A mercurial repository
with *full* development history (including the changes that happened since it
was imported in the tree) has been put online at the following URL, for those
who need it:

	https://bitbucket.org/mumux/csup

I'm not doing this because I intend to start working on csup again, but if
other people are willing to do so (csupd, anyone? :-P), this should be useful.
That being said, I'm committed to continue maintaining it in proper shape, so
don't hesitate to contact me when there are bugs that need fixing.
@
text
@$FreeBSD: projects/csup/TODO,v 1.44 2006-03-07 12:02:13 mux Exp $

BUGS:

- Fix every XXX in the code :-).
- The stream API needs some polishing.  It needs proper error numbers
  and a stream_error() function similar to the ferror() function.
- The yacc/lex code to parse the configuration file is sub-optimal.  It
  has global variables because of yacc, but I think it should be possible
  to do it better by using YYFUNC_PROTOTYPE or something.  I think it
  should also be possible to completely get rid of the lex file.
- The $Log$ CVS keyword is not supported.
- Add missing support for supfile keywords and add sanity checks for
  some of them.  Also, we're not supposed to choke on unknown keywords
  to stay in line with CVSup, which just ignores them in order to
  maintain compatibility with sup configuration files.

MISSING FEATURES:

- Add support for authentication.
- Add support for shell commands sent by the server.
- Add missing support for various CVSup options : -D, -a (requires
  authentication support), -e and -E (requires shell commands support)
  and the destDir parameter.
- For now, this code should build fine on FreeBSD, NetBSD, OpenBSD,
  Linux and Darwin.  Solaris support would also be nice at some point.
- Implement some new useful options : the ability to generate CVS
  checkout files (files in CVS/ subdirectores), a command line override
  to only update a specific collection and a third verbosity level to
  display commit log messages.
- Add support for CVS mode (maybe?).
@


1.44
log
@- Add support for the -d <delLimit> option.
- Add support for the -k option.
- Correctly remove the temporary file if a fixup is required and if the
  -k option is not specified.
- Move updater_checkmd5() into updater_updatefile().
- Update TODO list.
@
text
@d1 1
a1 1
$FreeBSD: projects/csup/TODO,v 1.43 2006/03/06 00:36:23 mux Exp $
@


1.43
log
@- Connect idcache.c to the build.
- Initialize the cache in fattr_init() and release its resources in
  fattr_fini(), since the fattr API is the only consumer.
- Use the new thread-safe getuserbyid(), getgroupbyid(), getuidbyname(),
  getgidbyname() functions when encoding/decoding user names or group
  names in fattr_encode() and fattr_decode().
- Remove the associated task from the TODO list.
@
text
@d1 1
a1 1
$FreeBSD: projects/csup/TODO,v 1.42 2006/03/01 05:08:11 mux Exp $
d22 3
a24 3
- Add missing support for various CVSup options : -k, -d, -D,
  -a (requires authentication support), -e and -E (requires shell
  commands support) and the destDir parameter.
@


1.42
log
@Whee!  One thing less to do.
@
text
@d1 1
a1 1
$FreeBSD: projects/csup/TODO,v 1.41 2006/03/01 04:39:03 mux Exp $
a11 3
- Some code uses getpwnam() while it should use the thread-safe variant,
  getpwnam_r().  Same for getpwuid() and getgrgid().  We probably need a
  UID/GID lookup cache here.
@


1.41
log
@Hey!  I already have a manpage :-).
@
text
@d1 1
a1 1
$FreeBSD: projects/csup/TODO,v 1.40 2006/03/01 04:38:07 mux Exp $
a19 3
- If the prefix directory is a symbolic link pointing to a nonexistent
  file named `SKIP', then we should skip the collection, as described in
  the CVSup manual page.
@


1.40
log
@Add an entry about the $Log$ keyword that is not supported.
@
text
@d1 1
a1 1
$FreeBSD: projects/csup/TODO,v 1.39 2006/03/01 04:17:39 mux Exp $
a30 1
- Write a manual page (the CVSup one should probably be reused).
@


1.39
log
@- Document the -A option.
- Remove -A from TODO list.
@
text
@d1 1
a1 1
$FreeBSD: projects/csup/TODO,v 1.38 2006/03/01 02:32:19 mux Exp $
d15 1
@


1.38
log
@Remove the -i option from the TODO list, it's done.
@
text
@d1 1
a1 1
$FreeBSD: projects/csup/TODO,v 1.37 2006/02/27 20:09:47 mux Exp $
d27 1
a27 1
- Add missing support for various CVSup options : -A, -k, -d,
@


1.37
log
@Update.
@
text
@d1 1
a1 1
$FreeBSD: projects/csup/TODO,v 1.36 2006/02/22 21:40:55 mux Exp $
d27 1
a27 1
- Add missing support for various CVSup options : -A, -k, -d, -i,
@


1.36
log
@The most gratifying part: remove obsoleted task from the bugs TODO.
@
text
@d1 1
a1 1
$FreeBSD: projects/csup/TODO,v 1.35 2006/01/27 17:13:49 mux Exp $
a24 1
- Add support for refuse files.
d27 2
a28 2
- Add missing support for various CVSup options : -A, -k, -1 and -r,
  -d, -i, -a (requires authentication support), -e and -E (requires shell
d31 2
a32 2
- For now, this code should build fine on FreeBSD, NetBSD and OpenBSD.
  Linux, Solaris and Darwin support would also be nice at some point.
@


1.35
log
@Bite the bullet and rename every $Id$ to $reeBSD$ so that it gets
expanded.  No functional change.
@
text
@d1 1
a1 1
$FreeBSD$
a5 8
- Cleanup error handling just about everywhere.  For now, the code is
  unable to properly handle failures.  This is made complicated due to
  the multi-threaded design and because the worker threads can block in
  many different places.  We need a way to properly "kill" threads in
  case of an error, and at least the updater thread needs to be able to
  recover nicely so that a proper status file is written.  We also need
  the worker threads to return an exist status and possibly an error
  message.  I probably overlooked a few more things.
a21 2
- Handle some signals (SIGINT, SIGPIPE and maybe others) gracefully, like
  CVSup does and like we should.
@


1.34
log
@- Make the keyword API able to handle binary lines at last.  It makes
  the code in keyword_expand() more complicated but we're now doing
  things correctly, or so it seems :-).
- Remove the digusting hacks in diff_write() that were a consequence of
  the inability of the keyword API to handle binary lines.
- Remove task from TODO.
@
text
@d1 1
a1 1
$Id: TODO,v 1.30 2005/06/25 16:57:07 mux Exp $
@


1.33
log
@Add a note about the XXX markers in the code.
@
text
@a15 6
- The keyword API which expands the CVS tags ($Foo$ etc) can't handle
  binary lines correctly, and that makes diff_write() needlessly complex,
  if my memory is entirely correct.  Also, that means if we are using
  csup with a CVS repository where there are binary files with tag
  expansion enabled and that they really contain tags, we will not
  handle it correctly.  However, this is extremely unlikely.
@


1.32
log
@Commit the rest of my patch to implement status file support.  It's not
perfect and there are a few things I need to fix/polish, but it will do
for now.

Makefile:
- Connect the new files to the build.

TODO:
- Slightly update, more to come.

proto.c:
- Rename proto_getstr() to proto_get_ascii().
- Add proto_get_int() and proto_get_time(), self-explanatory.
- Add support for new modifiers to proto_printf(): %c, %S for strings
  that shouldn't be escaped and %t for printing time_t.  Check write
  errors in this function.

fattr.c:
- Add a new parameter to fattr_new() to allow to pass a modtime for
  the new file attribute, as in CVSup.
- Use xmalloc() and friends.
- Implement fattr_default().
- Remove the const qualifier from the fattr_decode() argument, it gets
  written to.
- Implement fattr_umask().
- Implement fattr_getmask().
- Implement fattr_getlinkcount().
- Swap the to and from parameters of fattr_install() to match CVSup.

fattr_os.h:
- Change the supported the file attributes for FT_UNKNOWN filetypes
  with a big XXX comment next to it, this needs double-checking.

detailer.c:
- Convert to use the status file.
- Use the new proto_*() API for parsing.

lister.c:
- Convert to use the status file.
- Use the new proto_*() API for parsing.

updater.c:
- Update to use and update the status file.
- Use the new proto_*() API for parsing.
- Use a struct context and pass it throughout the updater's code to
  reduce the number of parameters.
- Use the new co_prefixlen field of struct coll instead of calling
  strlen() each time.

And copyright updates about everywhere.
@
text
@d5 1
@


1.31
log
@- Rename all the functions within proto.c so that they are prefixed with
  proto_ instead of cvsup_.
- Create a proto_printf() that is a very simple printf() implementation
  that ends up calling stream_write().  It only understands %d and %i
  since I don't need anything else for now.  It correctly escapes
  characters in strings if needed.
- Create a proto_getstr() function that works similarly to strsep, but
  correctly unscapes characters in the string if needed.
- Use proto_printf() and proto_getstr() throughout the source.
- Remove the TODO task about character escaping, this commit completes
  it unless I've broken something :-).
@
text
@d14 1
a14 2
  and stream_error() and stream_eof() functions similar to the ferror()
  and feof() functions.
a39 3
- Parse, use and update status file (ongoing).
- Consider computing the MD5 checksum when updating rather than after the
  diff/checkout is done, it would avoid reading the whole file two times.
d44 2
a45 3
  -s (requires status file support), -d, -i, -a (requires authentication
  support), -e and -E (requires shell commands support) and the destDir
  parameter.
@


1.30
log
@The -l flag is now implemented, remove it there.
@
text
@d1 1
a1 1
$Id: TODO,v 1.29 2005/05/27 23:34:41 mux Exp $
a4 5
- Correctly handle (un)escaping in tokens as described in the
  doc/Protocol file of CVSup : \_ -> space, \t -> tab, \n -> newline,
  \r -> carriage return and \\ -> backslash.  For now, the code is
  *riddled* with strsep() calls, they need to be isolated and replaced
  with a clean parsing interface that handles escaping.
@


1.29
log
@The code should now build fine with *BSD, so update the portability
task accordingly.
@
text
@d1 1
a1 1
$Id: TODO,v 1.28 2005/05/27 23:21:39 mux Exp $
d52 1
a52 1
- Add missing support for various CVSup options : -A, -k, -l, -1 and -r,
@


1.28
log
@- Use checkoutpath() in the detailer thread and stop calling chdir().
  This was the last place where we were not using absolute pathnames.
- Remove the corresponding task in the TODO list.
- Remove unused headers.
@
text
@d1 1
a1 1
$Id: TODO,v 1.27 2005/05/22 23:14:18 mux Exp $
d57 2
a58 3
- Make the code work on other systems than FreeBSD.  OpenBSD and NetBSD
  support will probably be easy, Linux support will probably require more
  work.  Solaris and Darwin support would also be nice.
@


1.27
log
@Ooops, protect against CVS tag expansion.
@
text
@d1 1
a1 1
$Id: TODO,v 1.26 2005/05/21 22:37:06 mux Exp $
a30 3
- Always use absolute pathnames and don't use chdir().  Depending on the
  threading library, we may not have a current working directory for each
  thread and it's wrong to rely on it.
@


1.26
log
@Add another thing I've just remembered.
@
text
@d1 1
a1 1
$Id: TODO,v 1.25 2005/05/11 18:42:37 mux Exp $
d21 1
a21 1
- The keyword API which deals with CVS tags ($Id$ and such) can't handle
@


1.25
log
@Add a paragraph about the configuration file parsing code.
@
text
@d1 1
a1 1
$Id: TODO,v 1.24 2005/05/11 18:38:48 mux Exp $
d21 6
@


1.24
log
@More precisions.
@
text
@d1 1
a1 1
$Id: TODO,v 1.23 2005/05/04 13:08:19 mux Exp $
d21 4
@


1.23
log
@Major update to the TODO file.  There is now a BUGS and a MISSING FEATURES
section.
@
text
@d1 1
a1 1
$Id: TODO,v 1.22 2004/06/18 19:35:39 mux Exp $
d7 3
a9 3
  \r -> carriage return and \\ -> backslash.  The code is riddled with
  strsep() calls, they need to be isolated and replaced with clean
  parsing interface that handles escaping.
d11 10
a20 5
  unable to properly handle failures.  We need the worker threads to
  return an exist status and possible an error message.  The stream API
  needs error numbers too, and a stream_eof() function. In case of an
  error, the updater thread needs to recover gracefully so as to write
  a proper status file.  I probably overlooked a few things.
@


1.22
log
@Implement zlib support.  This was a bit harder than I thought it
would be.  There are lots of changes in the stream API with this
commit, to better abstract the buffers and implement a filter
API which we use for zlib support.
@
text
@d1 3
a3 1
$Id: TODO,v 1.21 2004/04/05 10:26:38 mux Exp $
a4 3
- Parse, use and update status file.
- Consider computing the MD5 checksum when updating rather than after the
  diff/checkout is done, it would avoid reading the whole file two times.
d7 9
a15 1
  \r -> carriage return and \\ -> backslash.
d19 3
d26 11
a43 6
- If the prefix directory is a symbolic link pointing to a nonexistent
  file named `SKIP', then we should skip the collection, as described in
  the CVSup manual page.
- Cleanup error handling just about everywhere.
- Handle some signals (SIGINT, SIGPIPE and maybe others) gracefully, like
  CVSup does and like we should.
@


1.21
log
@- Implement buffer resizing in the stream API and lower the default
  size of the buffer to 1k only.
- Remove the corresponding task from TODO.
@
text
@d1 1
a1 1
$Id: TODO,v 1.20 2004/04/04 17:18:44 mux Exp $
a3 1
- Implement zlib compression.
d20 3
a22 3
  -s (requires status file support), -z and -Z (requires zlib compression
  support), -d, -i, -a (requires authentication support), -e and -E
  (requires shell commands support) and the destDir parameter.
@


1.20
log
@Remove done task.
@
text
@d1 1
a1 1
$Id: TODO,v 1.19 2004/03/21 22:59:51 mux Exp $
a4 1
- Make the stream API buffers resizable.
@


1.19
log
@We now correctly update file attributes.
@
text
@d1 1
a1 1
$Id: TODO,v 1.18 2004/02/15 20:16:50 mux Exp $
a7 1
- Properly close the channels at the end of a session.
@


1.18
log
@Add a new task.
@
text
@d1 1
a1 1
$Id: TODO,v 1.17 2004/02/15 16:19:01 mux Exp $
a7 1
- Update file attributes and not only their content.
@


1.17
log
@- The diff updating code fixing & cleaning is done.
- Reorder some tasks and change the description of one.
@
text
@d1 1
a1 1
$Id: TODO,v 1.16 2004/02/10 13:23:04 mux Exp $
d6 2
@


1.16
log
@Remove a done task.
@
text
@d1 1
a1 1
$Id: TODO,v 1.15 2004/02/05 17:25:16 mux Exp $
a2 3
- Fix the diff updating algorithm.
  - Make the stream API good enough to write files and use it in the diff
    updating code instead of mixing the stream and stdio APIs.
d5 1
d7 1
a13 3
- We can't handle lines bigger than STREAM_BUFSIZ at the moment.  This
  could be a problem if people have files with very big lines, which is
  more likely to happen if we are sent binary files.
a30 1
- Properly close the channels at the end of a session.
@


1.15
log
@Add more tasks.
@
text
@d1 1
a1 1
$Id: TODO,v 1.14 2004/02/05 17:19:53 mux Exp $
a3 2
  - Use a lineno_t type instead of intmax_t so that we can typedef it
    to long if C99 isn't supported.
@


1.14
log
@Add a $Id$ keyword.
@
text
@d1 1
a1 1
$Id$
d4 4
a7 2
- Make the stream API good enough to write files and use it in the diff
  updating code instead of mixing the stream and stdio APIs.
@


1.13
log
@Add two short-term tasks.
@
text
@d1 2
@


1.12
log
@This is a work in progress mostly on diff updating.  This is a huge
commit because I ended up cleaning and renaming lots of things.

- Implement keyword expansion, for now it only works with CVSHeader
  keywords but this is enough to allow me properly fix the diff
  updating algorithm.  There is a keyword API now.
- Rename the collection API to make it look a bit nicer.
- Update all the copyrights to include year 2004.
- Tidy up the stream API a bit.  Now stream_getln() takes a size
  parameter which is necessary to handle binary lines.  Also, it
  doesn't trash the last character of the last line of a file if it
  doesn't end with a newline.  Rename the stream_open() function to
  stream_reopen() which makes more sense.  Also add a convenient
  stream_open_file() wrapper.
- Move the diff updating code into its own file.
- Fix the checkout code so that it handles binary files correctly.
- Add a convenient updater_getpath() functions which returns a
  dynamically allocated string with the absolute pathname to the
  file to update based on the RCS file name and the base directory
  of the collection.  This avoid using chdir() which is unsafe since
  this program is multithreaded.
- Update TODO list (I'm sure I've forgotten stuff there).
- Tidy up the style.
- Restructure the SRCS variable assignment in the Makefile to make
  adding/removing files easier.
@
text
@d1 3
@


1.11
log
@Update.
@
text
@d3 1
a3 2
- Implement the diff updating method and possibly the rsync one.  Also,
  update file attributes and not only their content.
@


1.10
log
@Removed done entry.
@
text
@a2 2
- Rework ".+" handling by delaying the write of '\n' so that we don't
  need to use ftruncate() afterwards.
d11 3
a13 3
- We can't handle lines bigger than 4kB at the moment.  This could be a
  problem if people have files with very big lines, which is more likely
  to happen if we are sent binary files.
@


1.9
log
@Add an item and correct another.
@
text
@a2 3
- The delete updating command should prune empty directories that become
  empty.  This sounds like consistent with how we have to create them if
  they don't exist in the checkout method.
@


1.8
log
@Add a feature we need to implement.  This is depressing.
@
text
@d3 5
a7 3
- The delete updating command should apparently remove directories that
  become empty.  This sounds like consistent with how we have to create
  them if they don't exist in the checkout method.
@


1.7
log
@Add a known bug to the TODO list.
@
text
@d28 3
@


1.6
log
@- Move utility functions to misc.c and misc.h.
- Implement MD5file() which computes the MD5 checksum of a given file.
  MD5file() uses the OpenSSL library and is meant as a replacement for
  MD5File() from libmd which is unportable.
- Convert MD5File() consumers to use MD5file().
- Remove debugging printf()'s in the updater.
@
text
@d3 3
@


1.5
log
@If the server finishes sending a file with ".+" instead of just ".",
it means we should suppress the ending newline.  Implement that.
@
text
@a28 2
- Switch from libmd to the openssl library.  It is more portable and
  libmd should die soon in FreeBSD.
@


1.4
log
@Add more items and make one more precise.
@
text
@a2 3
- In the checkout updating method, if the server ends the file sending
  with ".+" and not ".", it means we should suppress the newline at the
  end of the last line.  Add support for that.
@


1.3
log
@Correct english and add more items.
@
text
@d3 3
d8 3
a10 3
- See how we are supposed to handle pathnames containing spaces.  There
  are chances CVSup is replacing them with "\_", just like it does for
  some error messages.  Currently, the code can't cope with that.
@


1.2
log
@Add some stuff to do.
@
text
@d16 2
a17 2
  to stay in line with CVSup, which just ignores them so as to maintain
  compatibility with sup.
d25 3
a27 2
- Cleanup error handling.
- Handle some signals gracefully, like CVSup does.
d29 10
a38 1
- Switch from libmd to openssl.
@


1.1
log
@Add a TODO file.
@
text
@d3 2
a4 1
- Implement the diff updating method and possibly the rsync one.
@

