1 |
786 |
skrzyp |
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####
|
2 |
|
|
// -------------------------------------------
|
3 |
|
|
// This file is part of the eCos host tools.
|
4 |
|
|
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
5 |
|
|
//
|
6 |
|
|
// This program is free software; you can redistribute it and/or modify
|
7 |
|
|
// it under the terms of the GNU General Public License as published by
|
8 |
|
|
// the Free Software Foundation; either version 2 or (at your option) any
|
9 |
|
|
// later version.
|
10 |
|
|
//
|
11 |
|
|
// This program is distributed in the hope that it will be useful, but
|
12 |
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 |
|
|
// General Public License for more details.
|
15 |
|
|
//
|
16 |
|
|
// You should have received a copy of the GNU General Public License
|
17 |
|
|
// along with this program; if not, write to the
|
18 |
|
|
// Free Software Foundation, Inc., 51 Franklin Street,
|
19 |
|
|
// Fifth Floor, Boston, MA 02110-1301, USA.
|
20 |
|
|
// -------------------------------------------
|
21 |
|
|
// ####ECOSHOSTGPLCOPYRIGHTEND####
|
22 |
|
|
#include "cdl.hxx"
|
23 |
|
|
|
24 |
|
|
class cdl_exec {
|
25 |
|
|
public:
|
26 |
|
|
cdl_exec (const std::string repository_tree, const std::string savefile_name, const std::string install_tree, bool no_resolve);
|
27 |
|
|
bool cmd_new (const std::string cdl_hardware, const std::string cdl_template = "default", const std::string cdl_version = "");
|
28 |
|
|
bool cmd_tree ();
|
29 |
|
|
bool cmd_check ();
|
30 |
|
|
bool cmd_list ();
|
31 |
|
|
bool cmd_add (const std::vector cdl_packages);
|
32 |
|
|
bool cmd_remove (const std::vector cdl_packages);
|
33 |
|
|
bool cmd_version (const std::string cdl_version, const std::vector cdl_packages);
|
34 |
|
|
bool cmd_template (const std::string cdl_template, const std::string cdl_version = "");
|
35 |
|
|
bool cmd_export (const std::string cdl_savefile);
|
36 |
|
|
bool cmd_import (const std::string cdl_savefile);
|
37 |
|
|
bool cmd_target (const std::string cdl_target);
|
38 |
|
|
bool cmd_resolve ();
|
39 |
|
|
|
40 |
|
|
static void set_quiet_mode(bool);
|
41 |
|
|
static void set_verbose_mode(bool);
|
42 |
|
|
static void set_ignore_errors_mode(bool);
|
43 |
|
|
static void set_no_updates_mode(bool);
|
44 |
|
|
static void set_debug_level(int);
|
45 |
|
|
|
46 |
|
|
protected:
|
47 |
|
|
static bool quiet;
|
48 |
|
|
static bool verbose;
|
49 |
|
|
static bool ignore_errors;
|
50 |
|
|
static bool no_updates;
|
51 |
|
|
std::string repository;
|
52 |
|
|
std::string savefile;
|
53 |
|
|
std::string install_prefix;
|
54 |
|
|
bool no_resolve;
|
55 |
|
|
static bool debug_level_set;
|
56 |
|
|
static int debug_level;
|
57 |
|
|
CdlPackagesDatabase pkgdata;
|
58 |
|
|
CdlInterpreter interp;
|
59 |
|
|
CdlConfiguration config;
|
60 |
|
|
void init(bool /* load */);
|
61 |
|
|
void delete_cdl_data ();
|
62 |
|
|
static void diagnostic_handler (std::string message);
|
63 |
|
|
void exception_handler (CdlStringException exception);
|
64 |
|
|
void exception_handler ();
|
65 |
|
|
void report_conflicts();
|
66 |
|
|
static CdlInferenceCallbackResult inference_callback (CdlTransaction transaction);
|
67 |
|
|
static void transaction_callback(const CdlTransactionCallback&);
|
68 |
|
|
std::string resolve_package_alias (const std::string alias);
|
69 |
|
|
std::string resolve_hardware_alias (const std::string alias);
|
70 |
|
|
void update_debug_level(void);
|
71 |
|
|
};
|