Makefiles: trim trailing whitespaces from TOP in `stmkmf.rb` stx-8.0.0
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 17 Jan 2018 12:33:30 +0000
branchstx-8.0.0
changeset 215 b62a3ec9be82
parent 213 58e61f63be9c
child 217 6a5f241a2abc
Makefiles: trim trailing whitespaces from TOP in `stmkmf.rb`
bin/stmkmf.rb
--- a/bin/stmkmf.rb	Fri Jan 12 22:21:36 2018 +0000
+++ b/bin/stmkmf.rb	Wed Jan 17 12:33:30 2018 +0000
@@ -31,18 +31,21 @@
     make_proto_contents = File.read(File.join(cwd, 'Make.proto')).encode("UTF-8", :invalid=>:replace, :replace=>"?").encode('UTF-8')
     match = /^TOP=(.*)$/.match(make_proto_contents)
     if match.nil? then
-      STDERR.puts "error: could not ectract TOP from Make.proto (missing TOP=.. definition?)"    
+      STDERR.puts "error: could not extract TOP from Make.proto (missing TOP=.. definition?)"    
       return 4
     end
-    top = match[1]
+    top = match[1].rstrip()
   end
   if not File.directory? top then
-    STDERR.puts "error: TOP not a cwd: #{top}"    
+    require 'pry'
+    require 'pry-byebug'
+    binding.pry
+    STDERR.puts "error: TOP does not exist or not a directory: #{top}"    
     return 5
   end
   makelib = File.join(cwd, top, '..', '..' , 'makelib')
   if not File.exist? makelib then
-    STDERR.puts "error: could not find out include cwd: #{makelib}"    
+    STDERR.puts "error: makefile include library does not exist or not a directory: #{makelib}"
     return 6
   end
   File.open(File.join(cwd, out), "w") do | f |