summaryrefslogtreecommitdiff
blob: 81dcb8a3349141d6d8e67ff36c056a4ce2dc9077 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?

	class PackageMask {
	
		private $filename;
		private $mtime;
		
		function __construct($profile = 'portage') {
		
			global $hits;
			$hits['package_mask']++;
			
			$tree =& PortageTree::singleton();
		
			switch($profile) {
			
				case 'portage':
					$filename = 'package.mask';
					break;
			
			}
			
			$this->filename = $tree->getTree()."/profiles/$filename";
			$this->mtime = filemtime($this->filename);
		
		}
		
		function __get($var) {
			return $this->$var;
		}
		
		function getMaskedPackages() {
		
			$arr = file($this->filename, FILE_IGNORE_NEW_LINES);
			
			$arr = preg_grep("/(^#|^$)/", $arr, PREG_GREP_INVERT);
			
			sort($arr);
			
			return $arr;
		
		}
		
	}

?>