// pkgutils
//
// Copyright (c) 2000-2005 Per Liden
+// Copyright (c) 2006-2013 by CRUX team (http://crux.nu)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
#define PKGADD_CONF "/etc/pkgadd.conf"
#define PKGADD_CONF_MAXLINE 1024
+enum rule_event_t {
+ UPGRADE,
+ INSTALL
+};
+
struct rule_t {
- enum { UPGRADE } event;
+ rule_event_t event;
string pattern;
bool action;
};
private:
vector<rule_t> read_config() const;
set<string> make_keep_list(const set<string>& files, const vector<rule_t>& rules) const;
+ set<string> apply_install_rules(const string& name, pkginfo_t& info, const vector<rule_t>& rules);
+ void find_rules(const vector<rule_t>& rules, rule_event_t event, vector<rule_t>& found) const;
+ bool rule_applies_to_file(const rule_t& rule, const string& file) const;
};
#endif /* PKGADD_H */