commit:     8f39978eb3940a96413b8405ae2dc199507e329d
Author:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 14 21:59:14 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sun Jun 15 00:36:41 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=8f39978e

Adds clean_tar configuration option

---
 doc/layman.8.txt       | 6 ++++++
 layman/config.py       | 3 ++-
 layman/overlays/tar.py | 2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/doc/layman.8.txt b/doc/layman.8.txt
index 0819570..3918d37 100644
--- a/doc/layman.8.txt
+++ b/doc/layman.8.txt
@@ -240,6 +240,12 @@ nocheck::
     Set to "yes" if *layman* should stop worrying about overlays
     with missing a contact address or the description.
 
+clean_tar::
+    Set to "yes" if *layman* will delete tar files downloaded
+    when installing tar overlays. 'Note':: This option is only
+    applicable to remote tar overlays. *layman* will leave the
+    reponsibility of deleting local tar files up to the user.
+    By default, *layman* will delete downloaded tar files.
 
 Per repository type Add, Sync options.
 

diff --git a/layman/config.py b/layman/config.py
index 31dc0ac..761dd57 100644
--- a/layman/config.py
+++ b/layman/config.py
@@ -107,6 +107,7 @@ class BareConfig(object):
             'auto_sync': 'No',
             'conf_type': 'make.conf',
             'require_repoconfig': 'Yes',
+            'clean_tar': 'yes',
             'make_conf' : '%(storage)s/make.conf',
             'repos_conf': '/etc/portage/repos.conf/layman.conf',
             'conf_module': ['make_conf', 'repos_conf'],
@@ -132,7 +133,7 @@ class BareConfig(object):
             'rsync_command': path([self.root, EPREFIX,'/usr/bin/rsync']),
             'svn_command': path([self.root, EPREFIX,'/usr/bin/svn']),
             'tar_command': path([self.root, EPREFIX,'/bin/tar']),
-            't/f_options': ['nocheck', 'require_repoconfig'],
+            't/f_options': ['clean_tar', 'nocheck', 'require_repoconfig'],
             'bzr_addopts' : '',
             'bzr_syncopts' : '',
             'cvs_addopts' : '',

diff --git a/layman/overlays/tar.py b/layman/overlays/tar.py
index e5d10b6..4999e20 100644
--- a/layman/overlays/tar.py
+++ b/layman/overlays/tar.py
@@ -99,7 +99,7 @@ class TarOverlay(OverlaySource):
 
     def _extract(self, base, tar_url, dest_dir):
         ext = '.tar.noidea'
-        clean_tar = True
+        clean_tar = self.config['clean_tar']
         for i in [('tar.%s' % e) for e in ('bz2', 'gz', 'lzma', 'xz', 'Z')] \
                 + ['tgz', 'tbz', 'taz', 'tlz', 'txz']:
             candidate_ext = '.%s' % i

Reply via email to