1 # Copyright (C) 2015-2016 all contributors <olddoc-public@80x24.org>
2 # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
6 dest = ENV["RSYNC_DEST"] || "80x24.org:/srv/80x24/olddoc/"
7 top = %w(INSTALL README COPYING)
9 # git-set-file-times is distributed with rsync,
10 # Also available at: https://yhbt.net/git-set-file-times
11 # on Debian systems: /usr/share/doc/rsync/scripts/git-set-file-times.gz
12 sh("git", "set-file-times", 'Documentation', *top)
14 do_gzip = lambda do |txt|
17 sh("gzip --rsyncable -9 < #{txt} > #{tmp}")
19 File.utime(st.atime, st.mtime, tmp) # make nginx gzip_static happy
24 files = `git ls-files -o Documentation/*.txt`.split(/\n/)
26 files.concat(%w(NEWS NEWS.atom.xml))
27 files.concat(Dir["doc/*.html"].to_a)
28 gzfiles = files.map { |txt| do_gzip.call(txt) }
30 sh("rsync --chmod=Fugo=r -av #{files.join(' ')} #{dest}")