File: 0003-Close-files-in-cogen.rb.patch

package info (click to toggle)
ruby-pgplot 0.1.9-3
  • links: PTS, VCS
  • area: contrib
  • in suites: buster, stretch
  • size: 604 kB
  • ctags: 144
  • sloc: ruby: 1,607; makefile: 76; ansic: 57; sh: 17
file content (25 lines) | stat: -rw-r--r-- 667 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: David MacMahon <davidm@astro.berkeley.edu>
Date: Sun, 3 Mar 2013 11:03:03 -0800
Subject: Close files in cogen.rb

This is important for running cogen.rb from within Rakefile.  Without
explicitly closing the output file, a truncated version of rb_pgplot.c
may be packaged in the gem file before the rb_pgplot.c file gets closed
when the rake process exits.
---
 ext/cogen.rb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ext/cogen.rb b/ext/cogen.rb
index aabbae4..d5cebdc 100644
--- a/ext/cogen.rb
+++ b/ext/cogen.rb
@@ -153,6 +153,8 @@ def cogen_pgplot
       fout.print
     end
   end
+  fout.close
+  fin.close
 end
 
 cogen_pgplot if $0 == __FILE__