From ff859c7f94e7ba2b698208d3db43a2b3bdbbb736 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 3 May 2011 14:15:52 +0200 Subject: ship the apt-internal-solver in apt-utils package and link it to /usr/lib/apt/solvers so we have it available for playing as 'apt' --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index 640900678..c8aefee63 100755 --- a/debian/rules +++ b/debian/rules @@ -62,7 +62,7 @@ configure.in: endif # APT Programs in apt-utils -APT_UTILS=ftparchive sortpkgs extracttemplates +APT_UTILS=ftparchive sortpkgs extracttemplates internal-solver # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -- cgit v1.2.3-70-g09d2 From 7f4713547665e12e032501228a98586e5add48f7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 3 May 2011 17:27:11 +0200 Subject: add a tiny dump solver to quickly output a scenario --- cmdline/apt-dump-solver.cc | 50 ++++++++++++++++++++++++++++++++++++++++++++++ cmdline/makefile | 7 +++++++ debian/apt-utils.install | 1 + debian/apt.dirs | 1 + debian/rules | 2 +- 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 cmdline/apt-dump-solver.cc (limited to 'debian/rules') diff --git a/cmdline/apt-dump-solver.cc b/cmdline/apt-dump-solver.cc new file mode 100644 index 000000000..5bcfe4f06 --- /dev/null +++ b/cmdline/apt-dump-solver.cc @@ -0,0 +1,50 @@ +// -*- mode: cpp; mode: fold -*- +// Description /*{{{*/ +/* ##################################################################### + + dummy solver to get quickly a scenario file out of APT + + ##################################################################### */ + /*}}}*/ +// Include Files /*{{{*/ +#include + +#include + +#include + /*}}}*/ + +// ShowHelp - Show a help screen /*{{{*/ +// --------------------------------------------------------------------- +/* */ +bool ShowHelp() { + + std::cout << + PACKAGE " " VERSION " for " COMMON_ARCH " compiled on " __DATE__ " " __TIME__ << std::endl << + "Usage: apt-dump-resolver\n" + "\n" + "apt-dump-resolver is a dummy solver who just dumps its input to the\n" + "file /tmp/dump.edsp and exists with a proper EDSP error.\n" + "\n" + " This dump has lost Super Cow Powers.\n"; + return true; +} + /*}}}*/ +int main(int argc,const char *argv[]) /*{{{*/ +{ + if (argc > 1 && (strcmp(argv[1], "--help") == 0 || strcmp(argv[1],"-h") == 0 || + strcmp(argv[1],"-v") == 0 || strcmp(argv[1],"--version") == 0)) { + ShowHelp(); + return 0; + } + + FILE* input = fdopen(STDIN_FILENO, "r"); + FILE* output = fopen("/tmp/dump.edsp", "w"); + char buffer[400]; + while (fgets(buffer, sizeof(buffer), input) != NULL) + fputs(buffer, output); + fclose(output); + fclose(input); + + EDSP::WriteError("I am too dumb, i can just dump!", stdout); +} diff --git a/cmdline/makefile b/cmdline/makefile index 4462ccaf4..aea5d1db5 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -71,3 +71,10 @@ SLIBS = -lapt-pkg $(INTLLIBS) LIB_MAKES = apt-pkg/makefile SOURCE = apt-internal-solver.cc include $(PROGRAM_H) + +# The internal solver acting as an external +PROGRAM=apt-dump-solver +SLIBS = -lapt-pkg $(INTLLIBS) +LIB_MAKES = apt-pkg/makefile +SOURCE = apt-dump-solver.cc +include $(PROGRAM_H) diff --git a/debian/apt-utils.install b/debian/apt-utils.install index d947f26d4..0c72bfdc8 100644 --- a/debian/apt-utils.install +++ b/debian/apt-utils.install @@ -1 +1,2 @@ bin/libapt-inst*.so.* usr/lib/ +bin/apt-dump-solver usr/lib/apt/solvers/dump diff --git a/debian/apt.dirs b/debian/apt.dirs index 2770d79bb..f9c0b6c3e 100644 --- a/debian/apt.dirs +++ b/debian/apt.dirs @@ -1,5 +1,6 @@ usr/bin usr/lib/apt/methods +usr/lib/apt/solvers usr/lib/dpkg/methods/apt etc/apt etc/apt/apt.conf.d diff --git a/debian/rules b/debian/rules index c8aefee63..77a7b4fdb 100755 --- a/debian/rules +++ b/debian/rules @@ -182,7 +182,7 @@ apt: build build-doc dh_install -p$@ --sourcedir=$(BLD) # Remove the bits that are in apt-utils - rm $(addprefix debian/$@/usr/bin/apt-,$(APT_UTILS)) + rm $(addprefix debian/$@/usr/bin/apt-,$(APT_UTILS) dump-solver) # https has its own package rm debian/$@/usr/lib/apt/methods/https -- cgit v1.2.3-70-g09d2 From 66b6fe055a0604d2a8372e61032e492f88f49f86 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 9 May 2011 21:55:32 +0200 Subject: fix package building so 'dump' is a binary not a directory --- debian/apt-utils.dirs | 2 +- debian/apt-utils.install | 1 - debian/rules | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'debian/rules') diff --git a/debian/apt-utils.dirs b/debian/apt-utils.dirs index 14f5b95d7..681e55192 100644 --- a/debian/apt-utils.dirs +++ b/debian/apt-utils.dirs @@ -1,2 +1,2 @@ -usr/lib +usr/lib/apt/solvers usr/bin diff --git a/debian/apt-utils.install b/debian/apt-utils.install index 0c72bfdc8..d947f26d4 100644 --- a/debian/apt-utils.install +++ b/debian/apt-utils.install @@ -1,2 +1 @@ bin/libapt-inst*.so.* usr/lib/ -bin/apt-dump-solver usr/lib/apt/solvers/dump diff --git a/debian/rules b/debian/rules index 77a7b4fdb..c83796e03 100755 --- a/debian/rules +++ b/debian/rules @@ -236,8 +236,10 @@ apt-utils: build dh_installdirs -p$@ cp $(addprefix $(BLD)/bin/apt-,$(APT_UTILS)) debian/$@/usr/bin/ + cp $(BLD)/bin/apt-dump-solver debian/$@/usr/lib/apt/solvers/dump dh_install -p$@ --sourcedir=$(BLD) + dh_link -p$@ dh_installdocs -p$@ dh_installexamples -p$@ -- cgit v1.2.3-70-g09d2