summaryrefslogtreecommitdiff
blob: c23d570cb586fd663062ebc4c8dafcd6d9c264eb (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
<?

	class PackageMask extends PortageTree {
	
		private $filename;
		private $mtime;
		
		function __construct($profile = 'portage') {
		
			parent::__construct();
		
			switch($profile) {
			
				case 'portage':
					$filename = 'package.mask';
					break;
			
			}
			
			$this->filename = $this->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;
		
		}
		
	}

?>