summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/util.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-7/+7
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* An internal function called xrealloc() is actually a fail-hardderaadt2014-12-011-2/+2
| | | | reallocarray()... so rename it.
* Remove some includes and defines that are no longer needed, from Michaelnicm2011-04-201-2/+1
| | | | W Bombardieri.
* Nuke dead assignments and a dead function, from Michael W Bombardierinicm2010-11-111-24/+1
| | | | using lint.
* Add cvs_mkdir() for recursive directory creation on import, based on anicm2010-09-231-1/+42
| | | | | | diff from Michael W Bombardieri in PR 6398. tested by & ok jasper
* Reduce variable/function name and whitespace differences betweenray2010-07-231-6/+6
| | | | | | cvs/rcs. OK xsa zinovik
* use size_t for size, since atomicio() both accepts and returns itjoris2009-03-241-2/+3
|
* unused varjoris2009-02-231-3/+2
|
* we no longer push out Set-sticky to the client when writingjoris2009-02-231-9/+1
| | | | | | | | | | | | our Tag file on the server or in cvs_mkpath(), this caused problems for the "fast checkout" mechanism when a tag was supplied. instead, write out any directory sticky tag when we are checking out a file in that directory, this way we can use our "fast checkout" mechanism (no /tmp required) even for -r and -d without breaking working copies because they were missing CVS/Tag files. "looks good" tobias@
* in cvs_mkpath() always look for an existing CVS/Repository filejoris2009-02-211-2/+2
| | | | | | unless we're running checkout or export. otherwise we'll end up accidently overwriting it in certain cases on the client side of things.
* add a hash table mechanism based upon hcreate(3) but one that allowsjoris2008-06-211-1/+20
| | | | | | | | | | | | | us to maintain multiple hash tables concurrently. immediatly start using it to keep track of what directories we have already created and what CVS dirs we already created so we do not recreate them when we do not need to. we will be switching more internals to use this soon. rejoice for cheaper lookups. ok tobias@
* don't always re-open the same CVS/Entries file, instead keep thejoris2008-06-141-2/+1
| | | | | | | | | | | | last opened CVS/Entries around to operate on and close it whenever we switch directory. gives us a small performance boost, obviously. while doing this, switch the way we write revisions to disk by using fwrite(3) so stuff can get written to disk in chunks instead of writing everything line by line, another win. with help from otto@ ok tobias@
* completely kill the need for TMP_DIR when running checkout,joris2008-06-121-4/+5
| | | | | | | | | | | | | | which gives us better performance among other things. this is however disabled in a few cases: 1) whenever you run checkout over an existing tree (which acts as update) 2) whenever you specify -d or a module alias we're planning on enabling this behaviour for case 2 in the future. anoncvs sysadmins now love us even more. ok tobias@
* New trigger framework that allows us to run the required scriptsjoris2008-06-101-7/+44
| | | | | | | | | | defined in CVSROOT/commitinfo and CVSROOT/loginfo and so on. This enables the use of log_accum2 and all that other nice stuff we like. This was mostly written by Jonathan Armani with help from tobias@ and myself. ok tobias@
* be sure to build CVS/Root when updating and building directories (-d)joris2008-03-091-2/+4
|
* be sure to create CVS/Root if we added a new directory to the repository.joris2008-03-091-2/+2
|
* CVS/Entries file must be created in cvs_mkadmin, because they have to betobias2008-03-081-1/+18
| | | | | | available in empty directories too (containing only "D" then). ok joris
* do not overwrite CVS/Root in an existing tree whenever somebodyjoris2008-03-011-6/+9
| | | | specified a CVSROOT using alternate ways (-d or CVSROOT environ variable)
* use cvs_validate_directory() in cvs_get_repository_path() as well,joris2008-02-101-1/+2
| | | | | | since we want to make sure we have valid CVS/Repository content ok tobias@
* introduce cvs_validate_directory(), which is used to checkjoris2008-02-101-1/+5
| | | | | directory path to make sure they do not fall outside the CVSROOT or the working copy directory in a remote setup
* Respond with "Updated" instead of "Checked-in" on server-side if a clienttobias2008-02-101-2/+2
| | | | | | | | | committed files, so keywords are expanded properly. On client-side, we have to be careful about Directory ./ when it comes to commits, so add a test for CVS_OP_COMMIT. OK and help from joris@
* - cvs_write_tagfile() is not responsible to remove CVS/Tag itselfjoris2008-02-101-2/+2
| | | | | | - construct right CVS/Repository paths in cvs_mkpath() fixes remote Issues;
* Introduce cvs_ent_line_str() - formats CVS/Entries lines.xsa2008-02-091-3/+9
| | | | OK tobias@.
* unused var police, biatsh!joris2008-02-091-2/+1
|
* if the CVS/ directory already exists when we reach cvs_mkadmin()joris2008-02-091-10/+1
| | | | | | | | we will definatly need to recreate it with the correct information. otherwise sucessive checkouts of the same module with other arguments (like -rOPENBSD_X_X or -D "3 years ago") will not store the correct information.
* more CVSROOT/modules stuff:joris2008-02-041-1/+20
| | | | | | | | | | - support for -i flag: Run "prog" on "cvs commit" from top-level of module. - fix some memory leaks in modules.c - pass the line number from cvs_read_config() towards the callbacks so its easier to print out where it's going wrong, if it ever does. OK tobias@
* Stripped off 'nb', which was (or was supposed to be) used to distinguishtobias2008-02-041-6/+6
| | | | | | | between a named branch and a revision number supplied by -r. This can be done easier in cvs_write_tagfile directly. OK joris@
* better CVSROOT/module support, includes remote support and modulesjoris2008-02-031-7/+13
| | | | | | that are not aliases (-a); OK tobias@
* free RCSNUM's when we are done with them;joris2008-01-311-6/+4
| | | | ok tobias@
* Zap trailing whitespaces.xsa2008-01-311-2/+2
|
* Rework of cvs_get_repository_name.tobias2008-01-311-34/+30
| | | | | | | | | checkout is allowed to continue if CVS/Repository does not exist. export and import are not supposed to open CVS/Repository. All other commands -- if CVS_USE_WDIR is set -- must fatal if it does not exist. OK joris@
* Our directory entries in CVS/Entries had one slash too much -- zapped.tobias2008-01-311-2/+2
| | | | OK xsa@
* Fixed export to be fully functional and compliant to GNU cvs in local andtobias2008-01-211-2/+6
| | | | | | remote setups. OK xsa@
* xmalloc + memset -> xcalloctobias2008-01-101-7/+4
|
* another strcspn() roundtobias2008-01-101-6/+3
|
* cvs_mkpath missed to add all "yet to be added" directories into CVS/Entries,tobias2008-01-101-3/+15
| | | | thus making further access to these subdirectories rather difficult.
* cvs import must not parse files in local CVS directory.tobias2007-10-091-2/+2
| | | | OK niallo@
* strcspn() changegilles2007-10-051-3/+2
| | | | was okay'd by pyr@ and ok by millert@
* better branching/sticky tag support, no branch commits yet though.joris2007-09-221-3/+7
|
* Do not parse quoted strings because GNU cvs won't do so.tobias2007-09-191-37/+8
| | | | OK joris@
* Usage of fgetln() instead of fgets() in .cvsrc parsing handles linetobias2007-09-191-6/+4
| | | | | | numbers better and allows longer command arguments. OK joris@
* Added support for checkout -p with local repository.tobias2007-09-091-1/+11
| | | | OK joris@
* Removed dead code.tobias2007-09-041-33/+1
| | | | OK joris@, ray@
* Handle quotation marks in .cvsrc correctly.tobias2007-09-021-1/+4
| | | | OK joris@
* xcalloc is unneeded here since i is always 0 and we always use theray2007-07-191-2/+2
| | | | | | | | memory after initializing it. Initial diff from Igor Zinovik. OK niallo and xsa.
* Rework the way opencvs works in relation to files in the Attic/:joris2007-07-031-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, files in the 'Attic/' were linked into our filelist as being 'Attic/filename,v' this caused unneeded stress on certain functions like cvs_file_classify() who had to do pointer voodoo to split out the 'Attic/' part and do other very weird stuff to normalize the pathname of these files. Instead, we handle these files early in the start when we build the fileslist in cvs_repository_getdir(). When encountering the 'Attic/' directory, we recurse in it if required but instead of using the 'Attic/' directory component as our base directory we stick with the directory name where 'Attic/' resides in, resulting in the correct filename while maintaining the correct RCSpath for the file. This made the following things a lot easier: (and in most cases actually fixed the below points) - status with files in Attic/. - checking out HEAD repositories with files in Attic/. - checking out repositories with -rTAG. - updating with -rTAG. and as an added bonus the following now also works: - correctly creating CVS/Tag in both local and remote mode thus allowing update/status/and more to work correctly with the tagged tree. (thanks to the correct handling of -rTAG cases). - resetting tags with opencvs -A properly works too now. This is a major step forward into the usability of OpenCVS when it comes to maintaining multiple tagged trees, the next logical step would be to fix commiting to branches. enjoy you -stable cowards. tested by myself, xsa, niallo and ckuethe thanks guys!
* Since xrealloc dies on failure it is safe to directly assign to theray2007-05-291-4/+2
| | | | | | | | | original pointer. Theo agrees, and so does the rest of the tree (ssh, etc. all do this already). Saves a bunch of variables and assignments. OK niallo@
* Fix off-by-one, from Tobias Stoeckmann.ray2007-05-271-2/+2
| | | | OK niallo@
* cvs_splitpath() isn't used anymore; from Tobias Stoeckmann.xsa2007-05-091-40/+1
|
* - correct signal handling and process waiting for the EDITOR support codexsa2007-04-201-25/+1
| | | | | | | | (From ray's code in sendbug(1)) - nuke cvs_exec() as it is not used anymore Prompted by deraadt@ a few weeks ago. OK ray@.