diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2013-06-02 23:06:26 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2013-06-02 23:06:26 -0400 |
commit | 2bbd8701472ae6405893a35ba4405b529fdb7e79 (patch) | |
tree | 6421668b81d4fe3dcf3befa0492b0629ba377327 /ipsutils/tasks.py | |
parent | b7917be3ae68f15e6cb4b9c51b2a48b7f32123b3 (diff) | |
download | ipsutils-2bbd8701472ae6405893a35ba4405b529fdb7e79.tar.gz |
pkglint integration complete
Diffstat (limited to 'ipsutils/tasks.py')
-rw-r--r-- | ipsutils/tasks.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/ipsutils/tasks.py b/ipsutils/tasks.py index a48dea0..b333996 100644 --- a/ipsutils/tasks.py +++ b/ipsutils/tasks.py @@ -7,6 +7,45 @@ import subprocess import sys
import tempfile
+
+class Lint(task.Task):
+ def __init__(self, *args, **kwargs):
+ super(Lint, self).__init__(self, *args, **kwargs)
+ self.name = "Package LINT checking (this may take a while...)"
+ self.cachedir = os.path.join(os.environ['HOME'], '.ipscache')
+
+ def _check_cache(self):
+ if not os.path.exists(self.cachedir):
+ print("Creating cache directory: {0:s}".format(self.cachedir))
+ os.mkdir(self.cachedir)
+ return False
+ return True
+
+ def _create_cache(self):
+ command_pkg = [self.cls.tool['pkglint'],
+ '-c',
+ self.cachedir,
+ '-r',
+ 'http://pkg.oracle.com/solaris/release/',
+ self.cls.env_meta['STAGE4']]
+ print("Creating cache (this may take a while...)")
+ proc_pkg = subprocess.Popen(command_pkg, stderr=subprocess.STDOUT)
+ err = proc_pkg.wait()
+ return err
+
+ def task(self):
+ if not self._check_cache():
+ self._create_cache()
+
+ command_pkg = [self.cls.tool['pkglint'],
+ '-c',
+ self.cachedir,
+ self.cls.env_meta['STAGE4']]
+ proc_pkg = subprocess.Popen(command_pkg, stderr=subprocess.STDOUT)
+ err = proc_pkg.wait()
+ return err
+
+
class Resolve_Dependencies(task.Task):
def __init__(self, *args, **kwargs):
super(Resolve_Dependencies, self).__init__(self, *args, **kwargs)
|