GetComponents chokes on thorn list using DOS EOL characters in !DEFINEs

Create issue
Issue #482 closed
Roland Haas created an issue

the attached file uses DOS EOL conventions (ie. \r\n instead of the Unix typical \n) gives error messages:

[rhaas3@phys44230 rhaas3]$ ./GetComponents --root dos --parallel cactus.th
Unsuccessful stat on filename containing newline at ./GetComponents line 663.
Unsuccessful stat on filename containing newline at ./GetComponents line 663.
-----------------------------------------------------------------
  Checking out module: Cactus
      from repository: http://svn.cactuscode.org/flesh/trunk
                 into: dos
                   as: .

-----------------------------------------------------------------
  Checking out module: CactusBase/Boundary
      from repository: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk
                 into: dos/arrangements
: No such file or directoryments

Warning: Could not checkout module CactusBase/Boundary
<some more of the same>
-----------------------------------------------------------------
  1 components checked out.
  0 components updated.

  Unable to process CactusBase/Boundary
  Unable to process CactusBase/CartGrid3D
  Unable to process CactusBase/CoordBase
  Unable to process CactusBase/InitBase
  Unable to process CactusBase/IOUtil
  Unable to process CactusBase/SymBase
  Unable to process CactusBase/Time
  Unable to process CactusNumerical/MoL
  Unable to process CactusBase/LocalInterp
  Unable to process CactusUtils/NaNChecker
  Unable to process CactusNumerical/Periodic
  Unable to process CactusUtils/Formaline
  Unable to process CactusNumerical/Slab

Summary of Warnings:

Could not checkout module CactusBase/Boundary

Could not checkout module CactusBase/CartGrid3D

Could not checkout module CactusBase/CoordBase

Could not checkout module CactusBase/InitBase

Could not checkout module CactusBase/IOUtil

Could not checkout module CactusBase/SymBase

Could not checkout module CactusBase/Time

Could not checkout module CactusNumerical/MoL

Could not checkout module CactusBase/LocalInterp

Could not checkout module CactusUtils/NaNChecker

Could not checkout module CactusNumerical/Periodic

Could not checkout module CactusUtils/Formaline

Could not checkout module CactusNumerical/Slab

  Time Elapsed: 0 minutes, 8 seconds

This is due to a \r which becomes part of the ARRANGEMENTS !DEFINE.

A simple solution might be for GetComponents to remove whitespace from end of input lines via a:

diff --git a/GetComponents b/GetComponents
index 133487e..5e801f3 100755
--- a/GetComponents
+++ b/GetComponents
@@ -305,6 +305,9 @@ sub parse_list {
         my @lines = <$COMPONENT_LIST>;
         close($COMPONENT_LIST);

+        # convert CRNL and CR to newline (for lists generated by windows and macs)
+        map s/(\r\n|\r)/\n/gm, @lines;
+
         # handle includes
         my $i = -1;
         foreach my $line (@lines) {

Note that his renders the CRtoNL regex on $file below useless (I am also not sure to what extent we need $orig_file to have the native EOL character).

Keyword:

Comments (4)

  1. Frank Löffler
    • changed status to open
    • removed comment

    I agree, \r are a problem if they are only removed after the defines are handled. Please test the attached patch.

  2. Peter Diener
    • removed comment

    I was able to reproduce the problem and confirm that the patch fixes it. I have not seen any side effects when checking out non-dos thornlists.

  3. Log in to comment