tangled
alpha
login
or
join now
jcs.org
/
openbsd-commitid
0
fork
atom
script to retroactively add commitids to past openbsd commits
0
fork
atom
overview
issues
pulls
pipelines
Outputter: use some shell vars to save space in output script
jcs.org
9 years ago
78a13fd3
be9363ef
+11
-5
1 changed file
expand all
collapse all
unified
split
lib
outputter.rb
+11
-5
lib/outputter.rb
···
25
25
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
26
#
27
27
28
28
+
require "shellwords"
29
29
+
28
30
class Outputter
29
31
def initialize(scanner)
30
32
@scanner = scanner
···
170
172
script.puts "if [ \"$CVSROOT\" = \"\" ]; then echo 'set $CVSROOT'; " +
171
173
"exit 1; fi"
172
174
script.puts ""
175
175
+
script.puts "set -e"
176
176
+
script.puts ""
173
177
script.puts "cd $TMPCVSDIR"
174
174
-
script.puts "cvs -Q -d $CVSROOT co -r1.1 #{tree} || exit 1"
178
178
+
script.puts "cvs -Q -d $CVSROOT co -r1.1 #{tree}"
175
179
script.puts ""
176
180
177
181
dead11s = {}
···
185
189
dead11s.each do |file,rev|
186
190
confile = file.gsub(/,v$/, "")
187
191
188
188
-
script.puts "cvs -Q -d $CVSROOT co -r#{rev} '#{tree}/#{confile}' " +
189
189
-
"|| exit 1"
192
192
+
script.puts "cvs -Q -d $CVSROOT co -r#{rev} " +
193
193
+
"#{tree}/#{Shellwords.escape(confile)}"
190
194
end
191
195
192
196
script.puts ""
···
204
208
script.puts "# #{Time.at(rev["date"])} by " + rev["author"] +
205
209
(rev["branch"].to_s == "" ? "" : " (branch #{rev["branch"]})")
206
210
csid = rev["commitid"]
211
211
+
script.puts "COMMITID=\"#{Shellwords.escape(rev["commitid"])}\""
207
212
end
208
213
209
209
-
script.puts "cvs admin -C #{rev["version"]}:#{rev["commitid"]} '" +
210
210
-
rev["file"].gsub(/,v$/, "") + "'"
214
214
+
fi = rev["file"].gsub(/,v$/, "")
215
215
+
script.puts "cvs admin -C #{rev["version"]}:${COMMITID} " +
216
216
+
"#{Shellwords.escape(fi)}"
211
217
end
212
218
end
213
219
end