diff options
author | wm4 <wm4@nowhere> | 2016-12-17 13:24:05 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-12-17 15:43:15 +0100 |
commit | ff9f5e06ff203c055d968087956026ef9204218b (patch) | |
tree | 883725191398913cc97bd441b7110bcf68237e28 /TOOLS/file2string.pl | |
parent | 2b8b17402ed59815019b309051b277ba4de82f3b (diff) | |
download | mpv-ff9f5e06ff203c055d968087956026ef9204218b.tar.bz2 mpv-ff9f5e06ff203c055d968087956026ef9204218b.tar.xz |
Revert "Port several python scripts to Perl"
This reverts commit fae73079310eef9dce9737f2e37ff4b80c8830ee.
Before the waf build system was used, we had a configure script written
in shell. To drop the build dependency on Python, someone rewrote the
Python scripts we had to Perl. Now the shell configure script is gone,
and it makes no sense to have a build dependency on both Perl and
Python.
This isn't just a straight revert. It adds the new Matroska EBML
elements to the old Python scripts, adjusts the waf build system, and of
course doesn't add anything back needed by the old build system.
It would be better if this used matroska.py/file2string.py directly by
importing them as modules, instead of calling them via "python". But for
now this is simpler.
Diffstat (limited to 'TOOLS/file2string.pl')
-rwxr-xr-x | TOOLS/file2string.pl | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/TOOLS/file2string.pl b/TOOLS/file2string.pl deleted file mode 100755 index 341bb06fd6..0000000000 --- a/TOOLS/file2string.pl +++ /dev/null @@ -1,24 +0,0 @@ -#! /usr/bin/env perl - -use strict; -use warnings; - -# Convert the contents of a file into a C string constant. -# Note that the compiler will implicitly add an extra 0 byte at the end -# of every string, so code using the string may need to remove that to get -# the exact contents of the original file. -# FIXME: why not a char array? - -# treat only alphanumeric and punctuations (excluding " and ?) as safe -my $unsafe_chars = qr{[^][A-Za-z0-9!#%&'()*+,./:;<=>^_{|}~ -]}; - -for my $file (@ARGV) { - open my $fh, '<:raw', $file or next; - print "/* Generated from $file */\n"; - while (<$fh>) { - # replace unsafe chars with their equivalent octal escapes - s/($unsafe_chars)/\\@{[sprintf '%03o', ord($1)]}/gos; - print "\"$_\"\n" - } - close $fh; -} |