bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EMX on DOS


From: Paul Edwards
Subject: Re: EMX on DOS
Date: Sun, 02 Nov 2003 00:38:26 GMT

"Paul Edwards" <address@hidden> wrote in message news:address@hidden
> I have attempted to compile CVS using EMX 0.9d on DOS.
>
> I noticed the following things:
>
> ignore.c has a call to lstat() instead of CVS_LSTAT.  Is this
> incorrect?
>
> In filesubr.c, some of the calls to S_ISLNK have a #ifdef
> around them, and some don't.  S_ISBLK was also an unresolved
> reference on my system.

Here is a summary of the changes I have done so far.  This
is enough to allow basic CVS functions on DOS.

The funny thing is, CVS used to work fine on DOS.  It
probably got broken when the separate RCS programs were
merged into the CVS main.  I had previously been under
the impression that the functionality to do short filenames
and case insensitivity was already in CVS properly.

I have some questions:

1. Should I rely on the HAVE_LONG_FILE_NAMES for
the DOS port?

2. In filesubr.c I was very surprised to see rename() being
used, without any #ifdefing to say whether rename would
overwrite an existing file.  The C standard leavs it
ambiguous.  Any reason why we don't delete the target
before rename?  I'm surprised this is the first system in this
boat.  It was also necessary to make it writable.

3. Find_names.c checks for ".' and ".." in some circumstances
but not all, specifically when there is no useful wildcard to
show the ,v files.

4. I went and got an old copy of RCS for DOS, version 5.7,
to find out how they locked files.  They do it by checking the
extension and putting a "_" in the last character.  I have thus
copied that same logic into this one.

I'll post the new DOS files in the next message.

BFN.  Paul.


Index: src/cvs.h
===================================================================
RCS file: /cvs/ccvs/src/cvs.h,v
retrieving revision 1.235.4.10
diff -c -r1.235.4.10 cvs.h
*** src/cvs.h 7 Oct 2003 18:23:01 -0000 1.235.4.10
--- src/cvs.h 2 Nov 2003 00:19:00 -0000
***************
*** 135,140 ****
--- 135,141 ----
  #define CVSADM_BASEREVTMP "CVS/Baserev.tmp"
  #define CVSADM_TEMPLATE "CVS/Template."
  #else /* USE_VMS_FILENAMES */
+ #ifdef HAVE_LONG_FILE_NAMES
  #define CVSADM  "CVS"
  #define CVSADM_ENT "CVS/Entries"
  #define CVSADM_ENTBAK "CVS/Entries.Backup"
***************
*** 152,157 ****
--- 153,178 ----
  #define CVSADM_BASEREVTMP "CVS/Baserev.tmp"
  /* File which contains the template for use in log messages.  */
  #define CVSADM_TEMPLATE "CVS/Template"
+ #else
+ #define CVSADM  "CVS"
+ #define CVSADM_ENT "CVS/Entries"
+ #define CVSADM_ENTBAK "CVS/Entries.Bak"
+ #define CVSADM_ENTLOG "CVS/Entries.Log"
+ #define CVSADM_ENTSTAT "CVS/Entries.Sta"
+ #define CVSADM_REP "CVS/Reposito"
+ #define CVSADM_ROOT "CVS/Root"
+ #define CVSADM_TAG "CVS/Tag"
+ #define CVSADM_NOTIFY "CVS/Notify"
+ #define CVSADM_NOTIFYTMP "CVS/Notify.tmp"
+ #define CVSADM_BASE     "CVS/Base"
+ #define CVSADM_BASEREV  "CVS/Baserev"
+ #define CVSADM_BASEREVTMP "CVS/Baserev.tmp"
+ #define CVSADM_TEMPLATE "CVS/Template"
+ #undef RCSEXT
+ #define RCSEXT ""
+ #undef RCSPAT
+ #define RCSPAT "*"
+ #endif /* HAVE_LONG_FILE_NAMES */
  #endif /* USE_VMS_FILENAMES */

  /* This is the special directory which we use to store various extra
***************
*** 201,206 ****
--- 222,228 ----
     some operations (such as main branch checkouts and updates).  */
  #define CVSATTIC "Attic"

+ #ifdef HAVE_LONG_FILE_NAMES
  #define CVSLCK  "#cvs.lock"
  #define CVSRFL  "#cvs.rfl"
  #define CVSWFL  "#cvs.wfl"
***************
*** 209,214 ****
--- 231,246 ----
  #define CVSPREFIX ",,"
  #define CVSDOTIGNORE ".cvsignore"
  #define CVSDOTWRAPPER   ".cvswrappers"
+ #else
+ #define CVSLCK  "#cvs.lok"
+ #define CVSRFL  "#cvsrfl"
+ #define CVSWFL  "#cvswfl"
+ #define CVSRFLPAT "#cvsrfl.*" /* wildcard expr to match read locks */
+ #define CVSEXT_LOG ""
+ #define CVSPREFIX ",,"
+ #define CVSDOTIGNORE ".cvsignor"
+ #define CVSDOTWRAPPER   ".cvswraps"
+ #endif

  /* Command attributes -- see function lookup_command_attribute(). */
  #define CVS_CMD_IGNORE_ADMROOT        1
***************
*** 569,575 ****
  void strip_trailing_slashes PROTO((char *path));
  void update_delproc PROTO((Node * p));
  void usage PROTO((const char *const *cpp));
! void xchmod PROTO((char *fname, int writable));
  char *xgetwd PROTO((void));
  List *Find_Names PROTO((char *repository, int which, int aflag,
      List ** optentries));
--- 601,607 ----
  void strip_trailing_slashes PROTO((char *path));
  void update_delproc PROTO((Node * p));
  void usage PROTO((const char *const *cpp));
! void xchmod PROTO((const char *fname, int writable));
  char *xgetwd PROTO((void));
  List *Find_Names PROTO((char *repository, int which, int aflag,
      List ** optentries));
Index: src/filesubr.c
===================================================================
RCS file: /cvs/ccvs/src/filesubr.c,v
retrieving revision 1.59.4.5
diff -c -r1.59.4.5 filesubr.c
*** src/filesubr.c 28 Jun 2003 03:28:29 -0000 1.59.4.5
--- src/filesubr.c 2 Nov 2003 00:19:02 -0000
***************
*** 348,354 ****
   */
  void
  xchmod (fname, writable)
!     char *fname;
      int writable;
  {
      struct stat sb;
--- 348,354 ----
   */
  void
  xchmod (fname, writable)
!     const char *fname;
      int writable;
  {
      struct stat sb;
***************
*** 402,407 ****
--- 402,409 ----
      if (noexec)
   return;

+     xchmod(to, 1);
+     CVS_UNLINK(to);
      if (rename (from, to) < 0)
   error (1, errno, "cannot rename file %s to %s", from, to);
  }
Index: src/find_names.c
===================================================================
RCS file: /cvs/ccvs/src/find_names.c,v
retrieving revision 1.30
diff -c -r1.30 find_names.c
*** src/find_names.c 24 Sep 2001 15:16:05 -0000 1.30
--- src/find_names.c 2 Nov 2003 00:19:02 -0000
***************
*** 270,281 ****
      errno = 0;
      while ((dp = CVS_READDIR (dirp)) != NULL)
      {
!  if (CVS_FNMATCH (RCSPAT, dp->d_name, 0) == 0)
   {
       char *comma;

       comma = strrchr (dp->d_name, ','); /* strip the ,v */
!      *comma = '\0';
       p = getnode ();
       p->type = FILES;
       p->key = xstrdup (dp->d_name);
--- 270,282 ----
      errno = 0;
      while ((dp = CVS_READDIR (dirp)) != NULL)
      {
!  if ((CVS_FNMATCH (RCSPAT, dp->d_name, 0) == 0)
!         && !isdir (dp->d_name))
   {
       char *comma;

       comma = strrchr (dp->d_name, ','); /* strip the ,v */
!      if (comma != NULL) *comma = '\0';
       p = getnode ();
       p->type = FILES;
       p->key = xstrdup (dp->d_name);
Index: src/ignore.c
===================================================================
RCS file: /cvs/ccvs/src/ignore.c,v
retrieving revision 1.39
diff -c -r1.39 ignore.c
*** src/ignore.c 23 May 2002 18:13:17 -0000 1.39
--- src/ignore.c 2 Nov 2003 00:19:04 -0000
***************
*** 451,457 ****
  #ifdef DT_DIR
    dp->d_type != DT_UNKNOWN ||
  #endif
!   lstat(file, &sb) != -1)
   {

       if (
--- 451,457 ----
  #ifdef DT_DIR
    dp->d_type != DT_UNKNOWN ||
  #endif
!   CVS_LSTAT(file, &sb) != -1)
   {

       if (
Index: src/rcs.c
===================================================================
RCS file: /cvs/ccvs/src/rcs.c,v
retrieving revision 1.262.4.14
diff -c -r1.262.4.14 rcs.c
*** src/rcs.c 7 Oct 2003 18:23:01 -0000 1.262.4.14
--- src/rcs.c 2 Nov 2003 00:19:13 -0000
***************
*** 8495,8505 ****
--- 8495,8523 ----
      rcsend = rcsfile + rcslen - sizeof(RCSEXT);
      for (lockp = lockfile, rcsp = rcsfile; rcsp < rcsbase; ++rcsp)
   *lockp++ = *rcsp;
+  if (*(rcsend + 1) == '\0')
+  {
+      char *p;
+
+      strcpy(lockp, rcsp);
+      p = lockp + strlen(lockp) - 1;
+      if (*p == '_')
+      {
+          error(1, 0, "can't lock files ending with underscore");
+      }
+      else
+      {
+   *p = '_';
+      }
+  }
+  else
+  {
      *lockp++ = ',';
      while (rcsp <= rcsend)
   *lockp++ = *rcsp++;
      *lockp++ = ',';
      *lockp = '\0';
+  }

      return lockfile;
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]