From: tholo Date: Sat, 27 Apr 1996 20:26:01 +0000 (+0000) Subject: Integrate local changes to CVS X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=453811198a77bab4c647198cb699eaee91f05c73;p=openbsd Integrate local changes to CVS --- diff --git a/gnu/usr.bin/cvs/Makefile.in b/gnu/usr.bin/cvs/Makefile.in index 2f0016581bc..1a6b83b1813 100644 --- a/gnu/usr.bin/cvs/Makefile.in +++ b/gnu/usr.bin/cvs/Makefile.in @@ -90,20 +90,25 @@ FLAGS_TO_PASS = \ DISTFILES = \ COPYING COPYING.LIB INSTALL README TODO PROJECTS \ - BUGS MINOR-BUGS FAQ \ + BUGS MINOR-BUGS FAQ HACKING \ ChangeLog NEWS ChangeLog.zoo \ configure configure.in stamp-h.in config.h.in Makefile.in acconfig.h \ - config.sub config.guess \ cvs-format.el mkinstalldirs install-sh cvsinit.sh \ cvsnt.mak \ .cvsignore PROGS = cvsinit -# Subdirectories to run make in for the primary targets. +### Subdirectories to run make in for the primary targets. +# Unix source subdirs, where we'll want to run lint and etags: +USOURCE_SUBDIRS = lib src +# Documentation directories; special handling INSTALL_MAN=man -SUBDIRS = lib src ${INSTALL_MAN} doc contrib examples windows-NT os2 macintosh +# All other subdirs: +SUBDIRS = ${USOURCE_SUBDIRS} ${INSTALL_MAN} doc contrib examples windows-NT os2 macintosh # Only make TAGS/tags files in these directories, in this order +# [Why in this order? If we didn't have to stick to this order, we +# could make "TSUBDIRS = ${USOURCE_SUBDIRS}". -Karl] TSUBDIRS= src lib # Set default target. @@ -215,7 +220,7 @@ installcheck: .PHONY: lint lint: - @for dir in $(SUBDIRS); do cd $$dir && $(MAKE) $(FLAGS_TO_PASS) xlint || exit 1; cd ..; done + @for dir in $(USOURCE_SUBDIRS); do cd $$dir && $(MAKE) $(FLAGS_TO_PASS) xlint || exit 1; cd ..; done .PHONY: dist GZIP=gzip --best diff --git a/gnu/usr.bin/cvs/configure b/gnu/usr.bin/cvs/configure index fdaa36c7a4e..9b115c27086 100644 --- a/gnu/usr.bin/cvs/configure +++ b/gnu/usr.bin/cvs/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.4 +# Generated automatically using autoconf version 2.7 # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -12,7 +12,7 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help - --with-krb4=value set default \$KRB4 from value" + --with-krb4=value set default \$(KRB4) from value" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -35,9 +35,22 @@ target=NONE verbose= x_includes=NONE x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' # Initialize some other variables. subdirs= +MFLAGS= MAKEFLAGS= ac_prev= for ac_option @@ -59,9 +72,14 @@ do case "$ac_option" in - -build | --build | --buil | --bui | --bu | --b) + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*) + -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ @@ -71,6 +89,12 @@ do | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. @@ -121,12 +145,29 @@ Configuration: Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] - --exec-prefix=PREFIX install architecture-dependent files in PREFIX + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] @@ -138,8 +179,10 @@ Features and packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR ---enable and --with options recognized:$ac_help EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi exit 0 ;; -host | --host | --hos | --ho) @@ -147,6 +190,44 @@ EOF -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; @@ -159,6 +240,15 @@ EOF | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) @@ -199,6 +289,23 @@ EOF | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) @@ -209,6 +316,13 @@ EOF -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) @@ -218,7 +332,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.4" + echo "configure generated by autoconf version 2.7" exit 0 ;; -with-* | --with-*) @@ -264,7 +378,7 @@ EOF -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; - *) + *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi @@ -383,9 +497,12 @@ fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' -ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' +ac_cpp='echo $CPP $CPPFLAGS 1>&5; +$CPP $CPPFLAGS' +ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5; +${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' +ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5; +${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. @@ -446,6 +563,7 @@ else ac_cv_prog_gcc=no fi fi + echo "$ac_t""$ac_cv_prog_gcc" 1>&6 if test $ac_cv_prog_gcc = yes; then GCC=yes @@ -463,7 +581,8 @@ fi rm -f conftest* fi - echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 + +echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 if test $ac_cv_prog_gcc_g = yes; then CFLAGS="-g -O" else @@ -491,7 +610,7 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error @@ -505,7 +624,7 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error @@ -532,7 +651,7 @@ echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < EOF @@ -669,7 +788,7 @@ else ac_cv_c_cross=yes else cat > conftest.$ac_ext <&6 +cross_compiling=$ac_cv_c_cross echo $ac_n "checking for working const""... $ac_c" 1>&6 @@ -691,7 +811,7 @@ if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF @@ -766,7 +887,7 @@ else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <&2; exit 1; } else cat > conftest.$ac_ext <&6 if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then cat >> confdefs.h <<\EOF @@ -823,7 +945,7 @@ else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&6 case "$ac_cv_c_inline" in inline | yes) ;; @@ -912,10 +1035,17 @@ else esac done IFS="$ac_save_ifs" - # As a last resort, use the slow shell script. - test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh" + fi - INSTALL="$ac_cv_path_install" + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi fi echo "$ac_t""$INSTALL" 1>&6 @@ -1094,6 +1224,7 @@ else fi rm -f conftest fi + echo "$ac_t""$ac_cv_sys_interpreter" 1>&6 if test X"$ac_cv_sys_interpreter" != X"yes" ; then @@ -1107,7 +1238,7 @@ if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1129,7 +1260,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1147,7 +1278,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1165,10 +1296,10 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then - ac_cv_header_stdc=no + : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1189,6 +1320,7 @@ fi rm -fr conftest* fi fi + echo "$ac_t""$ac_cv_header_stdc" 1>&6 if test $ac_cv_header_stdc = yes; then cat >> confdefs.h <<\EOF @@ -1207,7 +1339,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1225,7 +1357,7 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` cat >> confdefs.h <&6 else cat > conftest.$ac_ext < #include @@ -1267,6 +1399,7 @@ fi rm -f conftest* fi + echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 if test $ac_cv_header_sys_wait_h = yes; then cat >> confdefs.h <<\EOF @@ -1280,7 +1413,7 @@ if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1321,6 +1454,7 @@ fi rm -f conftest* fi + echo "$ac_t""$ac_cv_header_stat_broken" 1>&6 if test $ac_cv_header_stat_broken = yes; then cat >> confdefs.h <<\EOF @@ -1334,7 +1468,7 @@ if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1354,6 +1488,7 @@ fi rm -f conftest* fi + echo "$ac_t""$ac_cv_header_time" 1>&6 if test $ac_cv_header_time = yes; then cat >> confdefs.h <<\EOF @@ -1371,7 +1506,7 @@ if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1392,7 +1527,7 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdedfghijklmnopqrstuvwxyz./\055' 'ABCDEDFGHIJKLMNOPQRSTUVWXYZ___'` cat >> confdefs.h <&6 -if eval "test \"`echo '$''{'ac_cv_lib_dir'+set}'`\" = set"; then +ac_lib_var=`echo dir | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&6 LIBS="$LIBS -ldir" else @@ -1438,13 +1574,14 @@ fi else echo $ac_n "checking for -lx""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_x'+set}'`\" = set"; then +ac_lib_var=`echo x | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&6 LIBS="$LIBS -lx" else @@ -1477,7 +1614,7 @@ if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1485,9 +1622,11 @@ else #undef signal #endif #ifdef __cplusplus -extern "C" -#endif +extern "C" void (*signal (int, void (*)(int)))(int); +#else void (*signal ()) (); +#endif + int main() { return 0; } int t() { int i; @@ -1503,6 +1642,7 @@ fi rm -f conftest* fi + echo "$ac_t""$ac_cv_type_signal" 1>&6 cat >> confdefs.h <&6 else cat > conftest.$ac_ext < EOF @@ -1529,6 +1669,7 @@ fi rm -f conftest* fi + echo "$ac_t""$ac_cv_type_uid_t" 1>&6 if test $ac_cv_type_uid_t = no; then cat >> confdefs.h <<\EOF @@ -1546,7 +1687,7 @@ if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1577,7 +1718,7 @@ if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1608,7 +1749,7 @@ if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1634,20 +1775,20 @@ EOF fi -for ac_func in getwd mkdir rename strdup strstr dup2 strerror valloc waitpid memmove +for ac_func in getwd mkdir rename strdup strstr dup2 strerror valloc waitpid memmove vasprintf strtoul do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ -char $ac_func(); +char $ac_func(); int main() { return 0; } int t() { @@ -1690,13 +1831,13 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ -char $ac_func(); +char $ac_func(); int main() { return 0; } int t() { @@ -1724,7 +1865,7 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ -char re_exec(); +char re_exec(); int main() { return 0; } int t() { @@ -1789,7 +1930,7 @@ if test "$cross_compiling" = yes; then ac_cv_func_utime_null=no else cat > conftest.$ac_ext < #include @@ -1810,6 +1951,7 @@ fi rm -fr conftest* rm -f core core.* *.core fi + echo "$ac_t""$ac_cv_func_utime_null" 1>&6 if test $ac_cv_func_utime_null = yes; then cat >> confdefs.h <<\EOF @@ -1818,219 +1960,6 @@ EOF fi -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -int main() { return 0; } -int t() { -char *p = alloca(2 * sizeof(int)); -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - ac_cv_header_alloca_h=yes -else - rm -rf conftest* - ac_cv_header_alloca_h=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 -if test $ac_cv_header_alloca_h = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA_H 1 -EOF - -fi - -echo $ac_n "checking for alloca""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif -# endif -#endif - -int main() { return 0; } -int t() { -char *p = (char *) alloca(1); -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - ac_cv_func_alloca=yes -else - rm -rf conftest* - ac_cv_func_alloca=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_func_alloca" 1>&6 -if test $ac_cv_func_alloca = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA 1 -EOF - -fi - -if test $ac_cv_func_alloca = no; then - # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.o - cat >> confdefs.h <<\EOF -#define C_ALLOCA 1 -EOF - - -echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 | - egrep "webecray" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_os_cray=yes -else - rm -rf conftest* - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_os_cray" 1>&6 -if test $ac_cv_os_cray = yes; then -for ac_func in _getb67 GETB67 getb67; do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -char $ac_func(); - -int main() { return 0; } -int t() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if eval $ac_link; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* - -fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <&6 -fi - -done -fi - -echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_stack_direction=0 -else -cat > conftest.$ac_ext < addr) ? 1 : -1; -} -main () -{ - exit (find_stack_direction() < 0); -} -EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_c_stack_direction=1 -else - ac_cv_c_stack_direction=-1 -fi -fi -rm -fr conftest* -fi -echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 -cat >> confdefs.h <&6 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2058,6 +1987,7 @@ for ac_dir in `eval echo . /tmp /var/tmp /usr/tmp $prefix/lib $exec_prefix/lib` rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null done fi + echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6 if test $ac_cv_sys_long_file_names = yes; then cat >> confdefs.h <<\EOF @@ -2075,7 +2005,7 @@ else ccvs_cv_sys_working_fnmatch=no else cat > conftest.$ac_ext < @@ -2105,8 +2035,8 @@ echo "$ac_t""$ccvs_cv_sys_working_fnmatch" 1>&6 KRB4=/usr/kerberos # Check whether --with-krb4 or --without-krb4 was given. -withval="$with_krb4" -if test -n "$withval"; then +if test "${with_krb4+set}" = set; then + withval="$with_krb4" KRB4=$withval fi echo "default place for krb4 is $KRB4" @@ -2120,7 +2050,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2154,7 +2084,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -2184,7 +2114,7 @@ EOF krb_h= echo $ac_n "checking for krb.h""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } @@ -2201,7 +2131,7 @@ else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -I$KRB4/include" cat > conftest.$ac_ext < int main() { return 0; } @@ -2222,7 +2152,7 @@ rm -f conftest* if test -z "$krb_h"; then cat > conftest.$ac_ext < int main() { return 0; } @@ -2239,7 +2169,7 @@ else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV" cat > conftest.$ac_ext < int main() { return 0; } @@ -2264,13 +2194,14 @@ echo "$ac_t""$krb_h" 1>&6 if test -n "$krb_h"; then krb_lib= echo $ac_n "checking for -lkrb""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_krb'+set}'`\" = set"; then +ac_lib_var=`echo krb | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lkrb $LIBS" cat > conftest.$ac_ext <&6 krb_lib=yes krb_libdir= else @@ -2307,13 +2238,14 @@ EOF test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}" LIBS="${LIBS} -lkrb" echo $ac_n "checking for -ldes""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_des'+set}'`\" = set"; then +ac_lib_var=`echo des | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldes $LIBS" cat > conftest.$ac_ext <&6 LIBS="${LIBS} -ldes" else @@ -2352,13 +2284,13 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ -char $ac_func(); +char $ac_func(); int main() { return 0; } int t() { @@ -2386,7 +2318,7 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ -char connect(); +char connect(); int main() { return 0; } int t() { @@ -2447,13 +2379,14 @@ else case "$LIBS" in *-lnsl*) ;; *) echo $ac_n "checking for -lnsl_s""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_lib_nsl_s'+set}'`\" = set"; then +ac_lib_var=`echo nsl_s | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lnsl_s $LIBS" cat > conftest.$ac_ext <&6 - ac_tr_lib=HAVE_LIB`echo nsl_s | tr '[a-z]' '[A-Z]'` + ac_tr_lib=HAVE_LIB`echo nsl_s | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 -if eval "test \"`echo '$''{'ac_cv_lib_nsl'+set}'`\" = set"; then +ac_lib_var=`echo nsl | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&6 - ac_tr_lib=HAVE_LIB`echo nsl | tr '[a-z]' '[A-Z]'` + ac_tr_lib=HAVE_LIB`echo nsl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 -if eval "test \"`echo '$''{'ac_cv_lib_socket'+set}'`\" = set"; then +ac_lib_var=`echo socket | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&6 - ac_tr_lib=HAVE_LIB`echo socket | tr '[a-z]' '[A-Z]'` + ac_tr_lib=HAVE_LIB`echo socket | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 -if eval "test \"`echo '$''{'ac_cv_lib_inet'+set}'`\" = set"; then +ac_lib_var=`echo inet | tr '.-/+' '___p'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <&6 - ac_tr_lib=HAVE_LIB`echo inet | tr '[a-z]' '[A-Z]'` + ac_tr_lib=HAVE_LIB`echo inet | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ -char $ac_func(); +char $ac_func(); int main() { return 0; } int t() { @@ -2654,7 +2590,7 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'` + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ -char gethostname(); +char gethostname(); int main() { return 0; } int t() { @@ -2723,6 +2659,11 @@ cat >> confdefs.h <<\EOF #define SERVER_SUPPORT 1 EOF +# As far as I know this works on all machines which use configure (i.e. unix) +cat >> confdefs.h <<\EOF +#define AUTH_SERVER_SUPPORT 1 +EOF + fi test -f src/options.h && ( @@ -2808,7 +2749,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.4" + echo "$CONFIG_STATUS generated by autoconf version 2.7" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -2823,10 +2764,12 @@ trap 'rm -fr `echo "Makefile lib/Makefile src/Makefile doc/Makefile \ man/Makefile contrib/Makefile contrib/pcl-cvs/Makefile \ examples/Makefile windows-NT/Makefile os2/Makefile \ macintosh/Makefile stamp-h config.h src/options.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\CEOF +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@CFLAGS@%$CFLAGS%g @@ -2838,6 +2781,18 @@ s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@CVS@%$CVS%g @@ -2849,7 +2804,6 @@ s%@SET_MAKE@%$SET_MAKE%g s%@perl_path@%$perl_path%g s%@csh_path@%$csh_path%g s%@LIBOBJS@%$LIBOBJS%g -s%@ALLOCA@%$ALLOCA%g s%@KRB4@%$KRB4%g s%@includeopt@%$includeopt%g @@ -2953,7 +2907,7 @@ EOF # Transform confdefs.h into a sed script conftest.vals that substitutes # the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. +# Protect against being on the right side of a sed subst in config.status. # Protect against being in an unquoted here document in config.status. rm -f conftest.vals cat > conftest.hdr <<\EOF diff --git a/gnu/usr.bin/cvs/configure.in b/gnu/usr.bin/cvs/configure.in index 32eb799273a..246c92fa29b 100644 --- a/gnu/usr.bin/cvs/configure.in +++ b/gnu/usr.bin/cvs/configure.in @@ -49,11 +49,10 @@ AC_TYPE_UID_T AC_TYPE_MODE_T AC_TYPE_SIZE_T AC_TYPE_PID_T -AC_REPLACE_FUNCS(getwd mkdir rename strdup strstr dup2 strerror valloc waitpid memmove) +AC_REPLACE_FUNCS(getwd mkdir rename strdup strstr dup2 strerror valloc waitpid memmove vasprintf strtoul) AC_CHECK_FUNCS(fchmod fsync ftime mkfifo putenv setvbuf vfork vprintf ftruncate timezone getpagesize fchdir sigaction sigprocmask sigvec sigsetmask sigblock) AC_CHECK_FUNC(re_exec, :, LIBOBJS="$LIBOBJS regex.o") AC_FUNC_UTIME_NULL -AC_FUNC_ALLOCA AC_SYS_LONG_FILE_NAMES AC_MSG_CHECKING([for working fnmatch function]) @@ -76,12 +75,12 @@ fi AC_MSG_RESULT($ccvs_cv_sys_working_fnmatch) dnl -dnl set $KRB4 from --with-krb4=value -- WITH_KRB4 +dnl set $(KRB4) from --with-krb4=value -- WITH_KRB4 dnl KRB4=/usr/kerberos define(WITH_KRB4,[ AC_ARG_WITH([krb4], - [ --with-krb4=value set default \$KRB4 from value], + [ --with-krb4=value set default \$(KRB4) from value], [KRB4=$withval], )dnl echo "default place for krb4 is $KRB4" @@ -165,6 +164,8 @@ AC_CHECK_FUNC(gethostname, :, LIBOBJS="$LIBOBJS hostname.o") if test "$ac_cv_func_connect" = yes; then AC_DEFINE(CLIENT_SUPPORT) AC_DEFINE(SERVER_SUPPORT) +# As far as I know this works on all machines which use configure (i.e. unix) +AC_DEFINE(AUTH_SERVER_SUPPORT) fi test -f src/options.h && ( diff --git a/gnu/usr.bin/cvs/lib/alloca.c b/gnu/usr.bin/cvs/lib/alloca.c deleted file mode 100644 index b57659e418c..00000000000 --- a/gnu/usr.bin/cvs/lib/alloca.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - alloca -- (mostly) portable public-domain implementation -- D A Gwyn - - last edit: 86/05/30 rms - include config.h, since on VMS it renames some symbols. - Use xmalloc instead of malloc. - - This implementation of the PWB library alloca() function, - which is used to allocate space off the run-time stack so - that it is automatically reclaimed upon procedure exit, - was inspired by discussions with J. Q. Johnson of Cornell. - - It should work under any C implementation that uses an - actual procedure stack (as opposed to a linked list of - frames). There are some preprocessor constants that can - be defined when compiling for your specific system, for - improved efficiency; however, the defaults should be okay. - - The general concept of this implementation is to keep - track of all alloca()-allocated blocks, and reclaim any - that are found to be deeper in the stack than the current - invocation. This heuristic does not reclaim storage as - soon as it becomes invalid, but it will do so eventually. - - As a special case, alloca(0) reclaims storage without - allocating any. It is a good idea to use alloca(0) in - your main control loop, etc. to force garbage collection. -*/ -#ifndef lint -static char SCCSid[] = "@(#)alloca.c 1.1"; /* for the "what" utility */ -#endif - -#if defined(emacs) || defined(HAVE_CONFIG_H) -#include "config.h" -#ifdef static -/* actually, only want this if static is defined as "" - -- this is for usg, in which emacs must undefine static - in order to make unexec workable - */ -#ifndef STACK_DIRECTION -you -lose --- must know STACK_DIRECTION at compile-time -#endif /* STACK_DIRECTION undefined */ -#endif /* static */ -#endif /* emacs || HAVE_CONFIG_H*/ - -#if __STDC__ -typedef void *pointer; /* generic pointer type */ -#else -typedef char *pointer; /* generic pointer type */ -#endif - -#define NULL 0 /* null pointer constant */ - -extern void free(); -extern pointer xmalloc(); - -/* - Define STACK_DIRECTION if you know the direction of stack - growth for your system; otherwise it will be automatically - deduced at run-time. - - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown -*/ - -#ifndef STACK_DIRECTION -#define STACK_DIRECTION 0 /* direction unknown */ -#endif - -#if STACK_DIRECTION != 0 - -#define STACK_DIR STACK_DIRECTION /* known at compile-time */ - -#else /* STACK_DIRECTION == 0; need run-time code */ - -static int stack_dir; /* 1 or -1 once known */ -#define STACK_DIR stack_dir - -static void -find_stack_direction (/* void */) -{ - static char *addr = NULL; /* address of first - `dummy', once known */ - auto char dummy; /* to get stack address */ - - if (addr == NULL) - { /* initial entry */ - addr = &dummy; - - find_stack_direction (); /* recurse once */ - } - else /* second entry */ - if (&dummy > addr) - stack_dir = 1; /* stack grew upward */ - else - stack_dir = -1; /* stack grew downward */ -} - -#endif /* STACK_DIRECTION == 0 */ - -/* - An "alloca header" is used to: - (a) chain together all alloca()ed blocks; - (b) keep track of stack depth. - - It is very important that sizeof(header) agree with malloc() - alignment chunk size. The following default should work okay. -*/ - -#ifndef ALIGN_SIZE -#define ALIGN_SIZE sizeof(double) -#endif - -typedef union hdr -{ - char align[ALIGN_SIZE]; /* to force sizeof(header) */ - struct - { - union hdr *next; /* for chaining headers */ - char *deep; /* for stack depth measure */ - } h; -} header; - -/* - alloca( size ) returns a pointer to at least `size' bytes of - storage which will be automatically reclaimed upon exit from - the procedure that called alloca(). Originally, this space - was supposed to be taken from the current stack frame of the - caller, but that method cannot be made to work for some - implementations of C, for example under Gould's UTX/32. -*/ - -static header *last_alloca_header = NULL; /* -> last alloca header */ - -pointer -alloca (size) /* returns pointer to storage */ - unsigned size; /* # bytes to allocate */ -{ - auto char probe; /* probes stack depth: */ - register char *depth = &probe; - -#if STACK_DIRECTION == 0 - if (STACK_DIR == 0) /* unknown growth direction */ - find_stack_direction (); -#endif - - /* Reclaim garbage, defined as all alloca()ed storage that - was allocated from deeper in the stack than currently. */ - - { - register header *hp; /* traverses linked list */ - - for (hp = last_alloca_header; hp != NULL;) - if (STACK_DIR > 0 && hp->h.deep > depth - || STACK_DIR < 0 && hp->h.deep < depth) - { - register header *np = hp->h.next; - - free ((pointer) hp); /* collect garbage */ - - hp = np; /* -> next header */ - } - else - break; /* rest are not deeper */ - - last_alloca_header = hp; /* -> last valid storage */ - } - - if (size == 0) - return NULL; /* no allocation required */ - - /* Allocate combined header + user data storage. */ - - { - register pointer new = xmalloc (sizeof (header) + size); - /* address of header */ - - ((header *)new)->h.next = last_alloca_header; - ((header *)new)->h.deep = depth; - - last_alloca_header = (header *)new; - - /* User storage begins just after header. */ - - return (pointer)((char *)new + sizeof(header)); - } -} - diff --git a/gnu/usr.bin/cvs/lib/save-cwd.c b/gnu/usr.bin/cvs/lib/save-cwd.c deleted file mode 100644 index 1bdf7911510..00000000000 --- a/gnu/usr.bin/cvs/lib/save-cwd.c +++ /dev/null @@ -1,141 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include - -#ifdef STDC_HEADERS -# include -#endif - -#ifdef HAVE_UNISTD_H -# include -#endif - -#ifdef HAVE_FCNTL_H -# include -#else -# include -#endif - -#ifdef HAVE_DIRECT_H -# include -#endif - -#ifdef HAVE_IO_H -# include -#endif - -#include -# ifndef errno -extern int errno; -#endif - -#include "save-cwd.h" -#include "error.h" - -char *xgetwd __PROTO((void)); - -/* Record the location of the current working directory in CWD so that - the program may change to other directories and later use restore_cwd - to return to the recorded location. This function may allocate - space using malloc (via xgetwd) or leave a file descriptor open; - use free_cwd to perform the necessary free or close. Upon failure, - no memory is allocated, any locally opened file descriptors are - closed; return non-zero -- in that case, free_cwd need not be - called, but doing so is ok. Otherwise, return zero. */ - -int -save_cwd (cwd) - struct saved_cwd *cwd; -{ - static int have_working_fchdir = 1; - - cwd->desc = -1; - cwd->name = NULL; - - if (have_working_fchdir) - { -#ifdef HAVE_FCHDIR - cwd->desc = open (".", O_RDONLY); - if (cwd->desc < 0) - { - error (0, errno, "cannot open current directory"); - return 1; - } - -# if __sun__ || sun - /* On SunOS 4, fchdir returns EINVAL if accounting is enabled, - so we have to fall back to chdir. */ - if (fchdir (cwd->desc)) - { - if (errno == EINVAL) - { - close (cwd->desc); - cwd->desc = -1; - have_working_fchdir = 0; - } - else - { - error (0, errno, "current directory"); - close (cwd->desc); - cwd->desc = -1; - return 1; - } - } -# endif /* __sun__ || sun */ -#else -#define fchdir(x) (abort (), 0) - have_working_fchdir = 0; -#endif - } - - if (!have_working_fchdir) - { - cwd->name = xgetwd (); - if (cwd->name == NULL) - { - error (0, errno, "cannot get current directory"); - return 1; - } - } - return 0; -} - -/* Change to recorded location, CWD, in directory hierarchy. - If "saved working directory", NULL)) - */ - -int -restore_cwd (cwd, dest) - const struct saved_cwd *cwd; - const char *dest; -{ - int fail = 0; - if (cwd->desc >= 0) - { - if (fchdir (cwd->desc)) - { - error (0, errno, "cannot return to %s", - (dest ? dest : "saved working directory")); - fail = 1; - } - } - else if (chdir (cwd->name) < 0) - { - error (0, errno, "%s", cwd->name); - fail = 1; - } - return fail; -} - -void -free_cwd (cwd) - struct saved_cwd *cwd; -{ - if (cwd->desc >= 0) - close (cwd->desc); - if (cwd->name) - free (cwd->name); -} - diff --git a/gnu/usr.bin/cvs/lib/save-cwd.h b/gnu/usr.bin/cvs/lib/save-cwd.h deleted file mode 100644 index f9802f8ca2f..00000000000 --- a/gnu/usr.bin/cvs/lib/save-cwd.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef SAVE_CWD_H -#define SAVE_CWD_H 1 - -struct saved_cwd - { - int desc; - char *name; - }; - -#if defined (__GNUC__) || (defined (__STDC__) && __STDC__) -#define __PROTO(args) args -#else -#define __PROTO(args) () -#endif /* GCC. */ - -int save_cwd __PROTO((struct saved_cwd *cwd)); -int restore_cwd __PROTO((const struct saved_cwd *cwd, const char *dest)); -void free_cwd __PROTO((struct saved_cwd *cwd)); - -#endif /* SAVE_CWD_H */ diff --git a/gnu/usr.bin/cvs/man/mkmodules.1 b/gnu/usr.bin/cvs/man/mkmodules.1 deleted file mode 100644 index 8196a47f137..00000000000 --- a/gnu/usr.bin/cvs/man/mkmodules.1 +++ /dev/null @@ -1,65 +0,0 @@ -.\" -.\" $CVSid: @(#)mkmodules.1 1.3 92/01/30 $ -.\" -.TH MKMODULES 1 "12 October 1991" -.SH "NAME" -mkmodules \- Rebuild modules database for CVS -.SH "SYNOPSIS" -.B mkmodules -.I directory -.SH "DESCRIPTION" -.B mkmodules -rebuilds the modules database that -.BR cvs (1) -uses. -The -.I directory -specified is expected to contain the -.BR modules,v " and " loginfo,v -files. -.B mkmodules -carefully checks out the current head revisions of each of these files and -reuilds the -.BR ndbm (3) -format modules database. -A warning is generated if the modules file contains a duplicate key. -.SH "FILES" -.TP -modules,v -The modules -.SM RCS -file. -.TP -modules -The checked out modules file. -.TP -loginfo,v -The loginfo -.SM RCS -file. -.TP -loginfo -The checked out loginfo file. -.TP -modules.dir, modules.pag -The -.BR ndbm (1) -format modules database. -.SH "ENVIRONMENT VARIABLES" -.TP -.SM RCSBIN -Specifies the full pathname where to find -.SM RCS -programs, such as -.BR co (1) -and -.BR ci (1). -If not set, the default is -.BR /usr/local/bin . -.SH "SEE ALSO" -.BR checkin (1), -.BR co (1), -.BR cvs (1), -.BR ndbm (3), -.BR rcs (1), -.SH "BUGS" diff --git a/gnu/usr.bin/cvs/src/ChangeLog.fsf b/gnu/usr.bin/cvs/src/ChangeLog.fsf deleted file mode 100644 index 47ef44dfeb1..00000000000 --- a/gnu/usr.bin/cvs/src/ChangeLog.fsf +++ /dev/null @@ -1,520 +0,0 @@ -Thu Sep 15 08:20:23 1994 Jim Kingdon (kingdon@lioth.cygnus.com) - - * subr.c (run_setup, run_args): Check USE_PROTOTYPES if defined - instead of __STDC__, just like cvs.h does. - -Thu Sep 15 00:14:58 1994 david d `zoo' zuhn - - * main.c: rename nocvsrc to use_cvsrc, don`t read ~/.cvsrc when -H - has been seen - -Wed Sep 14 21:55:17 1994 david d `zoo' zuhn - - * cvs.h, subr.c: use size_t for xmalloc, xrealloc, and xstrdup - parameters - - * cvsrc.c: optimize away two calls of getenv - - * commit.c, subr.c: use mode_t for file mode values (Thanks to jtc@cygnus.com) - - * main.c: update copyrights in -v message - -Tue Sep 6 10:29:13 1994 J.T. Conklin (jtc@rtl.cygnus.com) - - * hash.c (hashp): Replace hash function with one from p436 of the - Dragon book (via libg++'s hash.cc) which has *much* better - behavior. - -Wed Aug 17 09:37:44 1994 J.T. Conklin (jtc@cygnus.com) - - * find_names.c (find_dirs): Use 4.4BSD filesystem feature (it - contains the file type in the dirent structure) to avoid - stat'ing each file. - -Tue Aug 16 11:15:12 1994 J.T. Conklin (jtc@cygnus.com) - - * rcs.h (struct rcsnode): add symbols_data field. - * rcs.c (RCS_parsercsfile_i): store value of rcs symbols in - symbols_data instead of parsing it. - (RCS_symbols): New function used for lazy symbols parsing. - Build a list out of symbols_data and store it in symbols if it - hasn't been done already, and return the list of symbols. - (RCS_gettag, RCS_magicrev, RCS_nodeisbranch, RCS_whatbranch): - Use RCS_symbols. - * status.c: (status_fileproc): Use RCS_symbols. - -Thu Jul 14 13:02:51 1994 david d `zoo' zuhn (zoo@monad.armadillo.com) - - * src/diff.c (diff_fileproc): add support for "cvs diff -N" which - allows for adding or removing files via patches. (from - K. Richard Pixley ) - -Wed Jul 13 10:52:56 1994 J.T. Conklin (jtc@phishhead.cygnus.com) - - * cvs.h: Add macro CVSRFLPAT, a string containing a shell wildcard - expression that matches read lock files. - * lock.c (readers_exist): Reorganized to use CVSRFLPAT and to not - compute the full pathname unless the file matches. - - * rcs.h: Add macro RCSPAT, a string containing a shell wildcard - expression that matches RCS files. - * find_names.c (find_rcs, find_dirs): Use RCSPAT. - -Fri Jul 8 07:02:08 1994 Jim Kingdon (kingdon@lioth.cygnus.com) - - * entries.c (Register): Pass two arguments to write_ent_proc, in - accordance with its declaration. - -Thu Jun 30 09:08:57 1994 Jim Kingdon (kingdon@lioth.cygnus.com) - - * logmsg.c (do_editor): Fix typo ("c)continue" -> "c)ontinue"). - -Thu Jun 23 18:28:12 1994 J.T. Conklin (jtc@phishhead.cygnus.com) - - * find_names.c (find_rcs, find_dirs): use fnmatch instead of - re_comp/re_exec for wildcard matching. - * lock.c (readers_exist): Likewise. - -Fri May 20 08:13:10 1994 Jim Kingdon (kingdon@lioth.cygnus.com) - - * modules.c (do_module): If something is aliased to itself, print - an error message rather than recursing. - -Fri May 6 19:25:28 1994 david d zuhn (zoo@monad.armadillo.com) - - * cvsrc.c (read_cvsrc): use open_file for error checking - -Sat Feb 26 10:59:37 1994 david d zuhn (zoo@monad.armadillo.com) - - * import.c: use $TMPDIR if available, instead of relying on /tmp - -Mon Jan 24 19:10:03 1994 david d zuhn (zoo@monad.armadillo.com) - - * update.c (joining): compare join_rev1 with NULL instead of - casting pointer to an int - - * options.h: remove S_IWRITE, S_IWGRP, S_IWOTH macros - - * logmsg.c: #if 0 around gethostbyname prototype - - * hash.c (printnode), find_names.c (add_entries_proc), - entries.c (write_ent_proc): correct declaration for function - (added void *closure) - - * cvs.h: header include order reorganization: First include the - program config headers (config.h, options.h). Then include any - system headers (stdio.h, unistd.h). Last, get the program - headers and any cvs supplied library support - - * commit.c: use xstrdup instead of strdup - - * cvs.h: redefined USE(var) macro; comment after an #endif - - * all .c files: remove the semicolon from after the USE(var) - -Sat Dec 18 00:17:27 1993 david d zuhn (zoo@monad.armadillo.com) - - * cvs.h: include errno.h if available, otherwise declare errno if - it's not somehow else defined - - * commit.c (checkaddfile): remove unused file argument from - RCS_nodeisbranch call - - * rcs.c (RCS_nodeisbranch): remove file from arguments (was unused) - - * rcs.h (RCS_nodeisbranch): remove file from prototype - - * main.c: don't use rcsid when printing version number (the CVS - version number is independent of the repository that it comes - from) - - * hash.c (printlist, printnode): use %p to print pointers, not %x - (avoids gcc format warnings) - - * cvs.h: define USE if GCC 2, to avoid unused variable warning - - * all .c files: use USE(rcsid) - - * Makefile.in (VPATH): don't use $(srcdir), but @srcdir@ instead - (COMMON_OBJECTS): define, and use in several places - (OBJECTS): reorder alphabetically - - * hash.c (nodetypestring): handle default return value better - - * modules.c (do_module): remove extra argument to ign_dir_add - - * main.c (main): initialize cvs_update_env to 0 (zero) - - * modules.c (do_module): return error code when ignoring directory - (instead of a bare return). error code should be zero here - - * cvs.h: add prototypes for ignore_directory, ign_dir_add - - * ignore.c: add comments about ignore_directory - - * root.c (Name_Root): remove unused variables has_cvsadm and path - - * checkin.c (Checkin): only use -m when message is non-NULL - - * cvsrc.c (read_cvsrc): make sure homeinit is never used while - uninitialized (could have happened if getenv("HOME") had failed) - - * cvs.h: include unistd.h if available - -Fri Dec 17 23:54:58 1993 david d zuhn (zoo@monad.armadillo.com) - - * all files: now use strchr, strrchr, and memset instead of index, - rindex, and bzero respectively - -Sat Dec 11 09:50:03 1993 david d zuhn (zoo@monad.armadillo.com) - - * version.c (version_string): bump to +104z - - * Makefile.in: set standard directory variables, CC, and other - variables needed to be able to do 'make all' in this directory - - * import.c: implement -k options, for setting the RCS - keyword expansion mode - - * all files: use PROTO() macro for ANSI function prototypes - instead of #ifdef __STDC__/#else/#endif around two sets of - declarations - -Thu Nov 18 19:02:51 1993 K. Richard Pixley (rich@sendai.cygnus.com) - - * add.c (add), import.c (import), commit.c (commit): change - xmalloc & strcpy to xstrdup. - - * commit.c (remove_file): correct another static buffer problem. - -Wed Nov 10 15:01:34 1993 K. Richard Pixley (rich@sendai.cygnus.com) - - * recurse.c (start_recursion): directories in repository but not - in working directory should be added to dirlist. Fixes "update - -d dir" case. - - * version.c (version_string): bump to +103r. - - * commit.c (checkaddfile): mkdir attic only if it does not already - exist. comment changes. changed diagnostic about adding on a - branch. if a file is added on a branch, remove and replace the - internal representation of that rcs file. - -Tue Nov 9 18:02:01 1993 K. Richard Pixley (rich@sendai.cygnus.com) - - * add.c (add): if a file is being added on a branch, then say so; - add quotes around file names in error messages. - -Thu Nov 4 16:58:33 1993 K. Richard Pixley (rich@sendai.cygnus.com) - - * version.c (version_string): bump to +102r. - - * recurse.c (unroll_files_proc, addfile): new files, forward - decls, and prototypes. - (recursion_frame): new struct. - (start_recursion): rewrite to handle the case of "file1 file2 - dir1/file3". - - * rcs.c (RCS_parsercsfile): trap and error out on the case where - getrcskey tells us it hit an error while reading the file. - - * commit.c (lock_filesdoneproc): add comment about untrapped error - condition. - - * hash.c (addnode): comment change. - - * subr.c: add comment about caching. - - * sanity.sh: updated copyright. - -Wed Nov 3 14:49:15 1993 K. Richard Pixley (rich@sendai.cygnus.com) - - * version.c (version_string): bump to +101r. - - * hash.c (walklist): add a closure for called routines. All - callers, callees, and prototypes changed. - - * hash.c (nodetypestring, printnode, printlist): new functions for - dumping lists & nodes. - - * tag.c (tag_fileproc): fatal out on failure to set tag. - -Tue Nov 2 14:26:38 1993 K. Richard Pixley (rich@sendai.cygnus.com) - - * version.c (version_string): bump version to +99. - -Mon Nov 1 15:54:51 1993 K. Richard Pixley (rich@sendai.cygnus.com) - - Change buffer allocation for check in messages from static to - dynamic. - * add.c (add): dynamically allocate message. - (build_entry): check (message != NULL) now that message is a - pointer. - * commit.c (got_message, commit, commit_fileproc, - commit_filesdoneproc, commit_direntproc): removed. Replaced by - (message != NULL). Dynamically allocate message. - * cvs.h: adjust do_editor prototype and forward decl. - (MAXMESGLEN): removed. - * import.c (import): dynamically allocate message. - * logmsg.c (do_editor): change return type to char *. Remove - message parameter. Slight optimization to algorythm for - removing CVSEDITPREFIX lines. Add comment about fgets lossage. - - * subr.c (xmalloc): change error message to print number of bytes - we were attempting to allocate. - -Fri Oct 29 14:22:02 1993 K. Richard Pixley (rich@sendai.cygnus.com) - - * add.c (add): prevent adding a directory if there exists a dead - file of the same name. - - * sanity.sh: update argument to diff from "+ignore-file" to - "--exclude=". - - * Makefile.in (TAGS): extend to work from an objdir. - -Mon Oct 18 18:45:45 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) - - * tag.c, rtag.c: change the default actions to make writing over - existing tags harder (but not impossible) - -Thu Oct 14 18:00:53 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) - - CVS/Root changes from Mark Baushke (mdb@cisco.com) - - * Makefile.in: added new file called root.c - - * create_adm.c: will create CVS/Root at the same time that the - other CVS files are being created - - * cvs.h: new CVSADM_ROOT define plus new function externs - - * main.c: default to using CVS/Root contents for CVSROOT - if neither the environment variable or the command line - "-d" switch is given. If either are given, perform a - sanity check that this directory belongs to that repository. - - * update.c: if CVS/Root does not exist, then create it - during an update -- this may be removed if CVS/Root becomes a - standard feature - - * root.c: implement new functions to manipulate CVS/Root - [this may be integrated with other utility functions in - a future revision if CVS/Root becomes a standard feature.] - -Wed Sep 29 17:01:40 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) - - * patch.c (patch_fileproc): output an Index: line for each file - -Mon Sep 6 18:40:22 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) - - * cvs.h: wrap definition of PATH_MAX in #ifndef PATH_MAX/#endif - -Tue Aug 9 21:52:10 1994 Mark Eichin (eichin@cygnus.com) - - * commit.c (remove_file): actually allocate space for the - filename, not just the directory. - -Tue Jul 6 19:05:37 1993 david d `zoo' zuhn (zoo@cygnus.com) - - * diff.c: patches to print an Index: line - -Mon Jun 14 12:19:35 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com) - - * Makefile.in: update install target - -Tue Jun 1 17:03:05 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: link cvs against libiberty - -Wed May 19 14:10:34 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * ignore.c: add code for keeping lists of directories to ignore. - - * modules.c: new syntax for modules file, !dirname is added to - the list of directories to ignore - - * update.c: don't process directories on the ignore list - -Tue Apr 6 14:22:48 1993 Ian Lance Taylor (ian@cygnus.com) - - * cvs.h: Removed gethostname prototype, since it is unnecessary - and does not match prototype in on HP/UX. - -Mon Mar 22 23:25:16 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: rename installtest to installcheck - -Mon Feb 1 12:53:34 1993 K. Richard Pixley (rich@rtl.cygnus.com) - - * Makefile.in (check, installtest): set RCSBIN so that we - explicitly test the appropriate version of rcs as well. - -Fri Jan 29 13:37:35 1993 K. Richard Pixley (rich@rtl.cygnus.com) - - * version.c: bump version to +2. - -Thu Jan 28 18:11:34 1993 K. Richard Pixley (rich@rtl.cygnus.com) - - * import.c (update_rcs_file): if a file was dead, be sure to check - in the new version. - - * update.c (checkout_file): if file_is_dead and we *did* have an - entry, scratch it. - -Tue Jan 26 16:16:48 1993 K. Richard Pixley (rich@rtl.cygnus.com) - - * sanity.sh: parcel into pieces for easier truncation when - debugging. - - * update.c (checkout_file): print the "no longer pertinent" - message only if there was a user file. - -Wed Jan 20 17:08:09 1993 K. Richard Pixley (rich@rtl.cygnus.com) - - * update.c (checkout_file): remove unused variable s. - (join_file): remove unused variables rev & baserev. Fix a typo. - - * commit.c (commit_fileproc): remove unused variable magicbranch. - - * sanity.sh: bring back test 45 even though it fails. Update - tests against imported files. - - * add.c (add_directory): move declaration of unused variable. - - * Makefile.in (xxx): when building in this directory, pass CC for - the recursion. - -Mon Jan 18 13:48:33 1993 K. Richard Pixley (rich@cygnus.com) - - * commit.c (remove_file): fix for files removed in trunk - immediately after import. - - * commit.c (remove_file): initialize some variables. Otherwise we - end up free'ing some rather inconvenient things. - -Wed Jan 13 15:55:36 1993 K. Richard Pixley (rich@rtl.cygnus.com) - - * Makefile.in (check, install, installtest): use the sanity test. - - * sanity.el: make into real functions and bind to sun keys. - - * sanity.sh: bring back to working order. Add test for death - after import. - -Tue Dec 22 17:45:19 1992 K. Richard Pixley (rich@cygnus.com) - - * commit.c (remove_file): when checking in a dead revision to a - branch as we are creating the branch, do not lock the underlying - revision. Also free some malloc'd memory. - -Wed Dec 2 13:09:48 1992 K. Richard Pixley (rich@cygnus.com) - - * RCS-patches: new file. - -Fri Nov 27 20:12:48 1992 K. Richard Pixley (rich@rtl.cygnus.com) - - Added support for adding previously removed files, as well as - adding and removing files in branches. - - * add.c (build_entry): add new argument, tag, so as to store in - Entries the per directory sticky tag under which a file is - added. Changed prototype and caller. - (build_entry): Do not prevent file additions if the file exists - in the Attic. - (add): if the file being adding was previously dead, say so, and - mark the Entries file with the addition. - * checkin.c (Checkin): adding with a tag no longer means to add, - then tag. Hence, remove the tagging operation. - * classify.c (Classify_File): if the base RCS version is dead, - then the file is being added. If a file being added already - exists in the attic, and the base RCS version is NOT dead, then - we have a conflict. - * commit.c (checkaddfile): add the list of srcfiles to calling - convention. Change prototype and callers. - (remove_file): add message and list of srcfiles to calling - convention. Change prototype and callers. When removing a file - with a tag, remove the tag only when the tag does not represent - a branch. Remove files by committing dead revisions in the - appropriate branch. When removing files from the trunk, also - move the RCS file into the Attic. - (check_fileproc): when adding, and looking for previously - existing RCS files, do not look in the Attic. - (commit_fileproc): adding files with tags now implies adding the - file on a branch with that tag. - (checkaddfile): When adding a file on a branch, in addition to - creating the rcs file in the Attic, also create a dead, initial - revision on the trunk and stub in a magic branch tag. - * cvs.h (joining, gca): added prototypes. - * rcs.c (RCS_getbranch): now global rather than static. - remove prototype and forward decl. - (parse_rcs_proc): use RCS_addnode. - (RCS_addnode): new function. - (RCS_parsercsfile): recognize the new RCS revision - newphrase, "dead". Mark the node for the revision. - (RCS_gettag): requesting the head of a file in the attic now - returns the head of the file in the attic rather than NULL. - (RCS_isbranch): use RCS_nodeisbranch. - (RCS_nodeisbranch): new function. - (RCS_isdead): new function. - * rcs.h (RCSDEAD): new macro for new rcs keyword. - (struct rcsversnode): new field to flag dead revisions. - (RCS_nodeisbranch, RCS_isdead, RCS_addnode): new functions, - new prototypes, new externs. - (RCS_getbranch): now global, so prototype and extern moved - to here. - * subr.c (gca): new function. - * update.c (join_file): add entries list to calling - convention. Caller changed. - (update): also search the Attic when joining. - (checkout_file): when joining, checkout dead revisions too. If - a file has died across an update then say so. - (join_file): support joins of dead files against live ones, live - files against dead ones, and added files. Change the semantic - of a join with only rev specified to mean join specified rev - against checked out files via the greatest common ancestor of - the specified rev and the base rev of the checked out files. - (joining): new function. - * vers_ts.c (Version_TS): ALWAYS get the rcs version number. - - * update.c (update): write the 'C' letter for conflicts. - - * cvs.h (ParseTag): remove duplicate extern. - - * add.c (add_directory): do not prompt for interactive - verification before adding a directory. Doing so prevents - scripted testing. - -Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com) - - * Makefile.in, configure.in: removed traces of namesubdir, - -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced - copyrights to '92, changed some from Cygnus to FSF. - -Tue Dec 10 01:24:40 1991 K. Richard Pixley (rich at cygnus.com) - - * diff.c: do not pass an empty -r option to rcsdiff. - - * update.c: fix bug where return code from rcsmerge wasn't being - handled properly. - - * main.c: "rm" and "delete" now synonyms for "remove". - - * commit.c: abort if editor session fails, but remember to clear - locks. - - * Makefile.in: remove conf.h and checkin.configured on clean. - infodir belongs in datadir. - -Thu Dec 5 22:46:03 1991 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: idestdir and ddestdir go away. Added copyrights - and shift gpl to v2. Added ChangeLog if it didn't exist. docdir - and mandir now keyed off datadir by default. - -Wed Nov 27 02:47:13 1991 K. Richard Pixley (rich at sendai) - - * brought Makefile.in's up to standards.text. - - * fresh changelog. - diff --git a/gnu/usr.bin/cvs/src/commit.c b/gnu/usr.bin/cvs/src/commit.c index 1973e0ce256..e30a9ac2993 100644 --- a/gnu/usr.bin/cvs/src/commit.c +++ b/gnu/usr.bin/cvs/src/commit.c @@ -19,21 +19,14 @@ #include "edit.h" #include "fileattr.h" -#ifndef lint -static const char rcsid[] = "$CVSid: @(#)commit.c 1.101 94/10/07 $"; -USE(rcsid); -#endif - static Dtype check_direntproc PROTO((char *dir, char *repos, char *update_dir)); -static int check_fileproc PROTO((char *file, char *update_dir, char *repository, - List * entries, List * srcfiles)); +static int check_fileproc PROTO((struct file_info *finfo)); static int check_filesdoneproc PROTO((int err, char *repos, char *update_dir)); static int checkaddfile PROTO((char *file, char *repository, char *tag, char *options, List *srcfiles)); static Dtype commit_direntproc PROTO((char *dir, char *repos, char *update_dir)); static int commit_dirleaveproc PROTO((char *dir, int err, char *update_dir)); -static int commit_fileproc PROTO((char *file, char *update_dir, char *repository, - List * entries, List * srcfiles)); +static int commit_fileproc PROTO((struct file_info *finfo)); static int commit_filesdoneproc PROTO((int err, char *repository, char *update_dir)); static int finaladd PROTO((char *file, char *revision, char *tag, char *options, char *update_dir, @@ -75,6 +68,8 @@ static char *write_dirtag; static char *logfile; static List *mulist; static char *message; +static time_t last_register_time; + static const char *const commit_usage[] = { @@ -100,19 +95,15 @@ struct find_data { pass along a void * where we can stash it. */ struct find_data *find_data_static; -static int find_fileproc PROTO ((char *, char *, char *, List *, List *)); +static int find_fileproc PROTO ((struct file_info *finfo)); /* Machinery to find out what is modified, added, and removed. It is possible this should be broken out into a new client_classify function; merging it with classify_file is almost sure to be a mess, though, because classify_file has all kinds of repository processing. */ static int -find_fileproc (file, update_dir, repository, entries, srcfiles) - char *file; - char *update_dir; - char *repository; - List *entries; - List *srcfiles; +find_fileproc (finfo) + struct file_info *finfo; { Vers_TS *vers; enum classify_type status; @@ -120,18 +111,18 @@ find_fileproc (file, update_dir, repository, entries, srcfiles) struct find_data *args = find_data_static; char *fullname; - fullname = xmalloc (strlen (update_dir) + strlen (file) + 10); + fullname = xmalloc (strlen (finfo->update_dir) + strlen (finfo->file) + 10); fullname[0] = '\0'; - if (update_dir[0] != '\0') + if (finfo->update_dir[0] != '\0') { - strcat (fullname, update_dir); + strcat (fullname, finfo->update_dir); strcat (fullname, "/"); } - strcat (fullname, file); + strcat (fullname, finfo->file); vers = Version_TS ((char *)NULL, (char *)NULL, (char *)NULL, (char *)NULL, - file, 0, 0, entries, (List *)NULL); + finfo->file, 0, 0, finfo->entries, (List *)NULL); if (vers->ts_user == NULL && vers->vn_user != NULL && vers->vn_user[0] == '-') @@ -162,14 +153,14 @@ find_fileproc (file, update_dir, repository, entries, srcfiles) } node = getnode (); - node->key = xmalloc (strlen (update_dir) + strlen (file) + 8); + node->key = xmalloc (strlen (finfo->update_dir) + strlen (finfo->file) + 8); node->key[0] = '\0'; - if (update_dir[0] != '\0') + if (finfo->update_dir[0] != '\0') { - strcpy (node->key, update_dir); + strcpy (node->key, finfo->update_dir); strcat (node->key, "/"); } - strcat (node->key, file); + strcat (node->key, finfo->file); node->type = UPDATE; node->delproc = update_delproc; @@ -425,6 +416,18 @@ commit (argc, argv) */ lock_tree_cleanup (); dellist (&mulist); + + if (last_register_time) + { + time_t now; + + (void) time (&now); + if (now == last_register_time) + { + sleep (1); /* to avoid time-stamp races */ + } + } + return (err); } @@ -434,12 +437,8 @@ commit (argc, argv) */ /* ARGSUSED */ static int -check_fileproc (file, update_dir, repository, entries, srcfiles) - char *file; - char *update_dir; - char *repository; - List *entries; - List *srcfiles; +check_fileproc (finfo) + struct file_info *finfo; { Ctype status; char *xdir; @@ -460,18 +459,18 @@ check_fileproc (file, update_dir, repository, entries, srcfiles) /* If the tag is for the trunk, make sure we're at the head */ if (numdots (tag) < 2) { - status = Classify_File (file, (char *) NULL, (char *) NULL, - (char *) NULL, 1, aflag, repository, - entries, srcfiles, &vers, update_dir, 0); + status = Classify_File (finfo->file, (char *) NULL, (char *) NULL, + (char *) NULL, 1, aflag, finfo->repository, + finfo->entries, finfo->srcfiles, &vers, finfo->update_dir, 0); if (status == T_UPTODATE || status == T_MODIFIED || status == T_ADDED) { Ctype xstatus; freevers_ts (&vers); - xstatus = Classify_File (file, tag, (char *) NULL, - (char *) NULL, 1, aflag, repository, - entries, srcfiles, &vers, update_dir, + xstatus = Classify_File (finfo->file, tag, (char *) NULL, + (char *) NULL, 1, aflag, finfo->repository, + finfo->entries, finfo->srcfiles, &vers, finfo->update_dir, 0); if (xstatus == T_REMOVE_ENTRY) status = T_MODIFIED; @@ -495,18 +494,18 @@ check_fileproc (file, update_dir, repository, entries, srcfiles) cp = strrchr (xtag, '.'); *cp = '\0'; } - status = Classify_File (file, xtag, (char *) NULL, - (char *) NULL, 1, aflag, repository, - entries, srcfiles, &vers, update_dir, 0); + status = Classify_File (finfo->file, xtag, (char *) NULL, + (char *) NULL, 1, aflag, finfo->repository, + finfo->entries, finfo->srcfiles, &vers, finfo->update_dir, 0); if ((status == T_REMOVE_ENTRY || status == T_CONFLICT) && (cp = strrchr (xtag, '.')) != NULL) { /* pluck one more dot off the revision */ *cp = '\0'; freevers_ts (&vers); - status = Classify_File (file, xtag, (char *) NULL, - (char *) NULL, 1, aflag, repository, - entries, srcfiles, &vers, update_dir, + status = Classify_File (finfo->file, xtag, (char *) NULL, + (char *) NULL, 1, aflag, finfo->repository, + finfo->entries, finfo->srcfiles, &vers, finfo->update_dir, 0); if (status == T_UPTODATE || status == T_REMOVE_ENTRY) status = T_MODIFIED; @@ -518,9 +517,9 @@ check_fileproc (file, update_dir, repository, entries, srcfiles) } } else - status = Classify_File (file, tag, (char *) NULL, (char *) NULL, - 1, 0, repository, entries, srcfiles, &vers, - update_dir, 0); + status = Classify_File (finfo->file, tag, (char *) NULL, (char *) NULL, + 1, 0, finfo->repository, finfo->entries, finfo->srcfiles, &vers, + finfo->update_dir, 0); noexec = save_noexec; quiet = save_quiet; really_quiet = save_really_quiet; @@ -542,11 +541,11 @@ check_fileproc (file, update_dir, repository, entries, srcfiles) case T_NEEDS_MERGE: case T_CONFLICT: case T_REMOVE_ENTRY: - if (update_dir[0] == '\0') - error (0, 0, "Up-to-date check failed for `%s'", file); + if (finfo->update_dir[0] == '\0') + error (0, 0, "Up-to-date check failed for `%s'", finfo->file); else error (0, 0, "Up-to-date check failed for `%s/%s'", - update_dir, file); + finfo->update_dir, finfo->file); freevers_ts (&vers); return (1); case T_MODIFIED: @@ -568,30 +567,30 @@ check_fileproc (file, update_dir, repository, entries, srcfiles) { if (vers->date) { - if (update_dir[0] == '\0') + if (finfo->update_dir[0] == '\0') error (0, 0, "cannot commit with sticky date for file `%s'", - file); + finfo->file); else error (0, 0, "cannot commit with sticky date for file `%s/%s'", - update_dir, file); + finfo->update_dir, finfo->file); freevers_ts (&vers); return (1); } if (status == T_MODIFIED && vers->tag && - !RCS_isbranch (file, vers->tag, srcfiles)) + !RCS_isbranch (finfo->file, vers->tag, finfo->srcfiles)) { - if (update_dir[0] == '\0') + if (finfo->update_dir[0] == '\0') error (0, 0, "sticky tag `%s' for file `%s' is not a branch", - vers->tag, file); + vers->tag, finfo->file); else error (0, 0, "sticky tag `%s' for file `%s/%s' is not a branch", - vers->tag, update_dir, file); + vers->tag, finfo->update_dir, finfo->file); freevers_ts (&vers); return (1); } @@ -611,25 +610,25 @@ check_fileproc (file, update_dir, repository, entries, srcfiles) if (server_active) retcode = vers->ts_conflict[0] != '='; else { - filestamp = time_stamp (file); + filestamp = time_stamp (finfo->file); retcode = strcmp (vers->ts_conflict, filestamp); free (filestamp); } #else - filestamp = time_stamp (file); + filestamp = time_stamp (finfo->file); retcode = strcmp (vers->ts_conflict, filestamp); free (filestamp); #endif if (retcode == 0) { - if (update_dir[0] == '\0') + if (finfo->update_dir[0] == '\0') error (0, 0, "file `%s' had a conflict and has not been modified", - file); + finfo->file); else error (0, 0, "file `%s/%s' had a conflict and has not been modified", - update_dir, file); + finfo->update_dir, finfo->file); freevers_ts (&vers); return (1); } @@ -640,30 +639,30 @@ check_fileproc (file, update_dir, repository, entries, srcfiles) */ run_setup ("%s", GREP); run_arg (RCS_MERGE_PAT); - run_arg (file); + run_arg (finfo->file); retcode = run_exec (RUN_TTY, DEVNULL, RUN_TTY, RUN_REALLY); if (retcode == -1) { - if (update_dir[0] == '\0') + if (finfo->update_dir[0] == '\0') error (1, errno, "fork failed while examining conflict in `%s'", - file); + finfo->file); else error (1, errno, "fork failed while examining conflict in `%s/%s'", - update_dir, file); + finfo->update_dir, finfo->file); } else if (retcode == 0) { - if (update_dir[0] == '\0') + if (finfo->update_dir[0] == '\0') error (0, 0, "file `%s' still contains conflict indicators", - file); + finfo->file); else error (0, 0, "file `%s/%s' still contains conflict indicators", - update_dir, file); + finfo->update_dir, finfo->file); freevers_ts (&vers); return (1); } @@ -671,63 +670,58 @@ check_fileproc (file, update_dir, repository, entries, srcfiles) if (status == T_REMOVED && vers->tag && isdigit (*vers->tag)) { - if (update_dir[0] == '\0') + if (finfo->update_dir[0] == '\0') error (0, 0, "cannot remove file `%s' which has a numeric sticky tag of `%s'", - file, vers->tag); + finfo->file, vers->tag); else error (0, 0, "cannot remove file `%s/%s' which has a numeric sticky tag of `%s'", - update_dir, file, vers->tag); + finfo->update_dir, finfo->file, vers->tag); freevers_ts (&vers); return (1); } if (status == T_ADDED) { char rcs[PATH_MAX]; -#ifndef DEATH_SUPPORT -#ifdef DEATH_SUPPORT + /* Don't look in the attic; if it exists there we will move it back out in checkaddfile. */ - sprintf(rcs, "%s/%s%s", repository, file, RCSEXT); -#else - locate_rcs (file, repository, rcs); -#endif + sprintf(rcs, "%s/%s%s", finfo->repository, finfo->file, RCSEXT); if (isreadable (rcs)) { - if (update_dir[0] == '\0') + if (finfo->update_dir[0] == '\0') error (0, 0, "cannot add file `%s' when RCS file `%s' already exists", - file, rcs); + finfo->file, rcs); else error (0, 0, "cannot add file `%s/%s' when RCS file `%s' already exists", - update_dir, file, rcs); + finfo->update_dir, finfo->file, rcs); freevers_ts (&vers); return (1); } -#endif if (vers->tag && isdigit (*vers->tag) && numdots (vers->tag) > 1) { - if (update_dir[0] == '\0') + if (finfo->update_dir[0] == '\0') error (0, 0, "cannot add file `%s' with revision `%s'; must be on trunk", - file, vers->tag); + finfo->file, vers->tag); else error (0, 0, "cannot add file `%s/%s' with revision `%s'; must be on trunk", - update_dir, file, vers->tag); + finfo->update_dir, finfo->file, vers->tag); freevers_ts (&vers); return (1); } } /* done with consistency checks; now, to get on with the commit */ - if (update_dir[0] == '\0') + if (finfo->update_dir[0] == '\0') xdir = "."; else - xdir = update_dir; + xdir = finfo->update_dir; if ((p = findnode (mulist, xdir)) != NULL) { ulist = ((struct master_lists *) p->data)->ulist; @@ -753,14 +747,14 @@ check_fileproc (file, update_dir, repository, entries, srcfiles) /* first do ulist, then cilist */ p = getnode (); - p->key = xstrdup (file); + p->key = xstrdup (finfo->file); p->type = UPDATE; p->delproc = update_delproc; p->data = (char *) status; (void) addnode (ulist, p); p = getnode (); - p->key = xstrdup (file); + p->key = xstrdup (finfo->file); p->type = UPDATE; p->delproc = ci_delproc; ci = (struct commit_info *) xmalloc (sizeof (struct commit_info)); @@ -769,7 +763,7 @@ check_fileproc (file, update_dir, repository, entries, srcfiles) if (isdigit (*vers->tag)) ci->rev = xstrdup (vers->tag); else - ci->rev = RCS_whatbranch (file, vers->tag, srcfiles); + ci->rev = RCS_whatbranch (finfo->file, vers->tag, finfo->srcfiles); else ci->rev = (char *) NULL; ci->tag = xstrdup (vers->tag); @@ -778,10 +772,10 @@ check_fileproc (file, update_dir, repository, entries, srcfiles) (void) addnode (cilist, p); break; case T_UNKNOWN: - if (update_dir[0] == '\0') - error (0, 0, "nothing known about `%s'", file); + if (finfo->update_dir[0] == '\0') + error (0, 0, "nothing known about `%s'", finfo->file); else - error (0, 0, "nothing known about `%s/%s'", update_dir, file); + error (0, 0, "nothing known about `%s/%s'", finfo->update_dir, finfo->file); freevers_ts (&vers); return (1); case T_UPTODATE: @@ -904,12 +898,8 @@ static char sbranch[PATH_MAX]; /* ARGSUSED */ static int -commit_fileproc (file, update_dir, repository, entries, srcfiles) - char *file; - char *update_dir; - char *repository; - List *entries; - List *srcfiles; +commit_fileproc (finfo) + struct file_info *finfo; { Node *p; int err = 0; @@ -917,10 +907,10 @@ commit_fileproc (file, update_dir, repository, entries, srcfiles) struct commit_info *ci; char rcs[PATH_MAX]; - if (update_dir[0] == '\0') + if (finfo->update_dir[0] == '\0') p = findnode (mulist, "."); else - p = findnode (mulist, update_dir); + p = findnode (mulist, finfo->update_dir); /* * if p is null, there were file type command line args which were @@ -939,52 +929,52 @@ commit_fileproc (file, update_dir, repository, entries, srcfiles) if (use_editor && !got_message) { got_message = 1; - do_editor (update_dir, &message, repository, ulist); + do_editor (finfo->update_dir, &message, finfo->repository, ulist); } - p = findnode (cilist, file); + p = findnode (cilist, finfo->file); if (p == NULL) return (0); ci = (struct commit_info *) p->data; if (ci->status == T_MODIFIED) { - if (lockrcsfile (file, repository, ci->rev) != 0) + if (lockrcsfile (finfo->file, finfo->repository, ci->rev) != 0) { - unlockrcs (file, repository); + unlockrcs (finfo->file, finfo->repository); err = 1; goto out; } } else if (ci->status == T_ADDED) { - if (checkaddfile (file, repository, ci->tag, ci->options, - srcfiles) != 0) + if (checkaddfile (finfo->file, finfo->repository, ci->tag, ci->options, + finfo->srcfiles) != 0) { - fixaddfile (file, repository); + fixaddfile (finfo->file, finfo->repository); err = 1; goto out; } -#ifdef DEATH_SUPPORT /* adding files with a tag, now means adding them on a branch. Since the branch test was done in check_fileproc for modified files, we need to stub it in again here. */ if (ci->tag) { - locate_rcs (file, repository, rcs); - ci->rev = RCS_whatbranch (file, ci->tag, srcfiles); - err = Checkin ('A', file, update_dir, repository, rcs, ci->rev, - ci->tag, ci->options, message, entries); + locate_rcs (finfo->file, finfo->repository, rcs); + ci->rev = RCS_whatbranch (finfo->file, ci->tag, finfo->srcfiles); + err = Checkin ('A', finfo->file, finfo->update_dir, finfo->repository, rcs, ci->rev, + ci->tag, ci->options, message, finfo->entries); if (err != 0) { - unlockrcs (file, repository); - fixbranch (file, repository, sbranch); + unlockrcs (finfo->file, finfo->repository); + fixbranch (finfo->file, finfo->repository, sbranch); } + (void) time (&last_register_time); + ci->status = T_UPTODATE; } -#endif /* DEATH_SUPPORT */ } /* @@ -998,7 +988,7 @@ commit_fileproc (file, update_dir, repository, entries, srcfiles) { /* find the max major rev number in this directory */ maxrev = 0; - (void) walklist (entries, findmaxrev, NULL); + (void) walklist (finfo->entries, findmaxrev, NULL); if (maxrev == 0) maxrev = 1; xrev = xmalloc (20); @@ -1006,31 +996,34 @@ commit_fileproc (file, update_dir, repository, entries, srcfiles) } /* XXX - an added file with symbolic -r should add tag as well */ - err = finaladd (file, ci->rev ? ci->rev : xrev, ci->tag, ci->options, - update_dir, repository, entries); + err = finaladd (finfo->file, ci->rev ? ci->rev : xrev, ci->tag, ci->options, + finfo->update_dir, finfo->repository, finfo->entries); if (xrev) free (xrev); } else if (ci->status == T_MODIFIED) { - locate_rcs (file, repository, rcs); - err = Checkin ('M', file, update_dir, repository, + locate_rcs (finfo->file, finfo->repository, rcs); + err = Checkin ('M', finfo->file, finfo->update_dir, finfo->repository, rcs, ci->rev, ci->tag, - ci->options, message, entries); + ci->options, message, finfo->entries); + + (void) time (&last_register_time); + if (err != 0) { - unlockrcs (file, repository); - fixbranch (file, repository, sbranch); + unlockrcs (finfo->file, finfo->repository); + fixbranch (finfo->file, finfo->repository, sbranch); } } else if (ci->status == T_REMOVED) { - err = remove_file (file, repository, ci->tag, message, - entries, srcfiles); + err = remove_file (finfo->file, finfo->repository, ci->tag, message, + finfo->entries, finfo->srcfiles); #ifdef SERVER_SUPPORT if (server_active) { server_scratch_entry_only (); - server_updated (file, update_dir, repository, + server_updated (finfo->file, finfo->update_dir, finfo->repository, /* Doesn't matter, it won't get checked. */ SERVER_UPDATED, (struct stat *) NULL, (unsigned char *) NULL); @@ -1040,13 +1033,13 @@ commit_fileproc (file, update_dir, repository, entries, srcfiles) /* Clearly this is right for T_MODIFIED. I haven't thought so much about T_ADDED or T_REMOVED. */ - notify_do ('C', file, getcaller (), NULL, NULL, repository); + notify_do ('C', finfo->file, getcaller (), NULL, NULL, finfo->repository); out: if (err != 0) { /* on failure, remove the file from ulist */ - p = findnode (ulist, file); + p = findnode (ulist, finfo->file); if (p) delnode (p); } @@ -1084,6 +1077,31 @@ commit_filesdoneproc (err, repository, update_dir) if (xtag) free (xtag); + /* Build the administrative files if necessary. */ + { + char *p; + + if (strncmp (CVSroot, repository, strlen (CVSroot)) != 0) + error (0, 0, "internal error: repository doesn't begin with root"); + p = repository + strlen (CVSroot); + if (*p == '/') + ++p; + if (strcmp ("CVSROOT", p) == 0) + { + /* "Database" might a little bit grandiose and/or vague, + but "checked-out copies of administrative files, unless + in the case of modules and you are using ndbm in which + case modules.{pag,dir,db}" is verbose and excessively + focused on how the database is implemented. */ + + cvs_output (program_name, 0); + cvs_output (" ", 1); + cvs_output (command_name, 0); + cvs_output (": Rebuilding administrative file database\n", 0); + mkmodules (repository); + } + } + if (err == 0 && run_module_prog) { FILE *fp; @@ -1241,9 +1259,8 @@ remove_file (file, repository, tag, message, entries, srcfiles) char rcs[PATH_MAX]; char *tmp; -#ifdef DEATH_SUPPORT int branch; - char *lockflag; + int lockflag; char *corev; char *rev; char *prev_rev; @@ -1253,19 +1270,13 @@ remove_file (file, repository, tag, message, entries, srcfiles) corev = NULL; rev = NULL; prev_rev = NULL; - lockflag = 0; -#endif /* DEATH_SUPPORT */ retcode = 0; locate_rcs (file, repository, rcs); -#ifdef DEATH_SUPPORT branch = 0; if (tag && !(branch = RCS_isbranch (file, tag, srcfiles))) -#else - if (tag) -#endif { /* a symbolic tag is specified; just remove the tag from the file */ if ((retcode = RCS_deltag (rcs, tag, 1)) != 0) @@ -1279,7 +1290,6 @@ remove_file (file, repository, tag, message, entries, srcfiles) return (0); } -#ifdef DEATH_SUPPORT /* we are removing the file from either the head or a branch */ /* commit a new, dead revision. */ @@ -1287,7 +1297,7 @@ remove_file (file, repository, tag, message, entries, srcfiles) (void) printf ("Removing %s;\n", file); rev = NULL; - lockflag = "-l"; + lockflag = RCS_FLAGS_LOCK; if (branch) { char *branchname; @@ -1313,7 +1323,7 @@ remove_file (file, repository, tag, message, entries, srcfiles) revision but do not lock. */ corev = RCS_gettag (rcsfile, tag, 1, 0); prev_rev = xstrdup(rev); - lockflag = ""; + lockflag = 0; } else { corev = xstrdup (rev); @@ -1360,12 +1370,10 @@ remove_file (file, repository, tag, message, entries, srcfiles) /* check something out. Generally this is the head. If we have a particular rev, then name it. except when creating a branch, lock the rev we're checking out. */ - run_setup ("%s%s %s %s%s %s", Rcsbin, RCS_CO, - lockflag, - rev ? "-r" : "", - rev ? corev : "", rcs); - if ((retcode = run_exec (RUN_TTY, RUN_TTY, DEVNULL, RUN_NORMAL)) - != 0) { + retcode = RCS_checkout (rcs, "", rev ? corev : NULL, NULL, RUN_TTY, + lockflag, 1); + if (retcode != 0) + { if (!quiet) error (0, retcode == -1 ? errno : 0, "failed to check out `%s'", rcs); @@ -1375,16 +1383,9 @@ remove_file (file, repository, tag, message, entries, srcfiles) if (corev != NULL) free (corev); -#ifdef DEATH_STATE - run_setup ("%s%s -f -sdead %s%s", Rcsbin, RCS_CI, rev ? "-r" : "", -#else - run_setup ("%s%s -K %s%s", Rcsbin, RCS_CI, rev ? "-r" : "", -#endif - rev ? rev : ""); - run_args ("-m%s", make_message_rcslegal (message)); - run_arg (rcs); - if ((retcode = run_exec (RUN_TTY, RUN_TTY, DEVNULL, RUN_NORMAL)) - != 0) { + retcode = RCS_checkin (rcs, NULL, message, rev, RCS_FLAGS_DEAD, 1); + if (retcode != 0) + { if (!quiet) error (0, retcode == -1 ? errno : 0, "failed to commit dead revision for `%s'", rcs); @@ -1395,9 +1396,6 @@ remove_file (file, repository, tag, message, entries, srcfiles) free (rev); if (!branch) -#else /* No DEATH_SUPPORT */ - else -#endif /* No DEATH_SUPPORT */ { /* this was the head; really move it into the Attic */ tmp = xmalloc(strlen(repository) + @@ -1412,7 +1410,6 @@ remove_file (file, repository, tag, message, entries, srcfiles) (void) umask (omask); (void) sprintf (tmp, "%s/%s/%s%s", repository, CVSATTIC, file, RCSEXT); -#ifdef DEATH_SUPPORT if (strcmp (rcs, tmp) != 0 && rename (rcs, tmp) == -1 && (isreadable (rcs) || !isreadable (tmp))) @@ -1432,19 +1429,6 @@ remove_file (file, repository, tag, message, entries, srcfiles) Scratch_Entry (entries, file); return (0); -#else /* No DEATH_SUPPORT */ - - if ((strcmp (rcs, tmp) == 0 || rename (rcs, tmp) != -1) || - (!isreadable (rcs) && isreadable (tmp))) - { - Scratch_Entry (entries, file); - /* FIXME: should free tmp. */ - return (0); - } - /* FIXME: should free tmp. */ - } - return (1); -#endif /* No DEATH_SUPPORT */ } /* @@ -1474,6 +1458,9 @@ finaladd (file, rev, tag, options, update_dir, repository, entries) } else fixaddfile (file, repository); + + (void) time (&last_register_time); + return (ret); } @@ -1556,11 +1543,8 @@ checkaddfile (file, repository, tag, options, srcfiles) char fname[PATH_MAX]; mode_t omask; int retcode = 0; -#ifdef DEATH_SUPPORT int newfile = 0; -#endif -#ifndef DEATH_SUPPORT if (tag) { (void) sprintf(rcs, "%s/%s", repository, CVSATTIC); @@ -1571,10 +1555,8 @@ checkaddfile (file, repository, tag, options, srcfiles) (void) sprintf (rcs, "%s/%s/%s%s", repository, CVSATTIC, file, RCSEXT); } else -#endif locate_rcs (file, repository, rcs); -#ifdef DEATH_SUPPORT if (isreadable(rcs)) { /* file has existed in the past. Prepare to resurrect. */ @@ -1621,7 +1603,7 @@ checkaddfile (file, repository, tag, options, srcfiles) } else { /* this is the first time we have ever seen this file; create an rcs file. */ - run_setup ("%s%s -i", Rcsbin, RCS); + run_setup ("%s%s -x,v/ -i", Rcsbin, RCS); (void) sprintf (fname, "%s/%s%s", CVSADM, file, CVSEXT_LOG); /* If the file does not exist, no big deal. In particular, the @@ -1647,7 +1629,7 @@ checkaddfile (file, repository, tag, options, srcfiles) if (tag && newfile) { char *tmp; - + /* move the new file out of the way. */ (void) sprintf (fname, "%s/%s%s", CVSADM, CVSPREFIX, file); rename_file (file, fname); @@ -1655,17 +1637,12 @@ checkaddfile (file, repository, tag, options, srcfiles) tmp = xmalloc (strlen (file) + strlen (tag) + 80); /* commit a dead revision. */ - (void) sprintf (tmp, "-mfile %s was initially added on branch %s.", + (void) sprintf (tmp, "file %s was initially added on branch %s.", file, tag); -#ifdef DEATH_STATE - run_setup ("%s%s -q -f -sdead", Rcsbin, RCS_CI); -#else - run_setup ("%s%s -q -K", Rcsbin, RCS_CI); -#endif - run_arg (tmp); + retcode = RCS_checkin (rcs, NULL, tmp, NULL, + RCS_FLAGS_DEAD | RCS_FLAGS_QUIET, 0); free (tmp); - run_arg (rcs); - if ((retcode = run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL)) != 0) + if (retcode != 0) { error (retcode == -1 ? 1 : 0, retcode == -1 ? errno : 0, "could not create initial dead revision %s", rcs); @@ -1742,20 +1719,6 @@ checkaddfile (file, repository, tag, options, srcfiles) RCS_addnode (file, rcsfile, srcfiles); } -#else /* No DEATH_SUPPORT */ - run_setup ("%s%s -i", Rcsbin, RCS); - run_args ("-t%s/%s%s", CVSADM, file, CVSEXT_LOG); - /* Set RCS keyword expansion options. */ - if (options && options[0] == '-' && options[1] == 'k') - run_arg (options); - run_arg (rcs); - if ((retcode = run_exec (RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL)) != 0) - { - error (retcode == -1 ? 1 : 0, retcode == -1 ? errno : 0, - "could not create %s", rcs); - return (1); - } -#endif /* No DEATH_SUPPORT */ fileattr_newfile (file); diff --git a/gnu/usr.bin/cvs/src/cvs.h b/gnu/usr.bin/cvs/src/cvs.h index e9b0652dd09..d1f091529db 100644 --- a/gnu/usr.bin/cvs/src/cvs.h +++ b/gnu/usr.bin/cvs/src/cvs.h @@ -11,25 +11,6 @@ can't easily be automatically checked for */ -/* AIX requires this to be the first thing in the file. */ -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not __GNUC__ */ -#if HAVE_ALLOCA_H -#include -#else /* not HAVE_ALLOCA_H */ -#ifdef _AIX - #pragma alloca -#else /* not _AIX */ -#ifdef ALLOCA_IN_STDLIB - /* then we need do nothing */ -#else -char *alloca (); -#endif /* not ALLOCA_IN_STDLIB */ -#endif /* not _AIX */ -#endif /* not HAVE_ALLOCA_H */ -#endif /* not __GNUC__ */ - /* Changed from if __STDC__ to ifdef __STDC__ because of Sun's acc compiler */ #ifdef __STDC__ @@ -47,13 +28,6 @@ char *alloca (); #endif #endif -#if __GNUC__ == 2 -#define USE(var) static const char sizeof##var = sizeof(sizeof##var) + sizeof(var) -#else -#define USE(var) static const char standalone_semis_illegal_sigh -#endif - - #include /* Under OS/2, doesn't define popen()/pclose(). */ @@ -116,11 +90,6 @@ extern int errno; #include "getopt.h" #include "wait.h" -/* Define to enable alternate death support (which uses the RCS state). */ -#define DEATH_STATE 1 - -#define DEATH_SUPPORT 1 - #include "rcs.h" @@ -413,10 +382,8 @@ typedef enum direnter_type Dtype; extern char *program_name, *program_path, *command_name; extern char *Rcsbin, *Editor, *CVSroot; -#ifdef CVSADM_ROOT extern char *CVSADM_Root; extern int cvsadmin_root; -#endif /* CVSADM_ROOT */ extern char *CurDir; extern int really_quiet, quiet; extern int use_editor; @@ -437,6 +404,20 @@ int RCS_setbranch PROTO((const char *, const char *)); int RCS_lock PROTO((const char *, const char *, int)); int RCS_unlock PROTO((const char *, const char *, int)); int RCS_merge PROTO((const char *, const char *, const char *, const char *)); +int RCS_checkout PROTO ((char *rcsfile, char *workfile, char *tag, + char *options, + char *sout, int flags, int noerr)); +/* Flags used by RCS_* functions. See the description of the individual + functions for which flags mean what for each function. */ +#define RCS_FLAGS_LOCK 1 +#define RCS_FLAGS_FORCE 2 +#define RCS_FLAGS_DEAD 4 +#define RCS_FLAGS_QUIET 8 +#define RCS_FLAGS_MODTIME 16 +int RCS_checkin PROTO ((char *rcsfile, char *workfile, char *message, + char *rev, int flags, int noerr)); + + #include "error.h" @@ -447,11 +428,9 @@ void Entries_Close PROTO((List *entries)); List *Entries_Open PROTO((int aflag)); char *Make_Date PROTO((char *rawdate)); char *Name_Repository PROTO((char *dir, char *update_dir)); -#ifdef CVSADM_ROOT char *Name_Root PROTO((char *dir, char *update_dir)); void Create_Root PROTO((char *dir, char *rootdir)); int same_directories PROTO((char *dir1, char *dir2)); -#endif /* CVSADM_ROOT */ char *Short_Repository PROTO((char *repository)); char *gca PROTO((char *rev1, char *rev2)); char *getcaller PROTO((void)); @@ -477,6 +456,7 @@ int iswritable PROTO((const char *file)); int isaccessible PROTO((const char *file, const int mode)); int isabsolute PROTO((const char *filename)); char *last_component PROTO((char *path)); +char *get_homedir PROTO ((void)); int numdots PROTO((const char *s)); int unlink_file PROTO((const char *f)); @@ -555,12 +535,40 @@ void do_editor PROTO((char *dir, char **messagep, typedef int (*CALLBACKPROC) PROTO((int *pargc, char *argv[], char *where, char *mwhere, char *mfile, int horten, int local_specified, char *omodule, char *msg)); -typedef int (*FILEPROC) PROTO((char *file, char *update_dir, char *repository, - List * entries, List * srcfiles)); + +/* This is the structure that the recursion processor passes to the + fileproc to tell it about a particular file. */ +struct file_info +{ + /* Name of the file, without any directory component. */ + char *file; + + /* Name of the directory we are in, relative to the directory in + which this command was issued. We have cd'd to this directory + (either in the working directory or in the repository, depending + on which sort of recursion we are doing). If we are in the directory + in which the command was issued, this is "". */ + char *update_dir; + + /* Name of the directory corresponding to the repository which contains + this file. */ + char *repository; + + /* The pre-parsed entries for this directory. */ + List *entries; + + /* The pre-parsed versions of the RCS files. This is filled in only + if dosrcs was passed as nonzero to start_recursion. */ + List *srcfiles; +}; + +typedef int (*FILEPROC) PROTO((struct file_info *finfo)); typedef int (*FILESDONEPROC) PROTO((int err, char *repository, char *update_dir)); typedef Dtype (*DIRENTPROC) PROTO((char *dir, char *repos, char *update_dir)); typedef int (*DIRLEAVEPROC) PROTO((char *dir, int err, char *update_dir)); +extern int mkmodules PROTO ((char *dir)); + int do_module PROTO((DBM * db, char *mname, enum mtype m_type, char *msg, CALLBACKPROC callback_proc, char *where, int shorten, int local_specified, int run_module_prog, char *extra_arg)); @@ -602,7 +610,7 @@ void run_args (); int run_exec PROTO((char *stin, char *stout, char *sterr, int flags)); /* other similar-minded stuff from run.c. */ -FILE *Popen PROTO((const char *, const char *)); +FILE *run_popen PROTO((const char *, const char *)); int piped_child PROTO((char **, int *, int *)); void close_on_exec PROTO((int)); int filter_stream_through_program PROTO((int, int, char **, pid_t *)); @@ -619,11 +627,17 @@ int wrap_name_has PROTO((const char *name,WrapMergeHas has)); char *wrap_tocvs_process_file PROTO((const char *fileName)); int wrap_merge_is_copy PROTO((const char *fileName)); char *wrap_fromcvs_process_file PROTO((const char *fileName)); -/* Pathname expansion */ -char *expand_path PROTO((char *name)); void wrap_add_file PROTO((const char *file,int temp)); void wrap_add PROTO((char *line,int temp)); +/* Pathname expansion */ +char *expand_path PROTO((char *name, char *file, int line)); + +/* User variables. */ +extern List *variable_list; + +extern void variable_set PROTO ((char *nameval)); + int watch PROTO ((int argc, char **argv)); int edit PROTO ((int argc, char **argv)); int unedit PROTO ((int argc, char **argv)); @@ -636,3 +650,6 @@ char *descramble PROTO ((char *str)); #endif /* AUTH_CLIENT_SUPPORT || AUTH_SERVER_SUPPORT */ extern void tag_check_valid PROTO ((char *, int, char **, int, int, char *)); + +extern void cvs_output PROTO ((char *, size_t)); +extern void cvs_outerr PROTO ((char *, size_t)); diff --git a/gnu/usr.bin/cvs/src/ignore.c b/gnu/usr.bin/cvs/src/ignore.c index 78689a4cd20..5f150a802bc 100644 --- a/gnu/usr.bin/cvs/src/ignore.c +++ b/gnu/usr.bin/cvs/src/ignore.c @@ -4,11 +4,6 @@ #include "cvs.h" -#ifndef lint -static const char rcsid[] = "$CVSid: @(#)ignore.c 1.16 94/09/24 $"; -USE(rcsid); -#endif - /* * Ignore file section. * diff --git a/gnu/usr.bin/cvs/src/lock.c b/gnu/usr.bin/cvs/src/lock.c index ffdd351df38..89460baf744 100644 --- a/gnu/usr.bin/cvs/src/lock.c +++ b/gnu/usr.bin/cvs/src/lock.c @@ -12,11 +12,6 @@ #include "cvs.h" -#ifndef lint -static const char rcsid[] = "$CVSid: @(#)lock.c 1.50 94/09/30 $"; -USE(rcsid); -#endif - static int readers_exist PROTO((char *repository)); static int set_lock PROTO((char *repository, int will_wait)); static void clear_lock PROTO((void)); @@ -433,6 +428,15 @@ again: #endif set_lockers_name (&sb); } + else + { + /* If the file doesn't exist, it just means that it disappeared + between the time we did the readdir and the time we did + the stat. */ + if (!existence_error (errno)) + error (0, errno, "cannot stat %s", line); + } + errno = 0; free (line); ret = 1; diff --git a/gnu/usr.bin/cvs/src/main.c b/gnu/usr.bin/cvs/src/main.c index 74613d71103..0ebd78da575 100644 --- a/gnu/usr.bin/cvs/src/main.c +++ b/gnu/usr.bin/cvs/src/main.c @@ -44,11 +44,6 @@ #endif #endif -#ifndef lint -static const char rcsid[] = "$CVSid: @(#)main.c 1.78 94/10/07 $\n"; -USE(rcsid); -#endif - char *program_name; char *program_path; /* @@ -88,12 +83,10 @@ char *CurDir; char *Rcsbin = RCSBIN_DFLT; char *Editor = EDITOR_DFLT; char *CVSroot = CVSROOT_DFLT; -#ifdef CVSADM_ROOT /* * The path found in CVS/Root must match $CVSROOT and/or 'cvs -d root' */ char *CVSADM_Root = CVSROOT_DFLT; -#endif /* CVSADM_ROOT */ int add PROTO((int argc, char **argv)); int admin PROTO((int argc, char **argv)); @@ -189,6 +182,7 @@ static const char *const usg[] = #ifdef CLIENT_SUPPORT " -z # Use 'gzip -#' for net traffic if possible.\n", #endif + " -s VAR=VAL Set CVS user variable.\n", "\n", " and where 'command' is: add, admin, etc. (use the --help-commands\n", " option for a list of commands)\n", @@ -320,11 +314,6 @@ main (argc, argv) CVSUMASK_ENV, cp); } - /* - * Scan cvsrc file for global options. - */ - read_cvsrc(&argc, &argv); - /* This has the effect of setting getopt's ordering to REQUIRE_ORDER, which is what we need to distinguish between global options and command options. FIXME: It would appear to be possible to do this @@ -332,8 +321,32 @@ main (argc, argv) option string we pass to getopt_long. */ optind = 1; + + /* We have to parse the options twice because else there is no + chance to avoid reading the global options from ".cvsrc". Set + opterr to 0 for avoiding error messages about invalid options. + */ + opterr = 0; + while ((c = getopt_long - (argc, argv, "Qqrwtnlvb:e:d:Hfz:", long_options, &option_index)) + (argc, argv, "f", NULL, NULL)) + != EOF) + { + if (c == 'f') + use_cvsrc = FALSE; + } + + /* + * Scan cvsrc file for global options. + */ + if (use_cvsrc) + read_cvsrc(&argc, &argv); + + optind = 1; + opterr = 1; + + while ((c = getopt_long + (argc, argv, "Qqrwtnlvb:e:d:Hfz:s:", long_options, &option_index)) != EOF) { switch (c) @@ -382,14 +395,20 @@ main (argc, argv) case 'f': use_cvsrc = FALSE; break; -#ifdef CLIENT_SUPPORT case 'z': +#ifdef CLIENT_SUPPORT gzip_level = atoi (optarg); if (gzip_level <= 0 || gzip_level > 9) error (1, 0, "gzip compression level must be between 1 and 9"); - break; #endif + /* If no CLIENT_SUPPORT, we just silently ignore the gzip + level, so that users can have it in their .cvsrc and not + cause any trouble. */ + break; + case 's': + variable_set (optarg); + break; case '?': default: usage (usg); @@ -518,7 +537,6 @@ error 0 %s: no such user\n", user); #endif /* AUTH_SERVER_SUPPORT && SERVER_SUPPORT */ -#ifdef CVSADM_ROOT /* * See if we are able to find a 'better' value for CVSroot in the * CVSADM_ROOT directory. @@ -560,7 +578,6 @@ error 0 %s: no such user\n", user); } } } -#endif /* CVSADM_ROOT */ /* CVSroot may need fixing up, if an access-method was specified, * but not a user. Later code assumes that if CVSroot contains an diff --git a/gnu/usr.bin/cvs/src/patch.c b/gnu/usr.bin/cvs/src/patch.c index 30d7174ae16..2878a1f2f7c 100644 --- a/gnu/usr.bin/cvs/src/patch.c +++ b/gnu/usr.bin/cvs/src/patch.c @@ -15,15 +15,9 @@ #include "cvs.h" #include "getline.h" -#ifndef lint -static const char rcsid[] = "$CVSid: @(#)patch.c 1.57 94/09/30 $"; -USE(rcsid); -#endif - static RETSIGTYPE patch_cleanup PROTO((void)); static Dtype patch_dirproc PROTO((char *dir, char *repos, char *update_dir)); -static int patch_fileproc PROTO((char *file, char *update_dir, char *repository, - List * entries, List * srcfiles)); +static int patch_fileproc PROTO((struct file_info *finfo)); static int patch_proc PROTO((int *pargc, char **argv, char *xwhere, char *mwhere, char *mfile, int shorten, int local_specified, char *mname, char *msg)); @@ -337,12 +331,8 @@ patch_proc (pargc, argv, xwhere, mwhere, mfile, shorten, local_specified, */ /* ARGSUSED */ static int -patch_fileproc (file, update_dir, repository, entries, srcfiles) - char *file; - char *update_dir; - char *repository; - List *entries; - List *srcfiles; +patch_fileproc (finfo) + struct file_info *finfo; { struct utimbuf t; char *vers_tag, *vers_head; @@ -362,14 +352,14 @@ patch_fileproc (file, update_dir, repository, entries, srcfiles) FILE *fp; /* find the parsed rcs file */ - p = findnode (srcfiles, file); + p = findnode (finfo->srcfiles, finfo->file); if (p == NULL) return (1); rcsfile = (RCSNode *) p->data; if ((rcsfile->flags & VALID) && (rcsfile->flags & INATTIC)) isattic = 1; - (void) sprintf (rcs, "%s%s", file, RCSEXT); + (void) sprintf (rcs, "%s%s", finfo->file, RCSEXT); /* if vers_head is NULL, may have been removed from the release */ if (isattic && rev2 == NULL && date2 == NULL) @@ -407,7 +397,6 @@ patch_fileproc (file, update_dir, repository, entries, srcfiles) if (vers_tag == NULL) (void) printf ("%s is new; current revision %s\n", rcs, vers_head); else if (vers_head == NULL) -#ifdef DEATH_SUPPORT { (void) printf ("%s is removed; not included in ", rcs); if (rev2 != NULL) @@ -418,10 +407,6 @@ patch_fileproc (file, update_dir, repository, entries, srcfiles) (void) printf ("current release"); (void) printf ("\n"); } -#else - (void) printf ("%s is removed; not included in release %s\n", - rcs, rev2 ? rev2 : date2); -#endif else (void) printf ("%s changed from revision %s to %s\n", rcs, vers_tag, vers_head); @@ -441,9 +426,9 @@ patch_fileproc (file, update_dir, repository, entries, srcfiles) } if (vers_tag != NULL) { - run_setup ("%s%s %s -p -q -r%s", Rcsbin, RCS_CO, options, vers_tag); - run_arg (rcsfile->path); - if ((retcode = run_exec (RUN_TTY, tmpfile1, RUN_TTY, RUN_NORMAL)) != 0) + retcode = RCS_checkout (rcsfile->path, NULL, vers_tag, options, tmpfile1, + 0, 0); + if (retcode != 0) { if (!really_quiet) error (retcode == -1 ? 1 : 0, retcode == -1 ? errno : 0, @@ -463,9 +448,8 @@ patch_fileproc (file, update_dir, repository, entries, srcfiles) } if (vers_head != NULL) { - run_setup ("%s%s %s -p -q -r%s", Rcsbin, RCS_CO, options, vers_head); - run_arg (rcsfile->path); - if ((retcode = run_exec (RUN_TTY, tmpfile2, RUN_TTY, RUN_NORMAL)) != 0) + retcode = RCS_checkout (rcsfile->path, NULL, vers_head, options, tmpfile2, 0, 0); + if (retcode != 0) { if (!really_quiet) error (retcode == -1 ? 1 : 0, retcode == -1 ? errno : 0, @@ -486,7 +470,7 @@ patch_fileproc (file, update_dir, repository, entries, srcfiles) line2 = NULL; line2_chars_allocated = 0; - switch (run_exec (RUN_TTY, tmpfile3, RUN_TTY, RUN_NORMAL)) + switch (run_exec (RUN_TTY, tmpfile3, RUN_TTY, RUN_REALLY)) { case -1: /* fork/wait failure */ error (1, errno, "fork for diff failed on %s", rcs); @@ -502,10 +486,10 @@ patch_fileproc (file, update_dir, repository, entries, srcfiles) /* Output an "Index:" line for patch to use */ (void) fflush (stdout); - if (update_dir[0]) - (void) printf ("Index: %s/%s\n", update_dir, file); + if (finfo->update_dir[0]) + (void) printf ("Index: %s/%s\n", finfo->update_dir, finfo->file); else - (void) printf ("Index: %s\n", file); + (void) printf ("Index: %s\n", finfo->file); (void) fflush (stdout); fp = open_file (tmpfile3, "r"); @@ -554,15 +538,15 @@ patch_fileproc (file, update_dir, repository, entries, srcfiles) *commap = '\0'; if (vers_tag != NULL) { - (void) sprintf (file1, "%s%s%s:%s", update_dir, - update_dir[0] ? "/" : "", rcs, vers_tag); + (void) sprintf (file1, "%s%s%s:%s", finfo->update_dir, + finfo->update_dir[0] ? "/" : "", rcs, vers_tag); } else { (void) strcpy (file1, DEVNULL); } - (void) sprintf (file2, "%s%s%s:%s", update_dir, - update_dir[0] ? "/" : "", rcs, + (void) sprintf (file2, "%s%s%s:%s", finfo->update_dir, + finfo->update_dir[0] ? "/" : "", rcs, vers_head ? vers_head : "removed"); if (unidiff) { @@ -575,8 +559,8 @@ patch_fileproc (file, update_dir, repository, entries, srcfiles) (void) printf ("*** %s%s--- ", file1, cp1); } - if (update_dir[0] != '\0') - (void) printf ("%s/", update_dir); + if (finfo->update_dir[0] != '\0') + (void) printf ("%s/", finfo->update_dir); (void) printf ("%s%s", rcs, cp2); /* spew the rest of the diff out */ while (getline (&line1, &line1_chars_allocated, fp) >= 0) @@ -591,9 +575,10 @@ patch_fileproc (file, update_dir, repository, entries, srcfiles) free (line1); if (line2) free (line2); - (void) unlink_file (tmpfile1); - (void) unlink_file (tmpfile2); - (void) unlink_file (tmpfile3); + /* FIXME: should be checking for errors. */ + (void) unlink (tmpfile1); + (void) unlink (tmpfile2); + (void) unlink (tmpfile3); return (ret); } diff --git a/gnu/usr.bin/cvs/src/server.c b/gnu/usr.bin/cvs/src/server.c index c87e2f5694b..1577e1571d5 100644 --- a/gnu/usr.bin/cvs/src/server.c +++ b/gnu/usr.bin/cvs/src/server.c @@ -25,6 +25,11 @@ #define O_NONBLOCK O_NDELAY #endif +#ifdef AUTH_SERVER_SUPPORT +/* For initgroups(). */ +#include +#endif + /* Functions which the server calls. */ int add PROTO((int argc, char **argv)); @@ -1236,6 +1241,15 @@ serve_global_option (arg) goto error_return; } } + +static void +serve_set (arg) + char *arg; +{ + /* FIXME: This sends errors immediately (I think); they should be + put into pending_error. */ + variable_set (arg); +} /* * We must read data from a child process and send it across the @@ -1416,9 +1430,6 @@ buf_output (buf, data, len) const char *data; int len; { - if (! buf->output) - abort (); - if (buf->data != NULL && (((buf->last->text + BUFFER_DATA_SIZE) - (buf->last->bufp + buf->last->size)) @@ -2177,6 +2188,13 @@ serve_questionable (arg) static struct buffer protocol; +/* This is the output which we are saving up to send to the server, in the + child process. We will push it through, via the `protocol' buffer, when + we have a complete line. */ +static struct buffer saved_output; +/* Likewise, but stuff which will go to stderr. */ +static struct buffer saved_outerr; + static void protocol_memory_error (buf) struct buffer *buf; @@ -2328,6 +2346,13 @@ do_cvs_command (command) protocol.nonblocking = 0; protocol.memory_error = protocol_memory_error; + saved_output.data = saved_output.last = NULL; + saved_output.fd = -1; + saved_output.output = 0; + saved_output.nonblocking = 0; + saved_output.memory_error = protocol_memory_error; + saved_outerr = saved_output; + if (dup2 (dev_null_fd, STDIN_FILENO) < 0) error (1, errno, "can't set up pipes"); if (dup2 (stdout_pipe[1], STDOUT_FILENO) < 0) @@ -3764,6 +3789,7 @@ struct request requests[] = REQ_LINE("Argument", serve_argument, rq_essential), REQ_LINE("Argumentx", serve_argumentx, rq_essential), REQ_LINE("Global_option", serve_global_option, rq_optional), + REQ_LINE("Set", serve_set, rq_optional), REQ_LINE("expand-modules", serve_expand_modules, rq_optional), REQ_LINE("ci", serve_ci, rq_essential), REQ_LINE("co", serve_co, rq_essential), @@ -4108,6 +4134,8 @@ error ENOMEM Virtual memory exhausted.\n"); #ifdef AUTH_SERVER_SUPPORT +extern char *crypt PROTO((const char *, const char *)); + /* This was test code, which we may need again. */ #if 0 /* If we were invoked this way, then stdin comes from the @@ -4128,15 +4156,15 @@ error ENOMEM Virtual memory exhausted.\n"); * 2 means entry found, but password does not match. */ int -check_repository_password (username, password, repository) - char *username, *password, *repository; +check_repository_password (username, password, repository, host_user_ptr) + char *username, *password, *repository, **host_user_ptr; { int retval = 0; FILE *fp; char *filename; char *linebuf; - int ch; - int found_it = 0, namelen, linelen; + int found_it = 0; + int namelen; filename = xmalloc (strlen (repository) + 1 @@ -4149,19 +4177,6 @@ check_repository_password (username, password, repository) strcat (filename, "/CVSROOT"); strcat (filename, "/passwd"); - /* 32 is enough to cover the hashed password. I don't know if this - * counts as an arbitrary limit or not; it really depends on how - * standardized crypt() is. - * Answer: FreeBSD and Debian have played with the idea of making - * crypt() do MD5 which has a longer value; it would better not to - * make assumptions. So yes, FIXME: arbitrary limit. - */ - - /* USERNAME : PASSWD \n \0 */ - linelen = strlen (username) + 1 + 32 + 1 + 1; - linebuf = xmalloc (linelen); - memset (linebuf, 0, linelen); - fp = fopen (filename, "r"); if (fp == NULL) { @@ -4172,20 +4187,27 @@ check_repository_password (username, password, repository) /* Look for a relevant line -- one with this user's name. */ namelen = strlen (username); - while (fgets (linebuf, linelen, fp)) + while (1) { + linebuf = read_line(fp); + if (linebuf == NULL) + { + free (linebuf); + break; + } + if (linebuf == NO_MEM_ERROR) + { + error (0, errno, "out of memory"); + break; + } if ((strncmp (linebuf, username, namelen) == 0) && (linebuf[namelen] == ':')) { found_it = 1; break; } - else if (! strchr (linebuf, '\n')) - { - while ((ch = getc (fp)) != '\n') - if (ch == EOF) - break; - } + free (linebuf); + } if (ferror (fp)) error (0, errno, "cannot read %s", filename); @@ -4199,14 +4221,18 @@ check_repository_password (username, password, repository) strtok (linebuf, ":"); found_password = strtok (NULL, ": \n"); - + *host_user_ptr = strtok (NULL, ": \n"); + if (*host_user_ptr == NULL) *host_user_ptr = username; if (strcmp (found_password, crypt (password, found_password)) == 0) retval = 1; else retval = 2; } else + { + *host_user_ptr = NULL; retval = 0; + } free (filename); @@ -4214,21 +4240,22 @@ check_repository_password (username, password, repository) } -/* Return 1 if password matches, else 0. */ -int +/* Return a hosting username if password matches, else NULL. */ +char * check_password (username, password, repository) char *username, *password, *repository; { int rc; + char *host_user; /* First we see if this user has a password in the CVS-specific password file. If so, that's enough to authenticate with. If not, we'll check /etc/passwd. */ - rc = check_repository_password (username, password, repository); + rc = check_repository_password (username, password, repository, &host_user); if (rc == 1) - return 1; + return host_user; else if (rc == 2) return 0; else if (rc == 0) @@ -4248,17 +4275,18 @@ check_password (username, password, repository) found_passwd = pw->pw_passwd; if (found_passwd && *found_passwd) - return (! strcmp (found_passwd, crypt (password, found_passwd))); + return (! strcmp (found_passwd, crypt (password, found_passwd))) ? + username : NULL; else if (password && *password) - return 1; + return username; else - return 0; + return NULL; } else { /* Something strange happened. We don't know what it was, but we certainly won't grant authorization. */ - return 0; + return NULL; } } @@ -4269,13 +4297,12 @@ check_password (username, password, repository) void authenticate_connection () { - int len; char tmp[PATH_MAX]; char repository[PATH_MAX]; char username[PATH_MAX]; char password[PATH_MAX]; + char *host_user; char *descrambled_password; - char server_user[PATH_MAX]; struct passwd *pw; int verify_and_exit = 0; @@ -4354,8 +4381,8 @@ authenticate_connection () /* We need the real cleartext before we hash it. */ descrambled_password = descramble (password); - - if (check_password (username, descrambled_password, repository)) + host_user = check_password (username, descrambled_password, repository); + if (host_user) { printf ("I LOVE YOU\n"); fflush (stdout); @@ -4376,7 +4403,7 @@ authenticate_connection () exit (0); /* Switch to run as this user. */ - pw = getpwnam (username); + pw = getpwnam (host_user); if (pw == NULL) { error (1, 0, @@ -4413,3 +4440,84 @@ authenticate_connection () #endif /* SERVER_SUPPORT */ +/* Output LEN bytes at STR. If LEN is zero, then output up to (not including) + the first '\0' byte. Should not be called from the server parent process + (yet at least, in the future it might be extended so that works). */ + +void +cvs_output (str, len) + char *str; + size_t len; +{ + if (len == 0) + len = strlen (str); + if (error_use_protocol) + /* Eventually we'll probably want to make it so this case works, + but for now, callers who want to output something with + error_use_protocol in effect can just printf the "M foo" + themselves. */ + abort (); +#ifdef SERVER_SUPPORT + if (server_active) + { + buf_output (&saved_output, str, len); + buf_copy_lines (&protocol, &saved_output, 'M'); + buf_send_counted (&protocol); + } + else +#endif + { + size_t written; + size_t to_write = len; + char *p = str; + + while (to_write > 0) + { + written = fwrite (str, 1, to_write, stdout); + if (written == 0) + break; + p += written; + to_write -= written; + } + } +} + +/* Like CVS_OUTPUT but output is for stderr not stdout. */ + +void +cvs_outerr (str, len) + char *str; + size_t len; +{ + if (len == 0) + len = strlen (str); + if (error_use_protocol) + /* Eventually we'll probably want to make it so this case works, + but for now, callers who want to output something with + error_use_protocol in effect can just printf the "E foo" + themselves. */ + abort (); +#ifdef SERVER_SUPPORT + if (server_active) + { + buf_output (&saved_outerr, str, len); + buf_copy_lines (&protocol, &saved_outerr, 'E'); + buf_send_counted (&protocol); + } + else +#endif + { + size_t written; + size_t to_write = len; + char *p = str; + + while (to_write > 0) + { + written = fwrite (str, 1, to_write, stderr); + if (written == 0) + break; + p += written; + to_write -= written; + } + } +}