X-Git-Url: http://gitweb/?a=blobdiff_plain;f=pkgadd.h;h=0879808a44698ffc6c0af38ec30b43148864bf2b;hb=959f70f78d0797b2b0d87403f4a9d153bc521dfd;hp=46e0f1bef99dcc62e2465cc529b05d86107352aa;hpb=9ac667e68d3e36eb99272eac57219002ee2318e6;p=pkgutils-cross.git diff --git a/pkgadd.h b/pkgadd.h index 46e0f1b..0879808 100644 --- a/pkgadd.h +++ b/pkgadd.h @@ -2,6 +2,7 @@ // 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 @@ -29,8 +30,13 @@ #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; }; @@ -42,8 +48,11 @@ public: virtual void print_help() const; private: - vector read_config() const; + vector read_config(string file) const; set make_keep_list(const set& files, const vector& rules) const; + set apply_install_rules(const string& name, pkginfo_t& info, const vector& rules); + void find_rules(const vector& rules, rule_event_t event, vector& found) const; + bool rule_applies_to_file(const rule_t& rule, const string& file) const; }; #endif /* PKGADD_H */