blob: 44968ccb380b82241a7b3aed235fcd131fc4df98 (
plain)
1 ////////////////////////////////////////////////////////////////////////
2 // FILE: locker.h
3 // AUTHOR: Johannes Winkelmann, jw@tks6.net
4 // COPYRIGHT: (c) 2002 by Johannes Winkelmann
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 of the License, or
9 // (at your option) any later version.
10 ////////////////////////////////////////////////////////////////////////
11
12 #ifndef _LOCKER_H_
13 #define _LOCKER_H_
14
15 #include <string>
16 #include <vector>
17
18 using namespace std;
19
20 /**
21 * prt-get can place packages in the locker, which are then not updated
22 * anymore.
23 * Locked packages are:
24 * - marked in prt-get diff
25 * - not shown in prt-get quickdiff
26 * - not updated in prt-get sysup
27 */
28 class Locker
29 {
30 public:
31 Locker();
32
33 bool store();
34
35 bool lock( const string& package );
36 bool unlock( const string& package );
37 bool isLocked( const string& package ) const;
38
39 const vector<string>& lockedPackages() const;
40
41 bool openFailed() const;
42 private:
43
44 vector<string> m_packages;
45 static const string LOCKER_FILE;
46 static const string LOCKER_FILE_PATH;
47
48 bool m_openFailed;
49 };
50
51 #endif /* _LOCKER_H_ */
|