CARDS 2.4.87
Package manager for the NuTyX GNU/Linux distribution
pkgadd.h
1 //
2 // pkgadd.h
3 //
4 // Copyright (c) 2000-2005 Per Liden
5 // Copyright (c) 2006-2013 by CRUX team (http://crux.nu)
6 // Copyright (c) 2013-2017 by NuTyX team (http://nutyx.org)
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
21 // USA.
22 //
23 
28 #ifndef PKGADD_H
29 #define PKGADD_H
30 
31 #include "pkgdbh.h"
32 
40 class Pkgadd : public Pkgdbh {
41 public:
45  Pkgadd();
51  Pkgadd(const std::string& commandName);
52  void parseArguments(int argc, char** argv);
53  void preRun();
54  void postRun();
55  virtual void run();
56  virtual void run(int argc, char** argv);
57  virtual void printHelp() const;
58 
59 protected:
60  bool m_runPrePost;
61  bool m_upgrade;
62  bool m_force;
63 private:
64  std::set<std::string> getKeepFileList(const std::set<std::string>& files,
65  const std::vector<rule_t>& rules);
66  std::set<std::string> applyInstallRules(const std::string& name,
67  pkginfo_t& info,
68  const std::vector<rule_t>& rules);
69  void applyPostInstallRules(const std::string& name,
70  pkginfo_t& info,
71  const std::vector<rule_t>& rules);
72  void getInstallRulesList(const std::vector<rule_t>& rules,
73  rule_event_t event,
74  std::vector<rule_t>& found) const;
75  void getPostInstallRulesList(const std::vector<rule_t>& rules,
76  std::vector<rule_t>& found) const;
77 };
78 
79 #endif /* PKGADD_H */
80 // vim:set ts=2 :
Definition: libcards.h:1450
Pkgadd()
Definition: pkgadd.cxx:28
Pkgadd class.
Definition: libcards.h:1643
Definition: libcards.h:1495