Remove wesnoth-zip: it has been broken for many months now,
...and nobody cared enough to fix it. What was it even supposed to be?
This commit is contained in:
parent
e8075b67ca
commit
32646f3503
4 changed files with 0 additions and 138 deletions
|
@ -211,11 +211,6 @@ AC_ARG_ENABLE([gnome2],
|
|||
AS_HELP_STRING([--disable-gnome2], [disable installation of icon and menu entry in GNOME2]),
|
||||
[gnome2=$enableval],
|
||||
[gnome2=yes])
|
||||
|
||||
AC_ARG_ENABLE([wzip],
|
||||
AS_HELP_STRING([--enable-wzip], [enable compilation of wesnoth_zip program]),
|
||||
[wzip=$enableval],
|
||||
[wzip=no])
|
||||
|
||||
AC_ARG_ENABLE([dummy-locales],
|
||||
AS_HELP_STRING([--enable-dummy-locales], [enable installation of Wesnoth own private locales]),
|
||||
|
@ -235,7 +230,6 @@ AM_CONDITIONAL([CAMPAIGNSERVER], [test x$campaignserver = xyes])
|
|||
AM_CONDITIONAL([EDITOR], [test x$editor = xyes])
|
||||
AM_CONDITIONAL([TOOLS], [test x$tools = xyes])
|
||||
AM_CONDITIONAL([GCC], [test x$GXX = xyes])
|
||||
AM_CONDITIONAL([WZIP], [test x$wzip = xyes])
|
||||
AM_CONDITIONAL([INCLUDEDINTL], [test x$nls_cv_use_gnu_gettext = xyes])
|
||||
AM_CONDITIONAL([INSTALLDATA], [test x$game = xyes || x$editor = xyes])
|
||||
AM_CONDITIONAL([DUMMYLOCALES], [test x$dummylocales = xyes])
|
||||
|
|
|
@ -22,10 +22,6 @@ if EDITOR
|
|||
bin_PROGRAMS += wesnoth_editor
|
||||
endif
|
||||
|
||||
if WZIP
|
||||
bin_PROGRAMS += wesnoth_zip
|
||||
endif
|
||||
|
||||
pkgdatadir=$(datadir)/@DATADIR@
|
||||
|
||||
#############################################################################
|
||||
|
@ -544,30 +540,6 @@ cutter_SOURCES = \
|
|||
exploder_LDADD = @SDL_IMAGE_LIBS@ @SDL_LIBS@ $(LIBZIPIOS) $(LIBINTL) $(PNG_LIBS)
|
||||
cutter_LDADD = @SDL_IMAGE_LIBS@ @SDL_LIBS@ $(LIBZIPIOS) $(LIBINTL) $(PNG_LIBS)
|
||||
|
||||
#############################################################################
|
||||
# Wesnoth Zip #
|
||||
#############################################################################
|
||||
|
||||
wesnoth_zip_SOURCES = \
|
||||
zip/zip.cpp \
|
||||
config.cpp \
|
||||
filesystem.cpp \
|
||||
game_config.cpp \
|
||||
gettext.cpp \
|
||||
log.cpp \
|
||||
network.cpp \
|
||||
tstring.cpp \
|
||||
config.hpp \
|
||||
gettext.hpp \
|
||||
filesystem.hpp \
|
||||
game_config.hpp \
|
||||
log.hpp \
|
||||
network.hpp \
|
||||
tstring.hpp \
|
||||
wesconfig.h
|
||||
|
||||
wesnoth_zip_LDADD = @SDL_LIBS@ @SDL_NET_LIBS@
|
||||
|
||||
AM_CXXFLAGS = -I $(srcdir)/sdl_ttf -I../intl -I$(top_srcdir)/intl @SDL_CFLAGS@ -DWESNOTH_PATH=\"$(pkgdatadir)\" \
|
||||
-DLOCALEDIR=\"$(LOCALEDIR)\" -DHAS_RELATIVE_LOCALEDIR=$(HAS_RELATIVE_LOCALEDIR) -DFIFODIR=\"$(fifodir)\"
|
||||
|
||||
|
|
2
src/zip/.gitignore
vendored
2
src/zip/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
.deps
|
||||
.dirstamp
|
102
src/zip/zip.cpp
102
src/zip/zip.cpp
|
@ -1,102 +0,0 @@
|
|||
#include "../config.hpp"
|
||||
#include "../game_config.hpp"
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
bool try_unzip(const std::string& data_in, std::string& data_out)
|
||||
{
|
||||
config cfg;
|
||||
compression_schema schema;
|
||||
try {
|
||||
cfg.read_compressed(data_in,schema);
|
||||
} catch(config::error&) {
|
||||
return false;
|
||||
}
|
||||
data_out = cfg.write();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool try_zip(const std::string& data_in, std::string& data_out)
|
||||
{
|
||||
config cfg;
|
||||
compression_schema schema;
|
||||
cfg.read(data_in);
|
||||
try {
|
||||
data_out = cfg.write_compressed(schema);
|
||||
} catch(config::error&) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::vector<std::string> args;
|
||||
args.reserve(argc);
|
||||
for(int arg = 0; arg != argc; ++arg)
|
||||
args.push_back(std::string(argv[arg]));
|
||||
|
||||
bool to_stdout = false, from_stdin = true;
|
||||
std::vector<std::string> files;
|
||||
for(std::vector<std::string>::const_iterator i = args.begin()+1; i != args.end(); ++i) {
|
||||
if(i->empty())
|
||||
continue;
|
||||
if(*i == "-h" || *i == "--help") {
|
||||
std::cout
|
||||
<< "usage: " << args[0]
|
||||
<< " [-clhV] [files...]\n"
|
||||
<< " -c, --std-out Write output on standard output; keep original files unchanged.\n"
|
||||
<< " -h, --help Prints this message and exits\n"
|
||||
<< " -V, --version Prints the game's version number and exits\n";
|
||||
return 0;
|
||||
} else if(*i == "-V" || *i == "--version") {
|
||||
std::cout << "Battle for Wesnoth " << game_config::version << "\n";
|
||||
std::cout << args[0] << " 0.1\n";
|
||||
return 0;
|
||||
} else if(*i == "-c" || *i == "--std-out") {
|
||||
to_stdout = true;
|
||||
continue;
|
||||
}
|
||||
// Any other options must be file names
|
||||
files.push_back(*i);
|
||||
from_stdin = false;
|
||||
}
|
||||
if(from_stdin) {
|
||||
const std::string data = read_stdin();
|
||||
std::string output;
|
||||
if(!try_unzip(data,output) && !try_zip(data,output)) {
|
||||
std::cerr << "Standard input data not compressed or uncompressed WML\n";
|
||||
return 3;
|
||||
}
|
||||
std::cout << output;
|
||||
return 0;
|
||||
}
|
||||
// Process input files
|
||||
int error = 0;
|
||||
for(std::vector<std::string>::const_iterator i = files.begin(); i != files.end(); ++i) {
|
||||
const std::string data = read_file(*i);
|
||||
if(data.empty()) {
|
||||
std::cerr << "Could not read file: " << *i << '\n';
|
||||
error = 1;
|
||||
continue;
|
||||
}
|
||||
std::string output;
|
||||
if(!try_unzip(data,output) && !try_zip(data,output)) {
|
||||
std::cerr << "Input file not compressed or uncompressed WML: " << *i << '\n';
|
||||
error = 3;
|
||||
continue;
|
||||
}
|
||||
if(to_stdout) {
|
||||
std::cout << output;
|
||||
} else {
|
||||
try {
|
||||
write_file(*i,output);
|
||||
} catch (io_exception& e) {
|
||||
std::cerr << "Could not write file: " << *i << '\n';
|
||||
error = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
return error;
|
||||
}
|
Loading…
Add table
Reference in a new issue