[gentoo-commits] repo/gentoo:master commit in: app-admin/webapp-config/

2017-06-23 Thread Devan Franchini
commit: 751d08074a9bced1d23e34ebb50b7ebdc70d60c2
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Jun 24 03:57:31 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Jun 24 03:59:08 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=751d0807

app-admin/webapp-config: Removes configparser blocker from 1.55

With the addition of a fix in commit dfacbd61 in webapp-config's
repo we no longer need to block on this package from installation

X-Gentoo-Bug: 622504
X-Gentoo-Bug-URL: https://bugs.gentoo.org/622504

Package-Manager: Portage-2.3.6, Repoman-2.3.1

 app-admin/webapp-config/webapp-config-1.55.ebuild | 1 -
 1 file changed, 1 deletion(-)

diff --git a/app-admin/webapp-config/webapp-config-1.55.ebuild 
b/app-admin/webapp-config/webapp-config-1.55.ebuild
index d1f94e21cf1..0082013b860 100644
--- a/app-admin/webapp-config/webapp-config-1.55.ebuild
+++ b/app-admin/webapp-config/webapp-config-1.55.ebuild
@@ -18,7 +18,6 @@ SLOT="0"
 IUSE="+portage"
 
 DEPEND="app-text/xmlto
-   !dev-python/configparser
sys-apps/gentoo-functions"
 RDEPEND="portage? ( sys-apps/portage[${PYTHON_USEDEP}] )"
 



[gentoo-commits] repo/gentoo:master commit in: app-admin/webapp-config/

2017-06-23 Thread Devan Franchini
commit: 7922d766deb16875368fd03e344d49923e981754
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Jun 24 03:49:38 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Jun 24 03:59:07 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7922d766

app-admin/webapp-config: Removes configparser blocker from 

This is no longer necessary as the reason for doing so was resolved
by commit dfacbd61 in webapp-config's git repo

X-Gentoo-Bug: 622504
X-Gentoo-Bug-URL: https://bugs.gentoo.org/622504

Package-Manager: Portage-2.3.6, Repoman-2.3.1

 app-admin/webapp-config/webapp-config-.ebuild | 1 -
 1 file changed, 1 deletion(-)

diff --git a/app-admin/webapp-config/webapp-config-.ebuild 
b/app-admin/webapp-config/webapp-config-.ebuild
index 92e931ab791..409c9b0d9b1 100644
--- a/app-admin/webapp-config/webapp-config-.ebuild
+++ b/app-admin/webapp-config/webapp-config-.ebuild
@@ -25,7 +25,6 @@ SLOT="0"
 IUSE="+portage"
 
 DEPEND="app-text/xmlto
-   !dev-python/configparser
sys-apps/gentoo-functions"
 RDEPEND="portage? ( sys-apps/portage[${PYTHON_USEDEP}] )"
 



[gentoo-commits] proj/layman:master commit in: pm_plugins/portage/sync/modules/laymansync/

2017-06-22 Thread Devan Franchini
commit: 22e1bd138dbcf32ca50f9659c9d847fdae11a5f0
Author: Zac Medico  gentoo  org>
AuthorDate: Sun Apr  9 21:54:17 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Fri Jun 23 00:05:40 2017 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=22e1bd13

pm_plugins/portage: drop portage._native_kwargs usage (bug 613936)

The portage._native_kwargs function is not available since
portage-2.3.0.

X-Gentoo-Bug: 613936
X-Gentoo-Bug-URL: https://bugs.gentoo.org/613936

 pm_plugins/portage/sync/modules/laymansync/subproc.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pm_plugins/portage/sync/modules/laymansync/subproc.py 
b/pm_plugins/portage/sync/modules/laymansync/subproc.py
index 1166841..477bb46 100644
--- a/pm_plugins/portage/sync/modules/laymansync/subproc.py
+++ b/pm_plugins/portage/sync/modules/laymansync/subproc.py
@@ -72,7 +72,7 @@ class Layman(NewBase):
 
 exitcode = portage.process.spawn_bash("%(command)s" % \
 ({'command': command}),
-**portage._native_kwargs(self.spawn_kwargs))
+**self.spawn_kwargs)
 if exitcode != os.EX_OK:
 msg = "!!! layman add error in %(repo)s"\
 % ({'repo': self.repo.name})
@@ -111,7 +111,7 @@ class Layman(NewBase):
 command = ' '.join(args)
 exitcode = portage.process.spawn_bash("%(command)s" % \
 ({'command': command}),
-**portage._native_kwargs(self.spawn_kwargs))
+**self.spawn_kwargs)
 
 if exitcode != os.EX_OK:
 exitcode = self.new()[0]



[gentoo-commits] repo/gentoo:master commit in: app-admin/webapp-config/

2017-06-22 Thread Devan Franchini
commit: bc687464acfaadd0c8dbde354f7d5d1d1f1f7d31
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Jun 22 23:31:18 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Jun 22 23:33:11 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc687464

app-admin/webapp-config: Adds 1.55 ebuild to the tree

Package-Manager: Portage-2.3.6, Repoman-2.3.1

 app-admin/webapp-config/Manifest  |  1 +
 app-admin/webapp-config/webapp-config-1.55.ebuild | 66 +++
 2 files changed, 67 insertions(+)

diff --git a/app-admin/webapp-config/Manifest b/app-admin/webapp-config/Manifest
index 4c6c0ac1933..49de5cd1bdf 100644
--- a/app-admin/webapp-config/Manifest
+++ b/app-admin/webapp-config/Manifest
@@ -1,3 +1,4 @@
 DIST webapp-config-1.52.tar.bz2 62951 SHA256 
b8295bbc518f68f60913fe2ee9232d77f1a10e21fcddffb8c4370546ba96a2a5 SHA512 
ec616067588e6ab306af067e70bab9d17961aa675f387ee67a2291235ce81638b49a784d9a6c31891b7c78a712f276c3e62c6681a5e496a52c7e6fe7753922ea
 WHIRLPOOL 
ca6484871e26acff6d14510a4a925672258f58c1c8c05c5207b78350b1cc787e29c6ea68c1af05b5c5aaebed12ce545e023f54acbdc7215678b30a2f14708eee
 DIST webapp-config-1.53.tar.bz2 63429 SHA256 
4d45b1452feb730cc55bfdce686277183acfd64ab6aef5fab82992d1a508263d SHA512 
7d2fc7197d537f2264c26b68b61e69273d2fcd3eec93657db54ba685c8383e7b8245cf05ed2ddd8b72453bf3fbf8f4bc4867e53d608331799df2e6162be14820
 WHIRLPOOL 
f12ca0f3fcee31de6e2ead3cd3685fa32c697d258324bf40fc2bfc2f1787c4e7cbd7290bbb5f5523515bff29cb78bece35fcad390e419cf5dd619e5efdafc1dc
 DIST webapp-config-1.54.tar.bz2 58954 SHA256 
7663c4f7ae0d4e7206e349f3bf79fed479c9971365363929f431c92ebd622d17 SHA512 
fa61e88696eaed130575e5ae9a17ec827aa14aece359e5ba43fa723ad00083def22e44fb02d99fc5ba6000a5949c5ce7aecea9307d2bfae333e202ef111dcd31
 WHIRLPOOL 
417944147e0bdc7eb1575b10102230306f6c76652beeb0e2866d0fbe41b12bcdeb31421dd7551961db55f4fe4544ca5600c072cb74083621745c7c74fbfeec2e
+DIST webapp-config-1.55.tar.bz2 72583 SHA256 
222c41ac71b2991b078352fb8d09a0d458ff30b9c9729a2429165835c38c564b SHA512 
44294b276fd036908438cd984ebf70433639caa18d8330bab348433b4f39ea2c42c57fa8de4f0a6198f7875429a3ef9ebe61321c288d910f9be8b3414865f438
 WHIRLPOOL 
80d577e4398f6872129544221d58003beb5b5ce972c181a241ec96cfe0fe34975e7bef5a96acc40977320ad71cd4370ee58216c0517d78c1765f000a42d8ea56

diff --git a/app-admin/webapp-config/webapp-config-1.55.ebuild 
b/app-admin/webapp-config/webapp-config-1.55.ebuild
new file mode 100644
index 000..d1f94e21cf1
--- /dev/null
+++ b/app-admin/webapp-config/webapp-config-1.55.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} pypy )
+
+inherit distutils-r1 prefix
+
+SRC_URI="https://dev.gentoo.org/~twitch153/${PN}/${P}.tar.bz2;
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 
~sh ~sparc ~x86 ~x86-fbsd"
+
+DESCRIPTION="Gentoo's installer for web-based applications"
+HOMEPAGE="https://sourceforge.net/projects/webapp-config/;
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="+portage"
+
+DEPEND="app-text/xmlto
+   !dev-python/configparser
+   sys-apps/gentoo-functions"
+RDEPEND="portage? ( sys-apps/portage[${PYTHON_USEDEP}] )"
+
+python_prepare_all() {
+   distutils-r1_python_prepare_all
+   eprefixify WebappConfig/eprefix.py config/webapp-config
+}
+
+python_compile_all() {
+   emake -C doc/
+}
+
+python_install() {
+   # According to this discussion:
+   # 
http://mail.python.org/pipermail/distutils-sig/2004-February/003713.html
+   # distutils does not provide for specifying two different script install
+   # locations. Since we only install one script here the following should
+   # be ok
+   distutils-r1_python_install --install-scripts="${EPREFIX}/usr/sbin"
+}
+
+python_install_all() {
+   distutils-r1_python_install_all
+
+   insinto /etc/vhosts
+   doins config/webapp-config
+
+   keepdir /usr/share/webapps
+   keepdir /var/db/webapps
+
+   dodoc AUTHORS
+   doman doc/*.[58]
+   dohtml doc/*.[58].html
+}
+
+python_test() {
+   PYTHONPATH="." "${PYTHON}" WebappConfig/tests/external.py \
+   || die "Testing failed with ${EPYTHON}"
+}
+
+pkg_postinst() {
+   elog "Now that you have upgraded webapp-config, you **must** update 
your"
+   elog "config files in /etc/vhosts/webapp-config before you emerge any"
+   elog "packages that use webapp-config."
+}



[gentoo-commits] repo/gentoo:master commit in: app-admin/webapp-config/

2017-06-22 Thread Devan Franchini
commit: 2ae9900b7310a643423546b3ee3bb847c55ffefe
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Jun 22 23:26:56 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Jun 22 23:33:09 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ae9900b

app-admin/webapp-config: Deletes 1.54-r1 ebuild

 .../webapp-config/webapp-config-1.54-r1.ebuild | 64 --
 1 file changed, 64 deletions(-)

diff --git a/app-admin/webapp-config/webapp-config-1.54-r1.ebuild 
b/app-admin/webapp-config/webapp-config-1.54-r1.ebuild
deleted file mode 100644
index 2141c27bac3..000
--- a/app-admin/webapp-config/webapp-config-1.54-r1.ebuild
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-
-PYTHON_COMPAT=( python{2_7,3_4,3_5} pypy )
-
-inherit distutils-r1
-
-SRC_URI="https://dev.gentoo.org/~twitch153/${PN}/${P}.tar.bz2;
-KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh 
sparc x86 ~x86-fbsd"
-
-DESCRIPTION="Gentoo's installer for web-based applications"
-HOMEPAGE="https://sourceforge.net/projects/webapp-config/;
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="+portage"
-
-DEPEND="app-text/xmlto
-   sys-apps/gentoo-functions"
-RDEPEND="portage? ( sys-apps/portage[${PYTHON_USEDEP}] )"
-
-python_prepare() {
-   epatch "${FILESDIR}/${P}-pvr-check.patch"
-}
-python_compile_all() {
-   emake -C doc/
-}
-
-python_install() {
-   # According to this discussion:
-   # 
http://mail.python.org/pipermail/distutils-sig/2004-February/003713.html
-   # distutils does not provide for specifying two different script install
-   # locations. Since we only install one script here the following should
-   # be ok
-   distutils-r1_python_install --install-scripts="${EPREFIX}/usr/sbin"
-}
-
-python_install_all() {
-   distutils-r1_python_install_all
-
-   insinto /etc/vhosts
-   doins config/webapp-config
-
-   keepdir /usr/share/webapps
-   keepdir /var/db/webapps
-
-   dodoc AUTHORS
-   doman doc/*.[58]
-   dohtml doc/*.[58].html
-}
-
-python_test() {
-   PYTHONPATH="." "${PYTHON}" WebappConfig/tests/external.py \
-   || die "Testing failed with ${EPYTHON}"
-}
-
-pkg_postinst() {
-   elog "webapp-config now requires that all -I/-U/-C commands be followed"
-   elog "by the package name and package version of the webapp"
-   elog "eg.) 'webapp-config -d drupal -I drupal 8.0.0_beta10'"
-   elog "See 'man 8 webapp-config' for more information"
-}



[gentoo-commits] proj/webapp-config:master commit in: config/, WebappConfig/

2017-06-22 Thread Devan Franchini
commit: b68584681207baa80012345d2800764b1b338dfb
Author: Vladimir Pavljuchenkov (SpiderX)  spiderx  dp 
 ua>
AuthorDate: Mon Jan  9 09:31:54 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Mon Jan  9 09:31:54 2017 +
URL:https://gitweb.gentoo.org/proj/webapp-config.git/commit/?id=b6858468

Adds uWSGI server support

 WebappConfig/config.py |  3 ++-
 WebappConfig/server.py | 13 -
 config/webapp-config   |  1 +
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/WebappConfig/config.py b/WebappConfig/config.py
index 3a176a0..c66d146 100644
--- a/WebappConfig/config.py
+++ b/WebappConfig/config.py
@@ -1581,7 +1581,8 @@ class Config:
'cherokee' : WebappConfig.server.Cherokee,
'nginx': WebappConfig.server.Nginx,
'gatling'  : WebappConfig.server.Gatling,
-   'tracd': WebappConfig.server.Tracd,}
+   'tracd': WebappConfig.server.Tracd,
+   'uwsgi': WebappConfig.server.uWSGI,}
 
 
 server = self.config.get('USER', 'vhost_server')

diff --git a/WebappConfig/server.py b/WebappConfig/server.py
index ec9c141..a458505 100644
--- a/WebappConfig/server.py
+++ b/WebappConfig/server.py
@@ -366,6 +366,16 @@ class Tracd(Basic):
 self.vhost_server_uid = get_user('tracd')
 self.vhost_server_gid = get_group('tracd')
 
+class uWSGI(Basic):
+
+name   = 'uWSGI'
+desc   = 'supports installation on uWSGI'
+dep= 'www-servers/uwsgi'
+
+def set_server_user(self):
+self.vhost_server_uid = get_user('uwsgi')
+self.vhost_server_gid = get_group('uwsgi')
+
 def listservers():
 
 OUT.notice('\n'.join(['apache',
@@ -373,4 +383,5 @@ def listservers():
   'cherokee',
   'nginx',
   'gatling',
-  'tracd',]))
+  'tracd',
+  'uwsgi',]))

diff --git a/config/webapp-config b/config/webapp-config
index da01bc6..e8d1d8a 100755
--- a/config/webapp-config
+++ b/config/webapp-config
@@ -70,6 +70,7 @@ vhost_hostname="localhost"
 # nginx
 # gatling
 # tracd
+# uwsgi
 
 #
 # you can override this setting by using the -s switch to webapp-config



[gentoo-commits] proj/webapp-config:master commit in: WebappConfig/

2017-06-22 Thread Devan Franchini
commit: 55b6d681dd3df9954094a5fc3732c391e9544036
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Jun 22 23:01:12 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Jun 22 23:04:31 2017 +
URL:https://gitweb.gentoo.org/proj/webapp-config.git/commit/?id=55b6d681

version.py: Updates version number

 WebappConfig/version.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/WebappConfig/version.py b/WebappConfig/version.py
index f52527b..e41cb0c 100644
--- a/WebappConfig/version.py
+++ b/WebappConfig/version.py
@@ -13,7 +13,7 @@
 #
 # 
 
-WCVERSION = '1.54-git'
+WCVERSION = '1.55-git'
 
 if __name__ == '__main__':
 print(WCVERSION)



[gentoo-commits] proj/webapp-config:master commit in: /

2017-06-22 Thread Devan Franchini
commit: 8bb88ecdc7b98469e21f68159c80f31f610d6f0e
Author: Devan Franchini  gmail  com>
AuthorDate: Tue May 23 00:44:11 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Tue May 23 00:44:11 2017 +
URL:https://gitweb.gentoo.org/proj/webapp-config.git/commit/?id=8bb88ecd

Merge pull request #6 from SpiderX/master

Adds uWSGI server support

 WebappConfig/config.py |  3 ++-
 WebappConfig/server.py | 13 -
 config/webapp-config   |  1 +
 3 files changed, 15 insertions(+), 2 deletions(-)



[gentoo-commits] repo/gentoo:master commit in: app-admin/webapp-config/

2017-02-15 Thread Devan Franchini
commit: 1cb9280dbf9aa945a3c28cc6d55bde68014002f4
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Feb 16 03:28:54 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Feb 16 03:28:54 2017 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1cb9280d

app-admin/webapp-config-.ebuild: Makes use of prefix eclass

X-Gentoo-Bug: 608018
X-Gentoo-Bug-URL: https://bugs.gentoo.org/608018

Package-Manager: portage-2.3.3

 app-admin/webapp-config/webapp-config-.ebuild | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/app-admin/webapp-config/webapp-config-.ebuild 
b/app-admin/webapp-config/webapp-config-.ebuild
index 2d1d3c7ad8..a1b3ec2550 100644
--- a/app-admin/webapp-config/webapp-config-.ebuild
+++ b/app-admin/webapp-config/webapp-config-.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -6,7 +6,7 @@ EAPI="5"
 
 PYTHON_COMPAT=( python{2_7,3_4,3_5} pypy )
 
-inherit distutils-r1
+inherit distutils-r1 prefix
 
 if [[ ${PV} = * ]]
 then
@@ -30,6 +30,11 @@ DEPEND="app-text/xmlto
sys-apps/gentoo-functions"
 RDEPEND="portage? ( sys-apps/portage[${PYTHON_USEDEP}] )"
 
+python_prepare_all() {
+   distutils-r1_python_prepare_all
+   eprefixify WebappConfig/eprefix.py config/webapp-config
+}
+
 python_compile_all() {
emake -C doc/
 }
@@ -40,7 +45,7 @@ python_install() {
# distutils does not provide for specifying two different script install
# locations. Since we only install one script here the following should
# be ok
-   distutils-r1_python_install --install-scripts="/usr/sbin"
+   distutils-r1_python_install --install-scripts="${EPREFIX}/usr/sbin"
 }
 
 python_install_all() {



[gentoo-commits] proj/webapp-config:master commit in: config/

2017-02-15 Thread Devan Franchini
commit: 2d7c1898599132bba48c8f38ae7c916d9dc65943
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Feb 16 03:07:30 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Feb 16 03:07:34 2017 +
URL:https://gitweb.gentoo.org/proj/webapp-config.git/commit/?id=2d7c1898

config/webapp-config: Updates config to use eprefix

X-Gentoo-Bug: 608018
X-Gentoo-Bug-URL: https://bugs.gentoo.org/608018

 config/webapp-config | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/config/webapp-config b/config/webapp-config
index da01bc6..e3778fd 100755
--- a/config/webapp-config
+++ b/config/webapp-config
@@ -42,9 +42,9 @@
 # If you want to have fine grained control over the location the web
 # applications get installed, you can use the third setting
 
-vhost_root="/var/www/${vhost_hostname}"
-#vhost_root="/srv/${vhost_hostname}/www"
-#vhost_root="/var/www/${vhost_subdomain_1}/${vhost_subdomain_2}/${vhost_subdomain_3}"
+vhost_root="@GENTOO_PORTAGE_EPREFIX@/var/www/${vhost_hostname}"
+#vhost_root="@GENTOO_PORTAGE_EPREFIX@/srv/${vhost_hostname}/www"
+#vhost_root="@GENTOO_PORTAGE_EPREFIX@/var/www/${vhost_subdomain_1}/${vhost_subdomain_2}/${vhost_subdomain_3}"
 
 # some web applications need to know what host they are serving up pages
 # for.  this information is configured when the application is installed



[gentoo-commits] proj/webapp-config:master commit in: WebappConfig/

2017-02-15 Thread Devan Franchini
commit: 62e968d5456f773042d66456c4f87334c3d48709
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Feb 16 02:48:17 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Feb 16 03:03:34 2017 +
URL:https://gitweb.gentoo.org/proj/webapp-config.git/commit/?id=62e968d5

db.py: Uses EPREFIX variable

X-Gentoo-Bug: 608018
X-Gentoo-Bug-URL: https://bugs.gentoo.org/608018

 WebappConfig/db.py | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/WebappConfig/db.py b/WebappConfig/db.py
index 0fbd34a..698c49a 100644
--- a/WebappConfig/db.py
+++ b/WebappConfig/db.py
@@ -26,6 +26,7 @@ import time, os, os.path, re
 import WebappConfig.wrapper as wrapper
 
 from WebappConfig.debug   import OUT
+from WebappConfig.eprefix import EPREFIX
 from WebappConfig.permissions import PermissionMap
 
 
@@ -166,7 +167,7 @@ class WebappDB(AppHierarchy):
 
 def __init__(self,
  fs_root= '/',
- root   = '/var/db/webapps',
+ root   = EPREFIX + '/var/db/webapps',
  category   = '',
  package= '',
  version= '',
@@ -416,8 +417,8 @@ class WebappSource(AppHierarchy):
 '''
 
 def __init__(self,
- fs_root= '/',
- root   = '/usr/share/webapps',
+ fs_root= EPREFIX + '/',
+ root   = EPREFIX + '/usr/share/webapps',
  category   = '',
  package= '',
  version= '',



[gentoo-commits] proj/webapp-config:master commit in: WebappConfig/

2017-02-15 Thread Devan Franchini
commit: 192ab96f59acd4f7ddc634a49e9077f8c8aeda94
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Feb 16 02:48:03 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Feb 16 03:03:14 2017 +
URL:https://gitweb.gentoo.org/proj/webapp-config.git/commit/?id=192ab96f

config.py: Uses EPREFIX variable

X-Gentoo-Bug: 608018
X-Gentoo-Bug-URL: https://bugs.gentoo.org/608018

 WebappConfig/config.py | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/WebappConfig/config.py b/WebappConfig/config.py
index 3a176a0..2c11d39 100644
--- a/WebappConfig/config.py
+++ b/WebappConfig/config.py
@@ -37,10 +37,12 @@ import WebappConfig.wrapper as wrapper
 
 from argparse import ArgumentParser
 from WebappConfig.debug   import OUT
+from WebappConfig.eprefix import EPREFIX
 from WebappConfig.version import WCVERSION
 
 from WebappConfig.permissions import PermissionMap
 
+
 # 
 # BashParser class
 # 
@@ -223,14 +225,14 @@ class Config:
 self.__d = {
 'config_protect'   : '',
 # Necessary to load the config file
-'my_etcconfig' : '/etc/vhosts/webapp-config',
+'my_etcconfig' : EPREFIX + 
'/etc/vhosts/webapp-config',
 'my_dotconfig' : '.webapp',
 'my_version'   : WCVERSION,
 'my_conf_version'  : '7',
 'my_bugsurl'   : wrapper.bugs_link,
 'g_myname' : sys.argv[0],
-'g_orig_installdir': '/',
-'g_installdir' : '/',
+'g_orig_installdir': EPREFIX + '/',
+'g_installdir' : EPREFIX + '/',
 'g_link_options'   : '',
 'g_link_type'  : 'hard',
 'g_configprefix'   : '._cfg',
@@ -265,9 +267,9 @@ class Config:
 # -- wrobel
 'vhost_server_uid'  : 'root',
 'vhost_server_gid'  : 'root',
-'my_persistroot': '/var/db/webapps',
+'my_persistroot': EPREFIX + '/var/db/webapps',
 'wa_installsbase'   : 'installs',
-'vhost_root': '/var/www/${vhost_hostname}',
+'vhost_root': EPREFIX + '/var/www/${vhost_hostname}',
 'g_htdocsdir'   : '${vhost_root}/${my_htdocsbase}',
 'my_appdir' : '${my_approot}/${my_appsuffix}',
 'my_htdocsdir'  : '${my_appdir}/htdocs',
@@ -277,7 +279,7 @@ class Config:
 'my_iconsdir'   : '${my_hostrootdir}/${my_iconsbase}',
 'my_errorsdir'  : '${my_hostrootdir}/${my_errorsbase}',
 'g_cgibindir'  : '${vhost_root}/${my_cgibinbase}',
-'my_approot': '/usr/share/webapps',
+'my_approot': EPREFIX + '/usr/share/webapps',
 'package_manager'   : 'portage',
 'allow_absolute': 'no',
 'my_hostrootbase'   : 'hostroot',



[gentoo-commits] proj/webapp-config:master commit in: WebappConfig/

2017-02-15 Thread Devan Franchini
commit: e9b6ef7e44c9bd9c940b60854490a894617fb3ed
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Feb 16 02:46:55 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Feb 16 02:47:37 2017 +
URL:https://gitweb.gentoo.org/proj/webapp-config.git/commit/?id=e9b6ef7e

eprefix.py: Adds EPREFIX variable to import in other places

X-Gentoo-Bug: 608018
X-Gentoo-Bug-URL: https://bugs.gentoo.org/608018

 WebappConfig/eprefix.py | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/WebappConfig/eprefix.py b/WebappConfig/eprefix.py
new file mode 100644
index 000..7d5bd66
--- /dev/null
+++ b/WebappConfig/eprefix.py
@@ -0,0 +1,6 @@
+# Establish the eprefix, initially set so eprefixify can
+# set it on install
+EPREFIX = "@GENTOO_PORTAGE_EPREFIX@"
+# Check and set it if it wasn't
+if "GENTOO_PORTAGE_EPREFIX" in EPREFIX:
+EPREFIX = ''



[gentoo-commits] proj/webapp-config:master commit in: WebappConfig/

2017-02-15 Thread Devan Franchini
commit: af52e7cfec44828b3722f484f3ed4c0ee4fd22d8
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Feb 16 03:02:44 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Feb 16 03:03:45 2017 +
URL:https://gitweb.gentoo.org/proj/webapp-config.git/commit/?id=af52e7cf

server.py: Uses EPREFIX variable

X-Gentoo-Bug: 608018
X-Gentoo-Bug-URL: https://bugs.gentoo.org/608018

 WebappConfig/server.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/WebappConfig/server.py b/WebappConfig/server.py
index ec9c141..4c3b571 100644
--- a/WebappConfig/server.py
+++ b/WebappConfig/server.py
@@ -22,6 +22,7 @@
 import os, os.path
 
 from WebappConfig.debugimport OUT
+from WebappConfig.eprefix  import EPREFIX
 from WebappConfig.worker   import WebappRemove, WebappAdd
 from WebappConfig.permissions  import get_group, get_user
 
@@ -195,7 +196,7 @@ class Basic:
 dir = self.__destd
 dirs = []
 
-while dir != '/':
+while dir != EPREFIX + '/':
 dirs.insert(0, dir)
 dir = os.path.dirname(dir)
 



[gentoo-commits] proj/layman:master commit in: layman/

2017-02-01 Thread Devan Franchini
commit: fc23ec8246c2700111cbf8f4a4eb55ac4a5eb000
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Feb  2 00:47:27 2017 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Feb  2 00:47:33 2017 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=fc23ec82

argparser.py: Fixed typo in --help output

Thank you dewey for pointing this out.

 layman/argsparser.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layman/argsparser.py b/layman/argsparser.py
index f3cc8fa..272ac47 100644
--- a/layman/argsparser.py
+++ b/layman/argsparser.py
@@ -193,7 +193,7 @@ class ArgsParser(BareConfig):
action = 'store',
default = self.defaults['overlay_defs'],
# Force interpolation (to prevent argparse 
tracebacks)
-   help = 'Path to aditional overlay.xml files 
[default: '
+   help = 'Path to additional overlay.xml files 
[default: '
'%s].' % (self.defaults['overlay_defs'] 
%self.defaults))
 
 path_opts.add_argument('-z',



[gentoo-commits] proj/layman:master commit in: layman/

2016-11-09 Thread Devan Franchini
commit: 7d1a6df6514991adeaa6deeb5d710354967bcc8c
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Nov 10 02:49:06 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Nov 10 02:49:35 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=7d1a6df6

utils.py: Removes catching KeyboardInterrupt

As per bug 539336 it's near impossible to kill a stampeding layman
process. This was due to the run_command() function which caught
the KeyboardInterrupt exception.

 layman/utils.py | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/layman/utils.py b/layman/utils.py
index 9530701..c008530 100644
--- a/layman/utils.py
+++ b/layman/utils.py
@@ -270,9 +270,6 @@ def run_command(config, command, args, **kwargs):
 
 try:
 result = proc.wait()
-except KeyboardInterrupt:
-output.info('Interrupted manually', 2)
-result = 1
 except Exception as err:
 output.error(
 'Unknown exception running command: %s' % command_repr)



[gentoo-commits] proj/layman:master commit in: bin/

2016-11-09 Thread Devan Franchini
commit: 75899bb9d56f9125fc1bda496eb0e8ff9c2b6e72
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Nov 10 02:57:51 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Nov 10 02:57:54 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=75899bb9

bin/layman: Adds exception handling on ^c bug 539336

 bin/layman | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/layman b/bin/layman
index ba91c20..fbb793b 100755
--- a/bin/layman
+++ b/bin/layman
@@ -42,4 +42,7 @@ except KeyError:
 pass
 
 main = Main(ArgsParser(root=root))
-main()
+try:
+main()
+except KeyboardInterrupt:
+print('Interrupt received, exiting...')



[gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/

2016-06-24 Thread Devan Franchini
commit: 7318d367fb3a59f0ba696921b3513fedf28b751f
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Jun 25 02:20:01 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Jun 25 02:29:16 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7318d367

games-emulation/dolphin: Updates package version to reflect new release

Package-Manager: portage-2.3.0

 games-emulation/dolphin/Manifest   |   2 +-
 games-emulation/dolphin/dolphin-5.0.ebuild | 106 -
 2 files changed, 74 insertions(+), 34 deletions(-)

diff --git a/games-emulation/dolphin/Manifest b/games-emulation/dolphin/Manifest
index 2cc1c50..1cc674f 100644
--- a/games-emulation/dolphin/Manifest
+++ b/games-emulation/dolphin/Manifest
@@ -1 +1 @@
-DIST dolphin-5.0.zip 28317729 SHA256 
2b1003360d52baf12a1bcd4d75f379749b0fd4001948ec1a24d0539c37aae055 SHA512 
1b1c0dd6da4ba7e9ffe30499fae582b922c9bbd8b3d8159fbf9f4bfa1e744ef5b4c00a85d34f7cdd6e01efa32133f59b2a1f42cafc9d620f7fc7462c4ba73615
 WHIRLPOOL 
73cc25bafcb0d32592e8ad799b0a3d458cfa944ad15380a3b8f1cf27f3e024c314b08469a17f6d92edced95631bba38e39e1ccd625227c0520813abbd399e0f4
+DIST dolphin-5.0.zip 41802909 SHA256 
f8c26bdea7a8329873bd2c485676ba5cbc1670faad3fef98f1d516254b4dd3a1 SHA512 
36c4f371e066537331a9a8ec4a17befa278465cdebe258e1cbf1157752ba69bff9c1b8a6e8698bbb650aa257bd48b6b42ee9f61357904b09fd01738af8223d3a
 WHIRLPOOL 
401d569e1b45a8873a2f7879a5d9c931228767be909c9ddde43d49394a79580c2ae0eccc29757f471565ad0554cd20e57c371393526d68b2c79f8570a2e2bd5c

diff --git a/games-emulation/dolphin/dolphin-5.0.ebuild 
b/games-emulation/dolphin/dolphin-5.0.ebuild
index d7266c1..88cd984 100644
--- a/games-emulation/dolphin/dolphin-5.0.ebuild
+++ b/games-emulation/dolphin/dolphin-5.0.ebuild
@@ -4,11 +4,13 @@
 
 EAPI=5
 
+PLOCALES="ar ca cs da_DK de el en es fa fr hr hu it ja ko ms_MY nb nl pl pt 
pt_BR ro_RO ru sr sv tr zh_CN zh_TW"
+PLOCALE_BACKUP="en"
 WX_GTK_VER="3.0"
 
-inherit cmake-utils eutils pax-utils toolchain-funcs versionator wxwidgets 
games
+inherit cmake-utils eutils l10n pax-utils toolchain-funcs versionator wxwidgets
 
-SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${PV}-rc.zip -> ${P}.zip"
+SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${PV}.zip -> ${P}.zip"
 KEYWORDS="~amd64"
 
 DESCRIPTION="Gamecube and Wii game emulator"
@@ -16,35 +18,58 @@ HOMEPAGE="https://www.dolphin-emu.org/;
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="alsa ao bluetooth doc ffmpeg lto +lzo openal opengl openmp portaudio 
pulseaudio"
+IUSE="alsa ao bluetooth doc egl +evdev ffmpeg llvm log lto openal +pch 
portaudio profile pulseaudio qt5 sdl upnp +wxwidgets"
 
-S=${WORKDIR}/${P}-rc/
-RDEPEND=">=media-libs/glew-1.10
-   >=media-libs/libsfml-2.1
-   >=net-libs/miniupnpc-1.8
+RDEPEND=">=media-libs/libsfml-2.1
+   >net-libs/enet-1.3.7
+   >=net-libs/mbedtls-2.1.1
+   dev-libs/lzo
+   media-libs/libpng:=
+   sys-libs/glibc
sys-libs/readline:=
+   sys-libs/zlib
x11-libs/libXext
+   x11-libs/libXi
x11-libs/libXrandr
-   media-libs/libsdl2[haptic,joystick]
-   net-libs/polarssl[havege]
+   virtual/libusb:1
+   virtual/opengl
alsa? ( media-libs/alsa-lib )
ao? ( media-libs/libao )
bluetooth? ( net-wireless/bluez )
+   egl? ( media-libs/mesa[egl] )
+   evdev? (
+   dev-libs/libevdev
+   virtual/udev
+   )
ffmpeg? ( virtual/ffmpeg )
-   lzo? ( dev-libs/lzo )
-   openal? ( media-libs/openal )
-   opengl? ( virtual/opengl )
+   llvm? ( sys-devel/llvm )
+   openal? (
+   media-libs/openal
+   media-libs/libsoundtouch
+   )
portaudio? ( media-libs/portaudio )
+   profile? ( dev-util/oprofile )
pulseaudio? ( media-sound/pulseaudio )
+   qt5? (
+   dev-qt/qtcore:5
+   dev-qt/qtgui:5
+   dev-qt/qtwidgets:5
+   )
+   sdl? ( media-libs/libsdl2[haptic,joystick] )
+   upnp? ( >=net-libs/miniupnpc-1.7 )
+   wxwidgets? (
+   dev-libs/glib:2
+   x11-libs/gtk+:2
+   x11-libs/wxGTK:${WX_GTK_VER}[opengl,X]
+   )
"
 DEPEND="${RDEPEND}
+   >=dev-util/cmake-2.8.8
+   >=sys-devel/gcc-4.9.0
app-arch/zip
-   media-gfx/nvidia-cg-toolkit
media-libs/freetype
-   media-libs/libsoundtouch
-   >net-libs/enet-1.3.7
-   >=sys-devel/gcc-4.9.0
-   x11-libs/wxGTK:${WX_GTK_VER}
+   sys-devel/gettext
+   virtual/pkgconfig
"
 
 pkg_pretend() {
@@ -63,9 +88,6 @@ pkg_pretend() {
 
 src_prepare() {
 
-   epatch "${FILESDIR}"/"${P}"-dynamic-llvm

[gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/

2016-06-24 Thread Devan Franchini
commit: 0516d7c424145151ac5cb95dc4aad988e47e3045
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Jun 25 02:27:00 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Jun 25 02:30:53 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0516d7c4

games-emulation/dolphin: Updates locales and QT flag, bug #561914

Package-Manager: portage-2.3.0

 games-emulation/dolphin/dolphin-.ebuild | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/games-emulation/dolphin/dolphin-.ebuild 
b/games-emulation/dolphin/dolphin-.ebuild
index bb207fe..540052d 100644
--- a/games-emulation/dolphin/dolphin-.ebuild
+++ b/games-emulation/dolphin/dolphin-.ebuild
@@ -4,7 +4,7 @@
 
 EAPI=5
 
-PLOCALES="ar ca cs de el en es fa fr he hu it ja ko nb nl pl pt_BR pt ru sr sv 
tr zh_CN zh_TW"
+PLOCALES="ar ca cs da_DK de el en es fa fr hr hu it ja ko ms_MY nb nl pl pt_BR 
pt ro_RO ru sr sv tr zh_CN zh_TW"
 PLOCALE_BACKUP="en"
 WX_GTK_VER="3.0"
 
@@ -161,7 +161,7 @@ src_configure() {
$( cmake-utils_use_enable evdev EVDEV )
$( cmake-utils_use_enable lto LTO )
$( cmake-utils_use_enable pch PCH )
-   $( cmake-utils_use_enable qt5 QT )
+   $( cmake-utils_use_enable qt5 QT2 )
$( cmake-utils_use_enable sdl SDL )
$( cmake-utils_use_use egl EGL )
$( cmake-utils_use_use upnp UPNP )



[gentoo-commits] repo/gentoo:master commit in: app-portage/layman/

2016-05-09 Thread Devan Franchini
commit: b204f541fb5151950f76b4070d7e95d58a27f731
Author: Devan Franchini  gentoo  org>
AuthorDate: Tue May 10 00:26:53 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Tue May 10 00:28:41 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b204f541

Version bump to 2.4.1

Package-Manager: portage-2.2.27

 app-portage/layman/Manifest|  1 +
 app-portage/layman/layman-2.4.1.ebuild | 89 ++
 2 files changed, 90 insertions(+)

diff --git a/app-portage/layman/Manifest b/app-portage/layman/Manifest
index ffa4da6..416c82c 100644
--- a/app-portage/layman/Manifest
+++ b/app-portage/layman/Manifest
@@ -3,3 +3,4 @@ DIST layman-2.1.0.tar.gz 94150 SHA256 
cb96306c84da1d49ff54a31f7511c62c859565361b
 DIST layman-2.2.0.tar.gz 116210 SHA256 
4a10cfd3eb354e993886369995ae9b1243418e0370c6aabd4d0ef6c5b387b7a2 SHA512 
34cac041d7b64274debdbc42cab079fd3bb3aee511ea9e80db726df0f828207d79a5262788483ced5cbf49924e3aa4f19fe21439c98dceea973d8f83473c2e41
 WHIRLPOOL 
8c5d3cbbfef35c6294dfac899cb42f49e0761745573721e38b7d6c9ac48031f95bbb961c9d8dd9d309e4672cc1e5b050107ba025a9f28127e5d7d6d9a73a6e9a
 DIST layman-2.3.0.tar.gz 119223 SHA256 
76559b8e202c012d124deac01b92bbe70b550afe711144a3b1e301c5d8bbd0f2 SHA512 
d110fb1781017d87e995098ecb48c4223347323d67534b584a393dc4354b761a6d960fd31e6e6787b5f37fa7e63b357c49486042c7cb527f78dd5beb5373627d
 WHIRLPOOL 
76c82f08b18830e925ffd4c97b490753de2e7d0b3c71a82a0a75fd776ed3af84d2ba2fe06dab25e5e4d2ea400b0f0b66eda65f1f4eded0521ec579a1a0c1b17f
 DIST layman-2.4.0.tar.gz 130052 SHA256 
0dd9dbcd05b5bf062139308cb812507b2c3310dd81f25c9cdc4c8f643b3f74c8 SHA512 
011ac0e7dfed8415b875898ff1eecfe77ba5a68ccac208d8f5c693b9b880355ffef572490bb98ede62092bea1a84298bbd72e6c93a234fdfa319e96551e7eb07
 WHIRLPOOL 
0fdcd09ef4347f9450897237befd6fa73187a3e5ed0eff6b08345846ff270cd9751a3f38277f7b53baffb3b9a3e18e10f08ebe33c228ed7f7ccd01ce81d05a76
+DIST layman-2.4.1.tar.gz 130388 SHA256 
545792a15a0a2514c79f1b3090aceef15e413c656f294b6ff84f8a36da7aa2da SHA512 
bdb713d4c7d3773129b45a385068278958040759bb564e48cfda4dda9da5224ccaa7833fce3d06151ed1fecddbb6f1a059db6e71534d0e887dff12640af6c806
 WHIRLPOOL 
b6ef18f8f3633e9bb2a08df620306441f8352174dc66f2bbb68613cff0796e0914f7008de4f185167815ba3267c3b63a4fe22d2bcd794f70cd78bc20e706d7d8

diff --git a/app-portage/layman/layman-2.4.1.ebuild 
b/app-portage/layman/layman-2.4.1.ebuild
new file mode 100644
index 000..79dcd8c
--- /dev/null
+++ b/app-portage/layman/layman-2.4.1.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} pypy )
+PYTHON_REQ_USE="xml(+),sqlite?"
+
+inherit eutils distutils-r1 linux-info prefix
+
+DESCRIPTION="Tool to manage Gentoo overlays"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Layman;
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~s390 ~x86"
+IUSE="bazaar cvs darcs +git gpg g-sorcery mercurial sqlite squashfs subversion 
sync-plugin-portage test"
+
+DEPEND="test? ( dev-vcs/subversion )
+   "
+
+RDEPEND="
+   bazaar? ( dev-vcs/bzr )
+   cvs? ( dev-vcs/cvs )
+   darcs? ( dev-vcs/darcs )
+   git? ( dev-vcs/git )
+   mercurial? ( dev-vcs/mercurial )
+   g-sorcery? ( app-portage/g-sorcery )
+   subversion? (
+   || (
+   >=dev-vcs/subversion-1.5.4[http]
+   >=dev-vcs/subversion-1.5.4[webdav-neon]
+   >=dev-vcs/subversion-1.5.4[webdav-serf]
+   )
+   )
+   gpg? ( =dev-python/pyGPG-0.2 )
+   sync-plugin-portage?  ( >=sys-apps/portage-2.2.16[${PYTHON_USEDEP}] )
+   !sync-plugin-portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
+   >=dev-python/ssl-fetch-0.4[${PYTHON_USEDEP}]
+   "
+
+layman_check_kernel_config() {
+   local CONFIG_CHECK
+   use squashfs && CONFIG_CHECK+=" ~BLK_DEV_LOOP ~SQUASHFS"
+   [[ -n ${CONFIG_CHECK} ]] && check_extra_config
+}
+
+pkg_pretend() {
+   layman_check_kernel_config
+}
+
+pkg_setup() {
+   layman_check_kernel_config
+}
+
+python_prepare_all()  {
+   python_setup
+   esetup.py setup_plugins
+   distutils-r1_python_prepare_all
+   eprefixify etc/layman.cfg layman/config.py
+}
+
+python_test() {
+   suite=layman/tests/external.py
+   PYTHONPATH="." "${PYTHON}" ${suite} || die "test suite '${suite}' 
failed"
+   unset suite
+}
+
+python_install_all() {
+   distutils-r1_python_install_all
+
+   insinto /etc/layman
+   doins etc/layman.cfg
+
+   doman doc/layman.8
+   dohtml doc/layman.8.html
+
+   keepdir /var/lib/layman
+   keepdir /etc/layman/overlays
+}
+
+pkg_postinst() {
+   # now run layman's update utility
+   einfo "Running layman-updater..."
+   "${EROOT}"/usr/bin/layman-updater
+   einfo
+}



[gentoo-commits] proj/layman: New tag: 2.4.1

2016-05-09 Thread Devan Franchini
commit: 
Commit: Devan Franchini  gentoo  org>
CommitDate: Tue May 10 01:08:41 2016 +

New tag: 2.4.1




[gentoo-commits] proj/layman:master commit in: /, layman/

2016-05-09 Thread Devan Franchini
commit: 0b06cf1ccea9f9d56f9631eea1987a86abfb99a7
Author: Devan Franchini  gentoo  org>
AuthorDate: Tue May 10 00:02:31 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Tue May 10 00:02:31 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=0b06cf1c

Bumps version number to 2.4.1

 CHANGES   | 6 +-
 README| 2 +-
 layman/version.py | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/CHANGES b/CHANGES
index 15aaee8..c64007b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,11 @@
 CHANGES
 ---
 
-Version 2.4.0 - Release 2016-??-??
+Version 2.4.1 - Release 2016-05-06
+==
+ - adds sourcefile to plug-in modules, fixes bug #582154
+
+Version 2.4.0 - Release 2016-05-03
 ==
  - adds support for different overlay database types
  - adds json database support

diff --git a/README b/README
index f5763de..3e8e941 100644
--- a/README
+++ b/README
@@ -3,7 +3,7 @@ README
 ==
 
 :Last update:   Date: 2016-04-30
-:Revision:  2.4.0
+:Revision:  2.4.1
 :Contact:   Brian Dolbec <dol...@gentoo.org>
 
 

diff --git a/layman/version.py b/layman/version.py
index 1e1427f..c6d20cd 100644
--- a/layman/version.py
+++ b/layman/version.py
@@ -24,7 +24,7 @@ from __future__ import unicode_literals
 __version__ = "$Id: version.py 309 2007-04-09 16:23:38Z wrobel $"
 
 
-VERSION = '2.4.0'
+VERSION = '2.4.1'
 
 if __name__ == '__main__':
 print(VERSION)



[gentoo-commits] proj/layman:master commit in: layman/db_modules/json_db/, layman/overlays/modules/tar/, ...

2016-05-09 Thread Devan Franchini
commit: 63808ef00f94ad31d4291ebf5048da9348caa659
Author: Devan Franchini  gentoo  org>
AuthorDate: Mon May  9 23:14:34 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Mon May  9 23:28:46 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=63808ef0

Adds sourcefile var to inits for plug-in modules

X-Gentoo-Bug: 582154
X-Gentoo-Bug-URL: https://bugs.gentoo.org/582154

 layman/config_modules/makeconf/__init__.py|  1 +
 layman/config_modules/reposconf/__init__.py   |  1 +
 layman/db_modules/json_db/__init__.py |  1 +
 layman/db_modules/sqlite_db/__init__.py   |  1 +
 layman/db_modules/xml_db/__init__.py  |  1 +
 layman/module.py  | 10 +-
 layman/overlays/modules/bzr/__init__.py   |  1 +
 layman/overlays/modules/cvs/__init__.py   |  1 +
 layman/overlays/modules/darcs/__init__.py |  1 +
 layman/overlays/modules/g_sorcery/__init__.py |  1 +
 layman/overlays/modules/git/__init__.py   |  1 +
 layman/overlays/modules/mercurial/__init__.py |  1 +
 layman/overlays/modules/rsync/__init__.py |  1 +
 layman/overlays/modules/squashfs/__init__.py  |  1 +
 layman/overlays/modules/stub/__init__.py  |  1 +
 layman/overlays/modules/svn/__init__.py   |  1 +
 layman/overlays/modules/tar/__init__.py   |  1 +
 17 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/layman/config_modules/makeconf/__init__.py 
b/layman/config_modules/makeconf/__init__.py
index c385960..bec0661 100644
--- a/layman/config_modules/makeconf/__init__.py
+++ b/layman/config_modules/makeconf/__init__.py
@@ -12,6 +12,7 @@ module_spec = {
 'makeconf-module': {
 'name': 'makeconf',
 'class': 'ConfigHandler',
+'sourcefile': 'makeconf',
 'description': __doc__,
 'functions': ['add', 'delete', 'disable', 'enable', 'read',
   'update', 'write'],

diff --git a/layman/config_modules/reposconf/__init__.py 
b/layman/config_modules/reposconf/__init__.py
index f8f69bc..8528627 100644
--- a/layman/config_modules/reposconf/__init__.py
+++ b/layman/config_modules/reposconf/__init__.py
@@ -12,6 +12,7 @@ module_spec = {
 'reposconf-module': {
 'name': 'reposconf',
 'class': 'ConfigHandler',
+'sourcefile': 'reposconf',
 'description': __doc__,
 'functions': ['add', 'delete', 'disable', 'enable', 'read',
   'update', 'write'],

diff --git a/layman/db_modules/json_db/__init__.py 
b/layman/db_modules/json_db/__init__.py
index ac4daa7..5b91e58 100644
--- a/layman/db_modules/json_db/__init__.py
+++ b/layman/db_modules/json_db/__init__.py
@@ -12,6 +12,7 @@ module_spec = {
 'json-module': {
 'name': 'json_db',
 'class': 'DBHandler',
+'sourcefile': 'json_db',
 'description': __doc__,
 'functions': ['add_new', 'read_db', 'remove', 'write'],
 'func_desc': {

diff --git a/layman/db_modules/sqlite_db/__init__.py 
b/layman/db_modules/sqlite_db/__init__.py
index 536fc2d..a3678dc 100644
--- a/layman/db_modules/sqlite_db/__init__.py
+++ b/layman/db_modules/sqlite_db/__init__.py
@@ -12,6 +12,7 @@ module_spec = {
 'sqlite-module': {
 'name': 'sqlite_db',
 'class': 'DBHandler',
+'sourcefile': 'sqlite_db',
 'description': __doc__,
 'functions': ['add_new', 'read_db', 'remove', 'write'],
 'func_desc': {

diff --git a/layman/db_modules/xml_db/__init__.py 
b/layman/db_modules/xml_db/__init__.py
index c8a5bf9..f4bd13c 100644
--- a/layman/db_modules/xml_db/__init__.py
+++ b/layman/db_modules/xml_db/__init__.py
@@ -12,6 +12,7 @@ module_spec = {
 'xml-module': {
 'name': 'xml_db',
 'class': 'DBHandler',
+'sourcefile': 'xml_db',
 'description': __doc__,
 'functions': ['add_new', 'read_db', 'remove', 'write'],
 'func_desc': {

diff --git a/layman/module.py b/layman/module.py
index 99d243b..08bcbc2 100644
--- a/layman/module.py
+++ b/layman/module.py
@@ -48,7 +48,15 @@ class Module(object):
 for submodule in self.module_spec['provides']:
 kid = self.module_spec['provides'][submodule]
 kidname = kid['name']
-kid['module_name'] = '.'.join([mod_name, kidname])
+try:
+kid['module_name'] = '.'.join([mod_name, kidname])
+except ImportError:
+kid['module_name'] = '.'.join([mod_name, self.name])
+f = self.__module.__file__
+msg = 'Module.__initialize(); module spec is old, missing '\
+  'attribute: \'sourcefile\'.\nBackward compatibility '\
+  'may be removed in the future.\nFile: %(f)s' % {'f': f}
+self.output.warn(msg)
 kid['is_imported'] =

[gentoo-commits] repo/gentoo:master commit in: app-portage/layman/

2016-05-01 Thread Devan Franchini
commit: 69066223b400bc436272e556a4978c68ed5ad504
Author: Devan Franchini  gentoo  org>
AuthorDate: Mon May  2 03:57:38 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Mon May  2 03:58:26 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69066223

Creating new ebuild for layman-2.4.0 release

Package-Manager: portage-2.2.27

 app-portage/layman/Manifest|  1 +
 app-portage/layman/layman-2.4.0.ebuild | 89 ++
 app-portage/layman/metadata.xml|  4 +-
 3 files changed, 92 insertions(+), 2 deletions(-)

diff --git a/app-portage/layman/Manifest b/app-portage/layman/Manifest
index 6e91462..ffa4da6 100644
--- a/app-portage/layman/Manifest
+++ b/app-portage/layman/Manifest
@@ -2,3 +2,4 @@ DIST layman-2.0.0.tar.gz 81184 SHA256 
5843035ae4cc069693c05cf9821dae3d89d3ea7e21
 DIST layman-2.1.0.tar.gz 94150 SHA256 
cb96306c84da1d49ff54a31f7511c62c859565361bd59164516cd2812c439987 SHA512 
1fa21392157c811c7751b8e3a11b858308c48720e377871bdd5afc525ebb50a92772064aa1148a4c20e3019f77b676ff65552439a71361d498952e362398c67f
 WHIRLPOOL 
77643bedb4167eb371357444328d439c8b433cfc22a8bf9e39693feb68b701ec158064db8d22da0e6eb5260f27d5604d8b252a67930b38d8bed5921822f71c29
 DIST layman-2.2.0.tar.gz 116210 SHA256 
4a10cfd3eb354e993886369995ae9b1243418e0370c6aabd4d0ef6c5b387b7a2 SHA512 
34cac041d7b64274debdbc42cab079fd3bb3aee511ea9e80db726df0f828207d79a5262788483ced5cbf49924e3aa4f19fe21439c98dceea973d8f83473c2e41
 WHIRLPOOL 
8c5d3cbbfef35c6294dfac899cb42f49e0761745573721e38b7d6c9ac48031f95bbb961c9d8dd9d309e4672cc1e5b050107ba025a9f28127e5d7d6d9a73a6e9a
 DIST layman-2.3.0.tar.gz 119223 SHA256 
76559b8e202c012d124deac01b92bbe70b550afe711144a3b1e301c5d8bbd0f2 SHA512 
d110fb1781017d87e995098ecb48c4223347323d67534b584a393dc4354b761a6d960fd31e6e6787b5f37fa7e63b357c49486042c7cb527f78dd5beb5373627d
 WHIRLPOOL 
76c82f08b18830e925ffd4c97b490753de2e7d0b3c71a82a0a75fd776ed3af84d2ba2fe06dab25e5e4d2ea400b0f0b66eda65f1f4eded0521ec579a1a0c1b17f
+DIST layman-2.4.0.tar.gz 130052 SHA256 
0dd9dbcd05b5bf062139308cb812507b2c3310dd81f25c9cdc4c8f643b3f74c8 SHA512 
011ac0e7dfed8415b875898ff1eecfe77ba5a68ccac208d8f5c693b9b880355ffef572490bb98ede62092bea1a84298bbd72e6c93a234fdfa319e96551e7eb07
 WHIRLPOOL 
0fdcd09ef4347f9450897237befd6fa73187a3e5ed0eff6b08345846ff270cd9751a3f38277f7b53baffb3b9a3e18e10f08ebe33c228ed7f7ccd01ce81d05a76

diff --git a/app-portage/layman/layman-2.4.0.ebuild 
b/app-portage/layman/layman-2.4.0.ebuild
new file mode 100644
index 000..47ad61c
--- /dev/null
+++ b/app-portage/layman/layman-2.4.0.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} pypy )
+PYTHON_REQ_USE="xml(+),sqlite?"
+
+inherit eutils distutils-r1 linux-info prefix
+
+DESCRIPTION="Tool to manage Gentoo overlays"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Layman;
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~s390 ~x86"
+IUSE="bazaar cvs darcs +git gpg g-sorcery mercurial sqlite squashfs subversion 
sync-plugin-portage test"
+
+DEPEND="test? ( dev-vcs/subversion )
+   "
+
+RDEPEND="
+   bazaar? ( dev-vcs/bzr )
+   cvs? ( dev-vcs/cvs )
+   darcs? ( dev-vcs/darcs )
+   git? ( dev-vcs/git )
+   mercurial? ( dev-vcs/mercurial )
+   g-sorcery? ( app-portage/g-sorcery )
+   subversion? (
+   || (
+   >=dev-vcs/subversion-1.5.4[http]
+   >=dev-vcs/subversion-1.5.4[webdav-neon]
+   >=dev-vcs/subversion-1.5.4[webdav-serf]
+   )
+   )
+   gpg? ( =dev-python/pyGPG-0.2 )
+   sync-plugin-portage?  ( >=sys-apps/portage-2.2.16[${PYTHON_USEDEP}] )
+   !sync-plugin-portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
+   >=dev-python/ssl-fetch-0.2[${PYTHON_USEDEP}]
+   "
+
+layman_check_kernel_config() {
+   local CONFIG_CHECK
+   use squashfs && CONFIG_CHECK+=" ~BLK_DEV_LOOP ~SQUASHFS"
+   [[ -n ${CONFIG_CHECK} ]] && check_extra_config
+}
+
+pkg_pretend() {
+   layman_check_kernel_config
+}
+
+pkg_setup() {
+   layman_check_kernel_config
+}
+
+python_prepare_all()  {
+   python_setup
+   esetup.py setup_plugins
+   distutils-r1_python_prepare_all
+   eprefixify etc/layman.cfg layman/config.py
+}
+
+python_test() {
+   suite=layman/tests/external.py
+   PYTHONPATH="." "${PYTHON}" ${suite} || die "test suite '${suite}' 
failed"
+   unset suite
+}
+
+python_install_all() {
+   distutils-r1_python_install_all
+
+   insinto /etc/layman
+   doins etc/layman.cfg
+
+   doman doc/layman.8
+   dohtml d

[gentoo-commits] proj/layman: New tag: 2.4.0

2016-05-01 Thread Devan Franchini
commit: 
Commit: Devan Franchini  gentoo  org>
CommitDate: Mon May  2 03:48:28 2016 +

New tag: 2.4.0




[gentoo-commits] proj/layman: Tag deleted: 2.4.0

2016-05-01 Thread Devan Franchini
commit: 
Commit: Devan Franchini  gentoo  org>
CommitDate: Mon May  2 03:47:47 2016 +

Tag deleted: 2.4.0




[gentoo-commits] proj/layman:master commit in: /

2016-05-01 Thread Devan Franchini
commit: 1df76f315f2f67be2263d46e00105d88f42d
Author: Devan Franchini  gentoo  org>
AuthorDate: Mon May  2 03:28:15 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Mon May  2 03:44:19 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=1df76f31

setup.py: Adds DB_MODULES to use_defaults to include them in the dist tarball

 setup.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/setup.py b/setup.py
index 140aacb..8cdb717 100755
--- a/setup.py
+++ b/setup.py
@@ -36,6 +36,7 @@ SYNC_PLUGINS = {
 'sync-plugin-portage': 'portage.sync.modules.laymansync',
 }
 
+use_defaults += ' ' + ' '.join(list(DB_PLUGINS))
 # get the USE from the environment, default to all selectable modules
 # split them so we don't get substring matches
 USE = os.environ.get("USE", use_defaults).split()



[gentoo-commits] proj/layman:master commit in: layman/

2016-05-01 Thread Devan Franchini
commit: ec141d305949dac2d7ea3aab9f4c42d73f690777
Author: Devan Franchini  gentoo  org>
AuthorDate: Sun May  1 01:06:09 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sun May  1 01:06:09 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=ec141d30

version.py: Changes version to reflect update

 layman/version.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layman/version.py b/layman/version.py
index e6d19ff..1e1427f 100644
--- a/layman/version.py
+++ b/layman/version.py
@@ -24,7 +24,7 @@ from __future__ import unicode_literals
 __version__ = "$Id: version.py 309 2007-04-09 16:23:38Z wrobel $"
 
 
-VERSION = '2.4.0-git'
+VERSION = '2.4.0'
 
 if __name__ == '__main__':
 print(VERSION)



[gentoo-commits] proj/layman: New tag: 2.4.0

2016-05-01 Thread Devan Franchini
commit: 
Commit: Devan Franchini  gentoo  org>
CommitDate: Mon May  2 03:30:31 2016 +

New tag: 2.4.0




[gentoo-commits] proj/layman:master commit in: /

2016-05-01 Thread Devan Franchini
commit: 0a7e9ea8476a7fb805033eacd4ebc8e96fe5b00b
Author: Devan Franchini  gentoo  org>
AuthorDate: Mon May  2 03:28:15 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Mon May  2 03:28:15 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=0a7e9ea8

setup.py: Adds DB_MODULES to use_defaults to include them in the dist tarball

 setup.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/setup.py b/setup.py
index 140aacb..2649410 100755
--- a/setup.py
+++ b/setup.py
@@ -36,6 +36,7 @@ SYNC_PLUGINS = {
 'sync-plugin-portage': 'portage.sync.modules.laymansync',
 }
 
+use_defaults = ' '.join(list(DB_PLUGINS))
 # get the USE from the environment, default to all selectable modules
 # split them so we don't get substring matches
 USE = os.environ.get("USE", use_defaults).split()



[gentoo-commits] proj/layman: Tag deleted: 2.4.0

2016-05-01 Thread Devan Franchini
commit: 
Commit: Devan Franchini  gentoo  org>
CommitDate: Mon May  2 03:26:58 2016 +

Tag deleted: 2.4.0




[gentoo-commits] proj/layman: New tag: 2.4.0

2016-04-30 Thread Devan Franchini
commit: 
Commit: Devan Franchini  gentoo  org>
CommitDate: Sun May  1 01:09:01 2016 +

New tag: 2.4.0




[gentoo-commits] proj/layman:master commit in: /

2016-04-30 Thread Devan Franchini
commit: 64911e3cb6ee2c768b93f397f629f5130b4923ca
Author: Devan Franchini  gentoo  org>
AuthorDate: Sun May  1 01:03:09 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sun May  1 01:03:09 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=64911e3c

Added changes to reflect upcoming release

 CHANGES | 2 +-
 README  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/CHANGES b/CHANGES
index f35ee3b..15aaee8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,7 @@
 CHANGES
 ---
 
-Version 2.4.0 - Release 2015-??-??
+Version 2.4.0 - Release 2016-??-??
 ==
  - adds support for different overlay database types
  - adds json database support

diff --git a/README b/README
index fec6a08..f5763de 100644
--- a/README
+++ b/README
@@ -2,8 +2,8 @@
 README
 ==
 
-:Last update:   Date: 2015-03-28
-:Revision:  2.3.1
+:Last update:   Date: 2016-04-30
+:Revision:  2.4.0
 :Contact:   Brian Dolbec <dol...@gentoo.org>
 
 



[gentoo-commits] repo/gentoo:master commit in: app-portage/layman/, app-portage/layman/files/

2016-04-30 Thread Devan Franchini
commit: 3b44feaf636c5c72b841d03bcf179968421fc35d
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Apr 30 23:20:38 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Apr 30 23:20:38 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b44feaf

Adds patch to check for the existence of repos.conf file, bug #574188

Package-Manager: portage-2.2.27

 .../layman/files/layman-2.3.0-dir_check.patch  | 31 ++
 app-portage/layman/layman-2.3.0-r1.ebuild  |  1 +
 2 files changed, 32 insertions(+)

diff --git a/app-portage/layman/files/layman-2.3.0-dir_check.patch 
b/app-portage/layman/files/layman-2.3.0-dir_check.patch
new file mode 100644
index 000..af5ec4a
--- /dev/null
+++ b/app-portage/layman/files/layman-2.3.0-dir_check.patch
@@ -0,0 +1,31 @@
+From: Devan Franchini <twitch...@gentoo.org>
+Date: Sat, 30 Apr 2016 18:54:39 -0400
+Subject: [PATCH] Adds dir check for repos.conf rebuilding
+
+--- a/layman/updater.py2015-02-07 22:38:49.0 -0500
 b/layman/updater.py2016-04-30 18:54:39.103894343 -0400
+@@ -182,6 +182,24 @@
+ 
+ def create_repos_conf(self):
+ self.output.info("  Creating layman's repos.conf file")
++
++if os.path.isdir(self.config['repos_conf']):
++msg = '  create_repos_conf() error: %s is a directory and will\n'\
++  '  not be written to.' % self.config['repos_conf']
++self.output.error(msg)
++return None
++
++conf_dir = os.path.dirname(self.config['repos_conf'])
++
++if not os.path.isdir(conf_dir):
++try:
++os.mkdir(conf_dir)
++except OSError as e:
++self.output.error('  create_repos_conf() error creating: %s: 
'\
++   % conf_dir)
++self.output.error('  "%s"' % e)
++return None
++
+ layman_inst = LaymanAPI(config=self.config)
+ overlays = {}
+ for ovl in layman_inst.get_installed():

diff --git a/app-portage/layman/layman-2.3.0-r1.ebuild 
b/app-portage/layman/layman-2.3.0-r1.ebuild
index 090a8ff..d3a9a16 100644
--- a/app-portage/layman/layman-2.3.0-r1.ebuild
+++ b/app-portage/layman/layman-2.3.0-r1.ebuild
@@ -61,6 +61,7 @@ python_prepare_all()  {
esetup.py setup_plugins
distutils-r1_python_prepare_all
#rm "${S}"/"${PN}"/tests/dtest.py
+   epatch "${FILESDIR}"/${P}-dir_check.patch
eprefixify etc/layman.cfg layman/config.py
 }
 



[gentoo-commits] proj/layman:master commit in: layman/, layman/config_modules/reposconf/

2016-04-30 Thread Devan Franchini
commit: 6f4d6dc0552b1bad10f8953de786cf0e78d975ee
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Apr 30 22:08:12 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Apr 30 22:18:41 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=6f4d6dc0

Repairs layman-updater rebuild functionality

reposconf.py: Adds rebuild __init__ parameter to fix rebuild
functionality
updater.py: Sets rebuild parameter for repos.conf ConfigHandler class

 layman/config_modules/reposconf/reposconf.py | 9 +
 layman/updater.py| 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/layman/config_modules/reposconf/reposconf.py 
b/layman/config_modules/reposconf/reposconf.py
index 1f0fd04..79991c9 100644
--- a/layman/config_modules/reposconf/reposconf.py
+++ b/layman/config_modules/reposconf/reposconf.py
@@ -53,7 +53,7 @@ def check_conf_path(conf_path):
 
 class ConfigHandler:
 
-def __init__(self, config, overlays):
+def __init__(self, config, overlays, rebuild=False):
 
 self.config = config
 self.output = config['output']
@@ -61,7 +61,7 @@ class ConfigHandler:
 self.path = check_conf_path(config['repos_conf'])
 self.storage = config['storage']
 self.repo_config = None
-self.rebuild = False
+self.rebuild = rebuild
 
 self.read()
 
@@ -193,14 +193,15 @@ class ConfigHandler:
 if self.rebuild:
 # start over with a fresh instance
 self.repo_conf = ConfigParser.ConfigParser()
-if not self.repo_conf.sections():
+for i in sorted(self.overlays):
+self.add(self.overlays[i], no_write=True)
+if not self.repo_conf.sections() and not self.rebuild:
 if ('disable' in self.config.keys() and not
 self.config['disable'][0].lower() == 'all'):
 for i in sorted(self.overlays):
 if not i == delete:
 self.add(self.overlays[i], no_write=True)
 self.repo_conf.write(laymanconf)
-self.rebuild = False
 return True
 except IOError as error:
 self.output.error('ReposConf: ConfigHandler.write(); Failed to 
write "'\

diff --git a/layman/updater.py b/layman/updater.py
index 6384429..2bfc241 100644
--- a/layman/updater.py
+++ b/layman/updater.py
@@ -273,7 +273,7 @@ class Main(object):
 # can write the overlays to it.
 open(self.config['repos_conf'], 'w').close()
 from layman.config_modules.reposconf.reposconf import ConfigHandler
-repos_conf = ConfigHandler(self.config, overlays)
+repos_conf = ConfigHandler(self.config, overlays, rebuild=True)
 repos_conf.write()
 
 



[gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/

2016-04-02 Thread Devan Franchini
commit: d8232901b67b237a3f78d7845b0abbfc8d70363c
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Apr  2 19:35:52 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Apr  2 19:37:13 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8232901

Removes games eclass usage & changes desktop icon location, bug #561914

Package-Manager: portage-2.2.27

 games-emulation/dolphin/dolphin-.ebuild | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/games-emulation/dolphin/dolphin-.ebuild 
b/games-emulation/dolphin/dolphin-.ebuild
index 981b451..bb207fe 100644
--- a/games-emulation/dolphin/dolphin-.ebuild
+++ b/games-emulation/dolphin/dolphin-.ebuild
@@ -8,7 +8,7 @@ PLOCALES="ar ca cs de el en es fa fr he hu it ja ko nb nl pl 
pt_BR pt ru sr sv t
 PLOCALE_BACKUP="en"
 WX_GTK_VER="3.0"
 
-inherit cmake-utils eutils l10n pax-utils toolchain-funcs versionator 
wxwidgets games
+inherit cmake-utils eutils l10n pax-utils toolchain-funcs versionator wxwidgets
 
 if [[ ${PV} == * ]]
 then
@@ -153,10 +153,6 @@ src_configure() {
fi
 
local mycmakeargs=(
-   "-DCMAKE_INSTALL_PREFIX=${GAMES_PREFIX}"
-   "-Dprefix=${GAMES_PREFIX}"
-   "-Ddatadir=${GAMES_DATADIR}/${PN}"
-   "-Dplugindir=$(games_get_libdir)/${PN}"
"-DUSE_SHARED_ENET=ON"
$( cmake-utils_use ffmpeg ENCODE_FRAMEDUMPS )
$( cmake-utils_use log FASTLOG )
@@ -187,11 +183,9 @@ src_install() {
dodoc -r docs/ActionReplay docs/DSP docs/WiiMote
fi
 
-   doicon -s 48 Installer/dolphin-emu.png
-   doicon -s scalable Installer/dolphin-emu.svg
-   make_desktop_entry "dolphin-emu" "Dolphin Emulator" "dolphin-emu" 
"Game;Emulator;"
-
-   prepgamesdirs
+   doicon -s 48 Data/dolphin-emu.png
+   doicon -s scalable Data/dolphin-emu.svg
+   doicon Data/dolphin-emu.svg
 }
 
 pkg_postinst() {



[gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/

2016-04-02 Thread Devan Franchini
commit: 09d9cf4a9308e973e82ca03982a18e456ed37f60
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Apr  2 04:17:18 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Apr  2 19:37:00 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09d9cf4a

Adds LINGUAS support to ebuid, bug #561914

Package-Manager: portage-2.2.27

 games-emulation/dolphin/dolphin-.ebuild | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/games-emulation/dolphin/dolphin-.ebuild 
b/games-emulation/dolphin/dolphin-.ebuild
index b12563f..981b451 100644
--- a/games-emulation/dolphin/dolphin-.ebuild
+++ b/games-emulation/dolphin/dolphin-.ebuild
@@ -4,9 +4,11 @@
 
 EAPI=5
 
+PLOCALES="ar ca cs de el en es fa fr he hu it ja ko nb nl pl pt_BR pt ru sr sv 
tr zh_CN zh_TW"
+PLOCALE_BACKUP="en"
 WX_GTK_VER="3.0"
 
-inherit cmake-utils eutils pax-utils toolchain-funcs versionator wxwidgets 
games
+inherit cmake-utils eutils l10n pax-utils toolchain-funcs versionator 
wxwidgets games
 
 if [[ ${PV} == * ]]
 then
@@ -130,6 +132,18 @@ src_prepare() {
mv SOIL Externals || die
mv gtest Externals || die
mv xxhash Externals || die
+
+   remove_locale() {
+   # Ensure preservation of the backup locale when no valid LINGUA 
is set
+   if [[ "${PLOCALE_BACKUP}" == "${1}" ]] && [[ 
"${PLOCALE_BACKUP}" == "$(l10n_get_locales)" ]]; then
+   return
+   else
+   rm "Languages/po/${1}.po" || die
+   fi
+   }
+
+   l10n_find_plocales_changes "Languages/po/" "" '.po'
+   l10n_for_each_disabled_locale_do remove_locale
 }
 
 src_configure() {



[gentoo-commits] proj/layman:master commit in: layman/

2016-03-09 Thread Devan Franchini
commit: b15d33d547a8fa99f6919036991e2a7e539fe04c
Author: Devan Franchini  gentoo  org>
AuthorDate: Wed Mar  9 23:59:13 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Wed Mar  9 23:59:18 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=b15d33d5

remotedb.py: Removes climit param for internel _fetch_file() params

As _fetch_file() is for fetching internal files and does not use ssl-fetch
it should not have climit as a parameter.

 layman/remotedb.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/layman/remotedb.py b/layman/remotedb.py
index acade02..2df0c63 100644
--- a/layman/remotedb.py
+++ b/layman/remotedb.py
@@ -145,7 +145,7 @@ class RemoteDB(DbBase):
 filepath, mpath, tpath, sig = self._paths(url)
 if 'file://' in url:
 success, olist, timestamp = self._fetch_file(
-url, mpath, tpath, climit=60)
+url, mpath, tpath)
 elif sig:
 success, olist, timestamp = fetcher.fetch_content(
 url[0], tpath, climit=60)
@@ -222,7 +222,7 @@ class RemoteDB(DbBase):
 
 return base + '_' + hashlib.md5(url_encoded).hexdigest()
 
-def _fetch_file(self, url, mpath, tpath=None, climit=60):
+def _fetch_file(self, url, mpath, tpath=None):
 self.output.debug('RemoteDB._fetch_file() url = %s' % url, 2)
 # check when the cache was last updated
 # and don't re-fetch it unless it has changed



[gentoo-commits] proj/layman:master commit in: layman/

2016-03-09 Thread Devan Franchini
commit: 5f5e2626e0f4a5c3acca62083ce479828597462f
Author: Devan Franchini  gentoo  org>
AuthorDate: Wed Mar  9 23:37:13 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Wed Mar  9 23:37:15 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=5f5e2626

remotedb.py: Adds climit param to _fetch_file() definition

Following up on the updating of ssl-fetch's API update in commit
5ffbc7ae to make use of climit parameter.

 layman/remotedb.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layman/remotedb.py b/layman/remotedb.py
index 75f6739..acade02 100644
--- a/layman/remotedb.py
+++ b/layman/remotedb.py
@@ -222,7 +222,7 @@ class RemoteDB(DbBase):
 
 return base + '_' + hashlib.md5(url_encoded).hexdigest()
 
-def _fetch_file(self, url, mpath, tpath=None):
+def _fetch_file(self, url, mpath, tpath=None, climit=60):
 self.output.debug('RemoteDB._fetch_file() url = %s' % url, 2)
 # check when the cache was last updated
 # and don't re-fetch it unless it has changed



[gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/

2016-03-06 Thread Devan Franchini
commit: afdcf3ed433747f8d69b6e8690f999426d16c1f7
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Mar  5 05:59:54 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Mar  5 05:59:54 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=afdcf3ed

Replaces xpm icon with png and svg, bug #575420

Package-Manager: portage-2.2.27

 games-emulation/dolphin/dolphin-.ebuild | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/games-emulation/dolphin/dolphin-.ebuild 
b/games-emulation/dolphin/dolphin-.ebuild
index 1b11576..b12563f 100644
--- a/games-emulation/dolphin/dolphin-.ebuild
+++ b/games-emulation/dolphin/dolphin-.ebuild
@@ -173,7 +173,8 @@ src_install() {
dodoc -r docs/ActionReplay docs/DSP docs/WiiMote
fi
 
-   doicon Installer/dolphin-emu.xpm
+   doicon -s 48 Installer/dolphin-emu.png
+   doicon -s scalable Installer/dolphin-emu.svg
make_desktop_entry "dolphin-emu" "Dolphin Emulator" "dolphin-emu" 
"Game;Emulator;"
 
prepgamesdirs



[gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/

2016-03-06 Thread Devan Franchini
commit: 4128669fc0ee4549b9ed33cbb0530bcb2881c20c
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Mar  5 05:48:16 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Mar  5 05:48:16 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4128669f

Removes DOLPHIN_WC_REVISION, bug #576090

Package-Manager: portage-2.2.27

 games-emulation/dolphin/dolphin-.ebuild | 1 -
 1 file changed, 1 deletion(-)

diff --git a/games-emulation/dolphin/dolphin-.ebuild 
b/games-emulation/dolphin/dolphin-.ebuild
index 33a6bf8..1b11576 100644
--- a/games-emulation/dolphin/dolphin-.ebuild
+++ b/games-emulation/dolphin/dolphin-.ebuild
@@ -139,7 +139,6 @@ src_configure() {
fi
 
local mycmakeargs=(
-   "-DDOLPHIN_WC_REVISION=${PV}"
"-DCMAKE_INSTALL_PREFIX=${GAMES_PREFIX}"
"-Dprefix=${GAMES_PREFIX}"
"-Ddatadir=${GAMES_DATADIR}/${PN}"



[gentoo-commits] proj/layman:master commit in: layman/

2016-02-28 Thread Devan Franchini
commit: c8170ca79751fa8785527683b8627317d61bde2b
Author: Devan Franchini  gentoo  org>
AuthorDate: Mon Feb 29 06:22:25 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Mon Feb 29 06:22:25 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=c8170ca7

dbbase.py: adds return value for read_db()

 layman/dbbase.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layman/dbbase.py b/layman/dbbase.py
index 8b25fcd..9a8ba3f 100644
--- a/layman/dbbase.py
+++ b/layman/dbbase.py
@@ -219,7 +219,7 @@ class DbBase(object):
 db_type = 'xml_db'
 
 db_ctl = self._get_dbctl(db_type)
-db_ctl.read_db(path, text=text)
+return db_ctl.read_db(path, text=text)
 
 
 def write(self, path, remove=False, migrate_type=None):



[gentoo-commits] proj/layman:master commit in: layman/db_modules/xml_db/, layman/db_modules/sqlite_db/, layman/, ...

2016-02-28 Thread Devan Franchini
commit: f8eb545aa0b268cfd08644b0996a6681359dc0bc
Author: Devan Franchini  gentoo  org>
AuthorDate: Mon Feb 29 06:09:27 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Mon Feb 29 06:09:29 2016 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=f8eb545a

Adds error reporting for db read failures

If the database back-end fails to be read then layman will properly
report it and exit without causing an ugly traceback.

 layman/db_modules/json_db/json_db.py |   7 +-
 layman/db_modules/sqlite_db/sqlite_db.py | 121 +--
 layman/db_modules/xml_db/xml_db.py   |  21 --
 layman/dbbase.py |  12 ++-
 4 files changed, 95 insertions(+), 66 deletions(-)

diff --git a/layman/db_modules/json_db/json_db.py 
b/layman/db_modules/json_db/json_db.py
index 70e41d5..bf88593 100644
--- a/layman/db_modules/json_db/json_db.py
+++ b/layman/db_modules/json_db/json_db.py
@@ -75,6 +75,10 @@ class DBHandler(object):
 try:
 with fileopen(path, 'r') as df:
 document = df.read()
+except ValueError as error:
+msg = 'JSON DBHanlder - ValueError: %(err)s' % {'err': error}
+self.output.error(msg)
+return False
 except Exception as error:
 if not self.ignore_init_read_errors:
 msg = 'JSON DBHandler - Failed to read the overlay list 
at'\
@@ -82,7 +86,8 @@ class DBHandler(object):
 self.output.error(msg)
 raise error
 
-self.add_new(document, origin=path)
+success = self.add_new(document, origin=path)
+return success
 
 
 def add_new(self, document=None, origin=None):

diff --git a/layman/db_modules/sqlite_db/sqlite_db.py 
b/layman/db_modules/sqlite_db/sqlite_db.py
index a3305a7..3585c4a 100644
--- a/layman/db_modules/sqlite_db/sqlite_db.py
+++ b/layman/db_modules/sqlite_db/sqlite_db.py
@@ -136,6 +136,8 @@ class DBHandler(object):
 CONFLICT IGNORE )''')
 
 connection.commit()
+except sqlite3.DatabaseError as err:
+raise err
 except Exception as err:
 msg = 'SQLite DBHandler error; failed to create database.\n'\
   'Error was: %(msg)s' % {'msg': err}
@@ -152,64 +154,71 @@ class DBHandler(object):
 overlay_id = None
 overlay = {}
 
-with self.__connect__(path) as connection:
-cursor = connection.cursor()
-cursor.execute('''SELECT Overlay_ID, Name, Priority, Status, 
-Quality, Homepage, IRC, License FROM Overlay''')
-overlays_info = cursor.fetchall()
-connection.commit()
+try:
+connection = self.__connect__(path)
+except sqlite3.DatabaseError as err:
+msg = 'SQLite DBHandler DatabaseError: %(err)s' % {'err': err}
+self.output.error(msg)
+return False
 
-for overlay_info in overlays_info:
-overlay = {}
-overlay_id = overlay_info[0]
-overlay['name'] = overlay_info[1]
-
-cursor.execute('''SELECT URL, Type, Branch FROM Overlay_Source 
-JOIN Overlay USING (Overlay_ID) JOIN Source USING (Source_ID) 
-WHERE Overlay_ID = ?''', (overlay_id,))
-overlay['source'] = cursor.fetchall()
-
-cursor.execute('''SELECT Owner_Email, Owner_Name FROM 
-Overlay_Owner JOIN Overlay USING (Overlay_ID) JOIN Owner USING 
-(Owner_ID) WHERE Overlay_ID = ?''', (overlay_id,))
-owner_info = cursor.fetchall()
-overlay['owner'] = []
-
-for _owner in owner_info:
-owner = {}
-if _owner[0]:
-owner['email'] = _owner[0]
+cursor = connection.cursor()
+cursor.execute('''SELECT Overlay_ID, Name, Priority, Status,
+Quality, Homepage, IRC, License FROM Overlay''')
+overlays_info = cursor.fetchall()
+connection.commit()
+
+for overlay_info in overlays_info:
+overlay = {}
+overlay_id = overlay_info[0]
+overlay['name'] = overlay_info[1]
+
+cursor.execute('''SELECT URL, Type, Branch FROM Overlay_Source
+JOIN Overlay USING (Overlay_ID) JOIN Source USING (Source_ID)
+WHERE Overlay_ID = ?''', (overlay_id,))
+overlay['source'] = cursor.fetchall()
+
+cursor.execute('''SELECT Owner_Email, Owner_Name FROM Overlay_Owner
+JOIN Overlay USING (Overlay_ID) JOIN Owner USING (Owner_ID)
+WHERE Overlay_ID = ?''', (overlay_id,))
+owner_info = cursor.fetchall()
+overlay['owner'] = []
+for _owner in owner_info:
+owner = {}
+if _o

[gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/

2016-01-13 Thread Devan Franchini
commit: 40cd1e1305bbc6dfe82c27ad3b78f4556527a2d0
Author: Devan Franchini  gentoo  org>
AuthorDate: Wed Jan 13 20:48:57 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Wed Jan 13 20:49:25 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40cd1e13

games-emulation/dolphin: Removes saving of GL external folder

The GL external folder is no longer used and attempting to save it will cause
a failure when running the ebuild.

X-Gentoo-Bug: 571272
X-Gentoo-Bug-URL: https://bugs.gentoo.org/571272

Package-Manager: portage-2.2.24

 games-emulation/dolphin/dolphin-.ebuild | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/games-emulation/dolphin/dolphin-.ebuild 
b/games-emulation/dolphin/dolphin-.ebuild
index c44022a..33a6bf8 100644
--- a/games-emulation/dolphin/dolphin-.ebuild
+++ b/games-emulation/dolphin/dolphin-.ebuild
@@ -119,18 +119,15 @@ src_prepare() {
# Remove ALL the bundled libraries, aside from:
# - SOIL: The sources are not public.
# - Bochs-disasm: Don't know what it is.
-   # - GL: A custom gl.h file is used.
# - gtest: Their build set up solely relies on the build in gtest.
# - xxhash: Not on the tree.
mv Externals/SOIL . || die
mv Externals/Bochs_disasm . || die
-   mv Externals/GL . || die
mv Externals/gtest . || die
mv Externals/xxhash . || die
rm -r Externals/* || die "Failed to delete Externals dir."
mv Bochs_disasm Externals || die
mv SOIL Externals || die
-   mv GL Externals || die
mv gtest Externals || die
mv xxhash Externals || die
 }



[gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/

2016-01-06 Thread Devan Franchini
commit: d3acb63326a3851279b633af595d044f9887261b
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Jan  7 04:23:38 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Jan  7 04:23:38 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3acb633

Fully removes all libav restrictions, bug #570346

Package-Manager: portage-2.2.24

 games-emulation/dolphin/dolphin-5.0.ebuild  | 3 +--
 games-emulation/dolphin/dolphin-.ebuild | 5 +
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/games-emulation/dolphin/dolphin-5.0.ebuild 
b/games-emulation/dolphin/dolphin-5.0.ebuild
index 049c144..d7266c1 100644
--- a/games-emulation/dolphin/dolphin-5.0.ebuild
+++ b/games-emulation/dolphin/dolphin-5.0.ebuild
@@ -30,8 +30,7 @@ RDEPEND=">=media-libs/glew-1.10
alsa? ( media-libs/alsa-lib )
ao? ( media-libs/libao )
bluetooth? ( net-wireless/bluez )
-   ffmpeg? ( virtual/ffmpeg
- !!media-video/libav )
+   ffmpeg? ( virtual/ffmpeg )
lzo? ( dev-libs/lzo )
openal? ( media-libs/openal )
opengl? ( virtual/opengl )

diff --git a/games-emulation/dolphin/dolphin-.ebuild 
b/games-emulation/dolphin/dolphin-.ebuild
index 1ee2c85..c44022a 100644
--- a/games-emulation/dolphin/dolphin-.ebuild
+++ b/games-emulation/dolphin/dolphin-.ebuild
@@ -46,10 +46,7 @@ RDEPEND=">=media-libs/libsfml-2.1
dev-libs/libevdev
virtual/udev
)
-   ffmpeg? (
-   virtual/ffmpeg
-   !!media-video/libav
-   )
+   ffmpeg? ( virtual/ffmpeg )
llvm? ( sys-devel/llvm )
openal? (
media-libs/openal



[gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/

2016-01-01 Thread Devan Franchini
commit: 179974d8e90764da35d6b415b77f0b23ebe16bd8
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Jan  2 01:40:31 2016 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Jan  2 01:40:43 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=179974d8

Removes uneeded version limit on libav

X-Gentoo-Bug: 570346
X-Gentoo-Bug-URL: https://bugs.gentoo.org/570346

 games-emulation/dolphin/dolphin-5.0.ebuild  | 4 ++--
 games-emulation/dolphin/dolphin-.ebuild | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/games-emulation/dolphin/dolphin-5.0.ebuild 
b/games-emulation/dolphin/dolphin-5.0.ebuild
index 9ef670f..049c144 100644
--- a/games-emulation/dolphin/dolphin-5.0.ebuild
+++ b/games-emulation/dolphin/dolphin-5.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -31,7 +31,7 @@ RDEPEND=">=media-libs/glew-1.10
ao? ( media-libs/libao )
bluetooth? ( net-wireless/bluez )
ffmpeg? ( virtual/ffmpeg
-   !!>=media-video/libav-10 )
+ !!media-video/libav )
lzo? ( dev-libs/lzo )
openal? ( media-libs/openal )
opengl? ( virtual/opengl )

diff --git a/games-emulation/dolphin/dolphin-.ebuild 
b/games-emulation/dolphin/dolphin-.ebuild
index 4e80f29..1ee2c85 100644
--- a/games-emulation/dolphin/dolphin-.ebuild
+++ b/games-emulation/dolphin/dolphin-.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -48,7 +48,7 @@ RDEPEND=">=media-libs/libsfml-2.1
)
ffmpeg? (
virtual/ffmpeg
-   !!>=media-video/libav-10
+   !!media-video/libav
)
llvm? ( sys-devel/llvm )
openal? (



[gentoo-commits] proj/layman:master commit in: layman/

2015-12-30 Thread Devan Franchini
commit: 40b99fb93f0cbc80083a72e23e93da4bafb365fb
Author: Devan Franchini  gentoo  org>
AuthorDate: Thu Dec 31 01:02:44 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Thu Dec 31 01:02:47 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=40b99fb9

module.py: fixes bug where the module_spec module name was not used

This only showed up when the module's target name (filename) was not the
same as the modules initialization name.

 layman/module.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layman/module.py b/layman/module.py
index 6d7a40b..99d243b 100644
--- a/layman/module.py
+++ b/layman/module.py
@@ -48,7 +48,7 @@ class Module(object):
 for submodule in self.module_spec['provides']:
 kid = self.module_spec['provides'][submodule]
 kidname = kid['name']
-kid['module_name'] = '.'.join([mod_name, self.name])
+kid['module_name'] = '.'.join([mod_name, kidname])
 kid['is_imported'] = False
 self.kids[kidname] = kid
 self.kids_names.append(kidname)



[gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/

2015-12-13 Thread Devan Franchini
commit: 513e6ee31448d19d4eb3b4484baf349621a38bd3
Author: Devan Franchini  gentoo  org>
AuthorDate: Sun Dec 13 21:17:58 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sun Dec 13 21:18:35 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=513e6ee3

games-emulation/dolphin: Removes unneeded dependencies

Also adds lzo and libpng as explicit deps

Package-Manager: portage-2.2.24

 games-emulation/dolphin/dolphin-.ebuild | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/games-emulation/dolphin/dolphin-.ebuild 
b/games-emulation/dolphin/dolphin-.ebuild
index 5b8f798..4e80f29 100644
--- a/games-emulation/dolphin/dolphin-.ebuild
+++ b/games-emulation/dolphin/dolphin-.ebuild
@@ -23,12 +23,13 @@ HOMEPAGE="https://www.dolphin-emu.org/;
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="alsa ao bluetooth doc egl +evdev ffmpeg llvm log lto openal pch 
portaudio profile pulseaudio qt5 sdl upnp +wxwidgets"
+IUSE="alsa ao bluetooth doc egl +evdev ffmpeg llvm log lto openal +pch 
portaudio profile pulseaudio qt5 sdl upnp +wxwidgets"
 
-RDEPEND=">=media-libs/glew-1.10
-   >=media-libs/libsfml-2.1
+RDEPEND=">=media-libs/libsfml-2.1
>net-libs/enet-1.3.7
>=net-libs/mbedtls-2.1.1
+   dev-libs/lzo
+   media-libs/libpng:=
sys-libs/glibc
sys-libs/readline:=
sys-libs/zlib
@@ -74,7 +75,6 @@ DEPEND="${RDEPEND}
>=dev-util/cmake-2.8.8
>=sys-devel/gcc-4.9.0
app-arch/zip
-   media-gfx/nvidia-cg-toolkit
media-libs/freetype
sys-devel/gettext
virtual/pkgconfig



[gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/

2015-12-12 Thread Devan Franchini
commit: 362e44de9e120889948e31e2cc1fdbed728ec29f
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Dec 12 21:09:46 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Dec 12 21:12:17 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=362e44de

games-emulation/dolphin: Adds updates to  ebuild, bug #561914

Removes a lot of outdated dependencies and adds a few newer ones.
Also adds various new USE flags.

Package-Manager: portage-2.2.24

 games-emulation/dolphin/dolphin-.ebuild | 71 +++--
 games-emulation/dolphin/metadata.xml|  4 ++
 2 files changed, 60 insertions(+), 15 deletions(-)

diff --git a/games-emulation/dolphin/dolphin-.ebuild 
b/games-emulation/dolphin/dolphin-.ebuild
index bd8bcdf..5b8f798 100644
--- a/games-emulation/dolphin/dolphin-.ebuild
+++ b/games-emulation/dolphin/dolphin-.ebuild
@@ -14,7 +14,7 @@ then
inherit git-r3
KEYWORDS=""
 else
-   SRC_URI="https://${PN}-emu.googlecode.com/files/${P}-src.zip;
+   SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${PV}.zip -> 
${P}.zip"
KEYWORDS="~amd64"
 fi
 
@@ -23,35 +23,61 @@ HOMEPAGE="https://www.dolphin-emu.org/;
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="alsa ao bluetooth doc ffmpeg lto +lzo openal opengl openmp portaudio 
pulseaudio"
+IUSE="alsa ao bluetooth doc egl +evdev ffmpeg llvm log lto openal pch 
portaudio profile pulseaudio qt5 sdl upnp +wxwidgets"
 
 RDEPEND=">=media-libs/glew-1.10
>=media-libs/libsfml-2.1
-   >=net-libs/miniupnpc-1.8
+   >net-libs/enet-1.3.7
+   >=net-libs/mbedtls-2.1.1
+   sys-libs/glibc
sys-libs/readline:=
+   sys-libs/zlib
x11-libs/libXext
+   x11-libs/libXi
x11-libs/libXrandr
-   media-libs/libsdl2[haptic,joystick]
-   net-libs/polarssl[havege]
+   virtual/libusb:1
+   virtual/opengl
alsa? ( media-libs/alsa-lib )
ao? ( media-libs/libao )
bluetooth? ( net-wireless/bluez )
-   ffmpeg? ( virtual/ffmpeg
-   !!>=media-video/libav-10 )
-   lzo? ( dev-libs/lzo )
-   openal? ( media-libs/openal )
-   opengl? ( virtual/opengl )
+   egl? ( media-libs/mesa[egl] )
+   evdev? (
+   dev-libs/libevdev
+   virtual/udev
+   )
+   ffmpeg? (
+   virtual/ffmpeg
+   !!>=media-video/libav-10
+   )
+   llvm? ( sys-devel/llvm )
+   openal? (
+   media-libs/openal
+   media-libs/libsoundtouch
+   )
portaudio? ( media-libs/portaudio )
+   profile? ( dev-util/oprofile )
pulseaudio? ( media-sound/pulseaudio )
+   qt5? (
+   dev-qt/qtcore:5
+   dev-qt/qtgui:5
+   dev-qt/qtwidgets:5
+   )
+   sdl? ( media-libs/libsdl2[haptic,joystick] )
+   upnp? ( >=net-libs/miniupnpc-1.7 )
+   wxwidgets? (
+   dev-libs/glib:2
+   x11-libs/gtk+:2
+   x11-libs/wxGTK:${WX_GTK_VER}[opengl,X]
+   )
"
 DEPEND="${RDEPEND}
+   >=dev-util/cmake-2.8.8
+   >=sys-devel/gcc-4.9.0
app-arch/zip
media-gfx/nvidia-cg-toolkit
media-libs/freetype
-   media-libs/libsoundtouch
-   >net-libs/enet-1.3.7
-   >=sys-devel/gcc-4.9.0
-   x11-libs/wxGTK:${WX_GTK_VER}
+   sys-devel/gettext
+   virtual/pkgconfig
"
 
 pkg_pretend() {
@@ -80,6 +106,9 @@ src_prepare() {
if use !bluetooth; then
sed -i -e '/check_lib(BLUEZ/d' CMakeLists.txt || die
fi
+   if use !llvm; then
+   sed -i -e '/include(FindLLVM/d' CMakeLists.txt || die
+   fi
if use !openal; then
sed -i -e '/include(FindOpenAL/d' CMakeLists.txt || die
fi
@@ -111,6 +140,10 @@ src_prepare() {
 
 src_configure() {
 
+   if use wxwidgets; then
+   need-wxwidgets unicode
+   fi
+
local mycmakeargs=(
"-DDOLPHIN_WC_REVISION=${PV}"
"-DCMAKE_INSTALL_PREFIX=${GAMES_PREFIX}"
@@ -119,8 +152,16 @@ src_configure() {
"-Dplugindir=$(games_get_libdir)/${PN}"
"-DUSE_SHARED_ENET=ON"
$( cmake-utils_use ffmpeg ENCODE_FRAMEDUMPS )
+   $( cmake-utils_use log FASTLOG )
+   $( cmake-utils_use profile OPROFILING )
+   $( cmake-utils_use_disable wxwidgets WX )
+   $( cmake-utils_use_enable evdev EVDEV )
$( cmake-utils_use_enable lto LTO )
-   $( cmake-utils_use openmp OPENMP )
+   $( cmake-utils_use_enable pch PCH )
+  

[gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/files/, games-emulation/dolphin/

2015-12-11 Thread Devan Franchini
commit: 793914c32d038d8aba300c0be19418a2a0b85394
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Dec 12 04:57:24 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Dec 12 04:58:47 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=793914c3

games-emulation/dolphin - Bumps to version 5.0

Package-Manager: portage-2.2.24

 games-emulation/dolphin/Manifest   |   1 +
 games-emulation/dolphin/dolphin-5.0.ebuild | 153 +
 .../files/dolphin-5.0-dynamic-llvm-detect.patch|  54 
 .../files/dolphin-5.0-miniupnpc-abi-14.patch   | 137 ++
 4 files changed, 345 insertions(+)

diff --git a/games-emulation/dolphin/Manifest b/games-emulation/dolphin/Manifest
index e127728..7bdb097 100644
--- a/games-emulation/dolphin/Manifest
+++ b/games-emulation/dolphin/Manifest
@@ -1,2 +1,3 @@
 DIST dolphin-4.0.2.zip 28261421 SHA256 
f20c824ee83c3a495fd019747d2f8254477b94c135415b386142f89716d05d66 SHA512 
5b1931a133fd431b8f03f47c4c1cfe89f752de17f792e2729421df439564d15a8e35b17e82e31cef99230157de4aa16b2572b28ad67f23ca23c5492972df2938
 WHIRLPOOL 
48dcc47de02e6aa25e5318bc2564df1ab510210556e3e7c9442f405abd04879b8cff85afb5f1fa7a36364902a472f18bf5fa8da3a9db59b915d41d4e60f3b235
 DIST dolphin-4.0.zip 23439392 SHA256 
a698caf05f47a55c30e09d0aab053a412df683de2e139a6348156b03c502a0ec SHA512 
02e366c2fa95ab5f37b0a66b94a5b56a632ef81e13febd982d6385cfaf7fa3edb4364180d4b8312e82bc7b8f150d02cde10248996f6a12286a20d684024aca20
 WHIRLPOOL 
0cb7b28b91f4b7bf93c56f2dd31d080e7e0418fb53d9cc9093ca995d2c99a1fa7d5d82111e2c8db363e2b07384be39ec0062ab0252233f480b8e45e9304e
+DIST dolphin-5.0.zip 28317729 SHA256 
2b1003360d52baf12a1bcd4d75f379749b0fd4001948ec1a24d0539c37aae055 SHA512 
1b1c0dd6da4ba7e9ffe30499fae582b922c9bbd8b3d8159fbf9f4bfa1e744ef5b4c00a85d34f7cdd6e01efa32133f59b2a1f42cafc9d620f7fc7462c4ba73615
 WHIRLPOOL 
73cc25bafcb0d32592e8ad799b0a3d458cfa944ad15380a3b8f1cf27f3e024c314b08469a17f6d92edced95631bba38e39e1ccd625227c0520813abbd399e0f4

diff --git a/games-emulation/dolphin/dolphin-5.0.ebuild 
b/games-emulation/dolphin/dolphin-5.0.ebuild
new file mode 100644
index 000..9ef670f
--- /dev/null
+++ b/games-emulation/dolphin/dolphin-5.0.ebuild
@@ -0,0 +1,153 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+WX_GTK_VER="3.0"
+
+inherit cmake-utils eutils pax-utils toolchain-funcs versionator wxwidgets 
games
+
+SRC_URI="https://github.com/${PN}-emu/${PN}/archive/${PV}-rc.zip -> ${P}.zip"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Gamecube and Wii game emulator"
+HOMEPAGE="https://www.dolphin-emu.org/;
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="alsa ao bluetooth doc ffmpeg lto +lzo openal opengl openmp portaudio 
pulseaudio"
+
+S=${WORKDIR}/${P}-rc/
+RDEPEND=">=media-libs/glew-1.10
+   >=media-libs/libsfml-2.1
+   >=net-libs/miniupnpc-1.8
+   sys-libs/readline:=
+   x11-libs/libXext
+   x11-libs/libXrandr
+   media-libs/libsdl2[haptic,joystick]
+   net-libs/polarssl[havege]
+   alsa? ( media-libs/alsa-lib )
+   ao? ( media-libs/libao )
+   bluetooth? ( net-wireless/bluez )
+   ffmpeg? ( virtual/ffmpeg
+   !!>=media-video/libav-10 )
+   lzo? ( dev-libs/lzo )
+   openal? ( media-libs/openal )
+   opengl? ( virtual/opengl )
+   portaudio? ( media-libs/portaudio )
+   pulseaudio? ( media-sound/pulseaudio )
+   "
+DEPEND="${RDEPEND}
+   app-arch/zip
+   media-gfx/nvidia-cg-toolkit
+   media-libs/freetype
+   media-libs/libsoundtouch
+   >net-libs/enet-1.3.7
+   >=sys-devel/gcc-4.9.0
+   x11-libs/wxGTK:${WX_GTK_VER}
+   "
+
+pkg_pretend() {
+
+   local ver=4.9.0
+   local msg="${PN} needs at least GCC ${ver} set to compile."
+
+   if [[ ${MERGE_TYPE} != binary ]]; then
+   if ! version_is_at_least ${ver} $(gcc-fullversion); then
+   eerror ${msg}
+   die ${msg}
+   fi
+   fi
+
+}
+
+src_prepare() {
+
+   epatch "${FILESDIR}"/"${P}"-dynamic-llvm-detect.patch
+   epatch "${FILESDIR}"/"${P}"-miniupnpc-abi-14.patch
+
+   # Remove automatic dependencies to prevent building without flags 
enabled.
+   if use !alsa; then
+   sed -i -e '/include(FindALSA/d' CMakeLists.txt || die
+   fi
+   if use !ao; then
+   sed -i -e '/check_lib(AO/d' CMakeLists.txt || die
+   fi
+   if use !bluetooth; then
+   sed -i -e '/check_lib(BLUEZ/d' CMakeLists.txt || die
+   fi
+   if use !openal; then
+   sed -i -e '/include(FindOpenAL/d' CMakeLists.txt || die
+   fi
+   if use !portaudio; then
+   sed -i -e '/CMAKE_

[gentoo-commits] proj/layman:master commit in: layman/

2015-11-28 Thread Devan Franchini
commit: c8f2cda02daf9752e0c169db2051ee33a4e1f9d7
Author: Devan Franchini  gentoo  org>
AuthorDate: Sun Nov 29 03:11:59 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sun Nov 29 03:12:02 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=c8f2cda0

updater.py: Adds expected "." to database migration check to ensure proper 
backup naming

 layman/updater.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layman/updater.py b/layman/updater.py
index 5cef2b0..6cd98c4 100644
--- a/layman/updater.py
+++ b/layman/updater.py
@@ -124,7 +124,7 @@ class Main(object):
 installed = self.config['installed']
 old_ext = os.path.splitext(installed)[1]
 backup_name = installed + '.' + self.config['db_type']
-if old_ext == self.config['db_type']:
+if old_ext == "." + self.config['db_type']:
 backup_name = installed + '.bak'
 new_name = installed.replace(old_ext, '.db')
 



[gentoo-commits] proj/layman:master commit in: layman/

2015-11-28 Thread Devan Franchini
commit: 491baec51fabb75160170dbea9b55887b1083773
Author: Devan Franchini  gentoo  org>
AuthorDate: Sun Nov 29 03:25:15 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sun Nov 29 03:25:17 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=491baec5

updater.py: Sets set_db_type installed var to new_name

Previously the set_db_type function would be passed the old installed
database name instead of the new one. This would lead to setting
the "installed" variable in the layman config to an incorrect one.

 layman/updater.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layman/updater.py b/layman/updater.py
index 6cd98c4..6384429 100644
--- a/layman/updater.py
+++ b/layman/updater.py
@@ -164,7 +164,7 @@ class Main(object):
'to_type': migrate_type}
 self.output.info(msg)
 
-self.set_db_type(migrate_type, os.path.basename(installed))
+self.set_db_type(migrate_type, os.path.basename(new_name))
 
 msg = '  Warning: Please be sure to update your config file via '\
   'the\n  `dispatch-conf` command or you *will* lose database '\



[gentoo-commits] repo/gentoo:master commit in: app-portage/layman/

2015-11-10 Thread Devan Franchini
commit: 730bf9aa6da814fbf66b03eba6142aea4d3bc7c7
Author: Devan Franchini  gentoo  org>
AuthorDate: Wed Nov 11 00:33:52 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Wed Nov 11 00:33:52 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=730bf9aa

Removes layman-2.3.0 ebuild in favor of revbump

Package-Manager: portage-2.2.20.1

 app-portage/layman/layman-2.3.0.ebuild | 92 --
 1 file changed, 92 deletions(-)

diff --git a/app-portage/layman/layman-2.3.0.ebuild 
b/app-portage/layman/layman-2.3.0.ebuild
deleted file mode 100644
index 567877a..000
--- a/app-portage/layman/layman-2.3.0.ebuild
+++ /dev/null
@@ -1,92 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
-PYTHON_REQ_USE="xml(+)"
-
-inherit eutils distutils-r1 linux-info prefix
-
-DESCRIPTION="Tool to manage Gentoo overlays"
-HOMEPAGE="http://layman.sourceforge.net;
-SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~s390 ~x86"
-IUSE="bazaar cvs darcs +git gpg g-sorcery mercurial squashfs subversion 
sync-plugin-portage test"
-
-DEPEND="test? ( dev-vcs/subversion )
-   >=dev-python/ssl-fetch-0.2[${PYTHON_USEDEP}]
-"
-
-RDEPEND="
-   bazaar? ( dev-vcs/bzr )
-   cvs? ( dev-vcs/cvs )
-   darcs? ( dev-vcs/darcs )
-   git? ( dev-vcs/git )
-   mercurial? ( dev-vcs/mercurial )
-   g-sorcery? ( app-portage/g-sorcery )
-   subversion? (
-   || (
-   >=dev-vcs/subversion-1.5.4[http]
-   >=dev-vcs/subversion-1.5.4[webdav-neon]
-   >=dev-vcs/subversion-1.5.4[webdav-serf]
-   )
-   )
-   sync-plugin-portage?  ( >=sys-apps/portage-2.2.16[${PYTHON_USEDEP}] )
-   !sync-plugin-portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
-   gpg? ( dev-python/pyGPG )
-   >=dev-python/ssl-fetch-0.2[${PYTHON_USEDEP}]
-   "
-
-layman_check_kernel_config() {
-   local CONFIG_CHECK
-   use squashfs && CONFIG_CHECK+=" ~BLK_DEV_LOOP ~SQUASHFS"
-   [[ -n ${CONFIG_CHECK} ]] && check_extra_config
-}
-
-pkg_pretend() {
-   layman_check_kernel_config
-}
-
-pkg_setup() {
-   layman_check_kernel_config
-}
-
-python_prepare_all()  {
-   python_setup
-   esetup.py setup_plugins
-   distutils-r1_python_prepare_all
-   #rm "${S}"/"${PN}"/tests/dtest.py
-   eprefixify etc/layman.cfg layman/config.py
-}
-
-python_test() {
-   for suite in layman/tests/external.py ; do
-   PYTHONPATH="." "${PYTHON}" ${suite} \
-   || die "test suite '${suite}' failed"
-   done
-}
-
-python_install_all() {
-   distutils-r1_python_install_all
-
-   insinto /etc/layman
-   doins etc/layman.cfg
-
-   doman doc/layman.8
-   dohtml doc/layman.8.html
-
-   keepdir /var/lib/layman
-   keepdir /etc/layman/overlays
-}
-
-pkg_postinst() {
-   # now run layman's update utility
-   einfo "Running layman-updater..."
-   "${EROOT}"/usr/bin/layman-updater
-   einfo
-}



[gentoo-commits] repo/gentoo:master commit in: app-portage/layman/

2015-11-10 Thread Devan Franchini
commit: 7972dbd0a418f1e23cff2d17038b1494219e97dd
Author: Devan Franchini  gentoo  org>
AuthorDate: Wed Nov 11 00:31:49 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Wed Nov 11 00:31:49 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7972dbd0

Adds python3_5 to PYTHON_COMPAT in revbump

Package-Manager: portage-2.2.20.1

 app-portage/layman/layman-2.3.0-r1.ebuild | 92 +++
 1 file changed, 92 insertions(+)

diff --git a/app-portage/layman/layman-2.3.0-r1.ebuild 
b/app-portage/layman/layman-2.3.0-r1.ebuild
new file mode 100644
index 000..3ef4bca
--- /dev/null
+++ b/app-portage/layman/layman-2.3.0-r1.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} pypy )
+PYTHON_REQ_USE="xml(+)"
+
+inherit eutils distutils-r1 linux-info prefix
+
+DESCRIPTION="Tool to manage Gentoo overlays"
+HOMEPAGE="http://layman.sourceforge.net;
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~s390 ~x86"
+IUSE="bazaar cvs darcs +git gpg g-sorcery mercurial squashfs subversion 
sync-plugin-portage test"
+
+DEPEND="test? ( dev-vcs/subversion )
+   >=dev-python/ssl-fetch-0.2[${PYTHON_USEDEP}]
+"
+
+RDEPEND="
+   bazaar? ( dev-vcs/bzr )
+   cvs? ( dev-vcs/cvs )
+   darcs? ( dev-vcs/darcs )
+   git? ( dev-vcs/git )
+   mercurial? ( dev-vcs/mercurial )
+   g-sorcery? ( app-portage/g-sorcery )
+   subversion? (
+   || (
+   >=dev-vcs/subversion-1.5.4[http]
+   >=dev-vcs/subversion-1.5.4[webdav-neon]
+   >=dev-vcs/subversion-1.5.4[webdav-serf]
+   )
+   )
+   sync-plugin-portage?  ( >=sys-apps/portage-2.2.16[${PYTHON_USEDEP}] )
+   !sync-plugin-portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
+   gpg? ( dev-python/pyGPG )
+   >=dev-python/ssl-fetch-0.2[${PYTHON_USEDEP}]
+   "
+
+layman_check_kernel_config() {
+   local CONFIG_CHECK
+   use squashfs && CONFIG_CHECK+=" ~BLK_DEV_LOOP ~SQUASHFS"
+   [[ -n ${CONFIG_CHECK} ]] && check_extra_config
+}
+
+pkg_pretend() {
+   layman_check_kernel_config
+}
+
+pkg_setup() {
+   layman_check_kernel_config
+}
+
+python_prepare_all()  {
+   python_setup
+   esetup.py setup_plugins
+   distutils-r1_python_prepare_all
+   #rm "${S}"/"${PN}"/tests/dtest.py
+   eprefixify etc/layman.cfg layman/config.py
+}
+
+python_test() {
+   for suite in layman/tests/external.py ; do
+   PYTHONPATH="." "${PYTHON}" ${suite} \
+   || die "test suite '${suite}' failed"
+   done
+}
+
+python_install_all() {
+   distutils-r1_python_install_all
+
+   insinto /etc/layman
+   doins etc/layman.cfg
+
+   doman doc/layman.8
+   dohtml doc/layman.8.html
+
+   keepdir /var/lib/layman
+   keepdir /etc/layman/overlays
+}
+
+pkg_postinst() {
+   # now run layman's update utility
+   einfo "Running layman-updater..."
+   "${EROOT}"/usr/bin/layman-updater
+   einfo
+}



[gentoo-commits] repo/gentoo:master commit in: app-portage/layman/

2015-11-10 Thread Devan Franchini
commit: 6375e89fb83a8353d557aecd3d0b8aa7729cd9b5
Author: Devan Franchini  gentoo  org>
AuthorDate: Tue Nov 10 23:23:42 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Tue Nov 10 23:23:42 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6375e89f

Adds python3_5 to PYTHON_COMPAT

Package-Manager: portage-2.2.20.1

 app-portage/layman/layman-.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app-portage/layman/layman-.ebuild 
b/app-portage/layman/layman-.ebuild
index 1c1abf6..5d9a010 100644
--- a/app-portage/layman/layman-.ebuild
+++ b/app-portage/layman/layman-.ebuild
@@ -4,7 +4,7 @@
 
 EAPI="5"
 
-PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
+PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} pypy )
 PYTHON_REQ_USE="xml(+),sqlite?"
 
 inherit eutils distutils-r1 git-2 linux-info prefix



[gentoo-commits] proj/layman:master commit in: layman/

2015-10-16 Thread Devan Franchini
commit: d1c17e2c30f47ef5ac8450f269824976605b58a0
Author: Devan Franchini  gentoo  org>
AuthorDate: Fri Oct 16 18:19:27 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Fri Oct 16 18:19:31 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=d1c17e2c

dbbase.py: Creates internal function to get database module controller

This internal function centralizes the functionality of getting the
database module controller while also adding in checks to gracefully
handle invalid module names.

 layman/dbbase.py | 43 ---
 1 file changed, 24 insertions(+), 19 deletions(-)

diff --git a/layman/dbbase.py b/layman/dbbase.py
index dc089d8..ebcd7a4 100644
--- a/layman/dbbase.py
+++ b/layman/dbbase.py
@@ -36,7 +36,7 @@ import os
 import os.path
 import sys
 
-from   layman.module import Modules
+from   layman.module import Modules, InvalidModuleName
 from   layman.overlays.overlay   import Overlay
 
 
@@ -155,6 +155,26 @@ class DbBase(object):
 raise NotImplementedError(msg)
 
 
+def _get_dbctl(self, db_type):
+'''
+Returns database module controller for class or dies trying.
+'''
+try:
+db_ctl = self.mod_ctl.get_class(db_type)(self.config,
+self.overlays,
+self.paths,
+self.ignore,
+self.ignore_init_read_errors)
+except InvalidModuleName:
+msg = 'DbBase._get_dbctl() error:\nDatabase module name '\
+  '"%(name)s" is invalid or not found.\nPlease set db_type '\
+  'variable to proper value to continue.'\
+  % {'name': db_type.replace('_db', '')}
+self.output.die(msg)
+
+return db_ctl
+
+
 def add_new(self, xml=None, origin=None, from_dict=None):
 '''
 Reads xml text and dictionary definitions and adds
@@ -188,12 +208,7 @@ class DbBase(object):
 if 'cache' in path and '.xml' in path:
 db_type = 'xml_db'
 
-db_ctl = self.mod_ctl.get_class(db_type)(self.config,
- self.overlays,
- self.paths,
- self.ignore,
- self.ignore_init_read_errors)
-
+db_ctl = self._get_dbctl(db_type)
 db_ctl.read_db(path, text=text)
 
 
@@ -206,12 +221,7 @@ class DbBase(object):
 if migrate_type:
 db_type = migrate_type + '_db'
 
-db_ctl = self.mod_ctl.get_class(db_type)(self.config,
- self.overlays,
- self.paths,
- self.ignore,
- self.ignore_init_read_errors)
-
+db_ctl = self._get_dbctl(db_type)
 db_ctl.write(path, remove=remove)
 
 
@@ -219,12 +229,7 @@ class DbBase(object):
 '''
 Remove an overlay from the database.
 '''
-db_ctl = self.mod_ctl.get_class(self.db_type)(self.config,
- self.overlays,
- self.paths,
- self.ignore,
- self.ignore_init_read_errors)
-
+db_ctl = self._get_dbctl(db_type)
 db_ctl.remove(overlay, path)
 
 



[gentoo-commits] proj/layman:master commit in: /

2015-10-16 Thread Devan Franchini
commit: 861f9f8a7d4e5f1b4f527c81d5b71498551838a8
Author: Devan Franchini  gentoo  org>
AuthorDate: Fri Oct 16 18:55:23 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Fri Oct 16 18:55:23 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=861f9f8a

setup.py: Closes bracket for database module appending

 setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index d8f468d..140aacb 100755
--- a/setup.py
+++ b/setup.py
@@ -52,7 +52,7 @@ for mod in sorted(SELECTABLE):
 
 for plugin in sorted(DB_PLUGINS):
 if plugin in USE:
-modules.append(DB_PLUGINS[plugin]
+modules.append(DB_PLUGINS[plugin])
 
 for plugin in sorted(SYNC_PLUGINS):
 if plugin in USE:



[gentoo-commits] repo/gentoo:master commit in: app-portage/layman/

2015-10-16 Thread Devan Franchini
commit: 91d6125b5533cc9bd6b9ec5ba19370947f5ae70c
Author: Devan Franchini  gentoo  org>
AuthorDate: Fri Oct 16 21:02:21 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Fri Oct 16 21:09:03 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91d6125b

app-portage/layman: Adds sqlite USE flag to  ebuild

Package-Manager: portage-2.2.20.1

 app-portage/layman/layman-.ebuild | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/app-portage/layman/layman-.ebuild 
b/app-portage/layman/layman-.ebuild
index 1443944..1c1abf6 100644
--- a/app-portage/layman/layman-.ebuild
+++ b/app-portage/layman/layman-.ebuild
@@ -5,7 +5,7 @@
 EAPI="5"
 
 PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
-PYTHON_REQ_USE="xml(+)"
+PYTHON_REQ_USE="xml(+),sqlite?"
 
 inherit eutils distutils-r1 git-2 linux-info prefix
 
@@ -17,10 +17,11 @@ EGIT_REPO_URI="git://anongit.gentoo.org/proj/layman.git"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS=""
-IUSE="bazaar cvs darcs +git gpg g-sorcery mercurial squashfs subversion 
sync-plugin-portage test"
+IUSE="bazaar cvs darcs +git gpg g-sorcery mercurial sqlite squashfs subversion 
sync-plugin-portage test"
 
 DEPEND="test? ( dev-vcs/subversion )
-   app-text/asciidoc"
+   app-text/asciidoc
+   "
 
 RDEPEND="
bazaar? ( dev-vcs/bzr )



[gentoo-commits] proj/layman:master commit in: layman/

2015-10-16 Thread Devan Franchini
commit: 909afd209034ec26bca6f8c5d646852b2bd62c3e
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Oct 17 03:19:25 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Oct 17 03:19:28 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=909afd20

dbbase.py: Whitespace cleanup

Shamelessly hiding the fact that I'm also ammending the lack of
self.db_type use in the remove() function.

 layman/dbbase.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/layman/dbbase.py b/layman/dbbase.py
index ebcd7a4..c2b25b8 100644
--- a/layman/dbbase.py
+++ b/layman/dbbase.py
@@ -173,8 +173,8 @@ class DbBase(object):
 self.output.die(msg)
 
 return db_ctl
-
-
+
+
 def add_new(self, xml=None, origin=None, from_dict=None):
 '''
 Reads xml text and dictionary definitions and adds
@@ -229,7 +229,7 @@ class DbBase(object):
 '''
 Remove an overlay from the database.
 '''
-db_ctl = self._get_dbctl(db_type)
+db_ctl = self._get_dbctl(self.db_type)
 db_ctl.remove(overlay, path)
 
 



[gentoo-commits] proj/layman:master commit in: /

2015-10-16 Thread Devan Franchini
commit: 270a91aa1597b6637f297cba5dc8a334d9d59c58
Author: Devan Franchini  gentoo  org>
AuthorDate: Fri Oct 16 17:39:53 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Fri Oct 16 17:39:53 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=270a91aa

setup.py: Makes sqlite database backend option

 setup.py | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/setup.py b/setup.py
index a0343f9..d8f468d 100755
--- a/setup.py
+++ b/setup.py
@@ -28,6 +28,10 @@ SELECTABLE = {
 
 use_defaults = ' '.join(list(SELECTABLE))
 
+DB_PLUGINS = {
+'sqlite': 'layman.db_modules.sqlite_db'
+}
+
 SYNC_PLUGINS = {
 'sync-plugin-portage': 'portage.sync.modules.laymansync',
 }
@@ -46,11 +50,14 @@ for mod in sorted(SELECTABLE):
 if mod in USE:
 modules.append('layman.overlays.modules.%s' % SELECTABLE[mod])
 
+for plugin in sorted(DB_PLUGINS):
+if plugin in USE:
+modules.append(DB_PLUGINS[plugin]
+
 for plugin in sorted(SYNC_PLUGINS):
 if plugin in USE:
 modules.append(SYNC_PLUGINS[plugin])
 
-
 class setup_plugins(Command):
 """ Perform moves for the plugins into base namespace
 so they can be installed. """
@@ -84,9 +91,9 @@ setup(
 'http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=summary',
 packages  = ['layman', 'layman.config_modules',
 'layman.config_modules.makeconf', 'layman.config_modules.reposconf',
-'layman.db_modules', 'layman.db_modules.json_db', 
-'layman.db_modules.sqlite_db', 'layman.db_modules.xml_db',
-'layman.overlays', 'layman.overlays.modules',
+'layman.db_modules', 'layman.db_modules.json_db',
+'layman.db_modules.xml_db', 'layman.overlays',
+'layman.overlays.modules',
 ] + modules,
 scripts   = ['bin/layman', 'bin/layman-overlay-maker',
'bin/layman-mounter', 'bin/layman-updater'],



[gentoo-commits] proj/layman:master commit in: layman/

2015-10-16 Thread Devan Franchini
commit: a4ee3c8a29db32aad6e5b5404fbc1714185f7ab8
Author: Devan Franchini  gentoo  org>
AuthorDate: Fri Oct 16 18:47:06 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Fri Oct 16 18:47:06 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=a4ee3c8a

updater.py: Alters the way migrate_database handles an invalid db_type

Instead of showing the user the error and raising an exception, an
alternative method of dying after hitting the error has been
implemented.

 layman/updater.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/layman/updater.py b/layman/updater.py
index 25abf72..5cef2b0 100644
--- a/layman/updater.py
+++ b/layman/updater.py
@@ -118,8 +118,7 @@ class Main(object):
 if migrate_type not in DB_TYPES:
 msg = 'migrate_database() error; invalid migration type: '\
   '"%(db_type)s"' % {'db_type': migrate_type}
-self.output.error('  ' + msg)
-raise Exception(msg)
+self.output.die(msg)
 
 db = DB(self.config)
 installed = self.config['installed']



[gentoo-commits] proj/layman:master commit in: layman/

2015-09-23 Thread Devan Franchini
commit: dd07c3c8ff231ca440a19ad288603573be1a02bb
Author: Pastafarianist  gmail  com>
AuthorDate: Tue Sep 22 15:35:54 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Wed Sep 23 15:24:00 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=dd07c3c8

Improved grammar

Signed-off-by: Devan Franchini  gentoo.org>

 layman/db.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layman/db.py b/layman/db.py
index a7ed1ce..d67ea87 100644
--- a/layman/db.py
+++ b/layman/db.py
@@ -87,7 +87,7 @@ class DB(DbBase):
 @rtype bool: reflect the user's decision to install overlay.
 '''
 if self.config['check_official'] and not overlay.status == 'official':
-msg = 'Overlay "%(repo)s" is not an official. Continue install?'\
+msg = 'Overlay "%(repo)s" is not official. Continue installing?'\
   ' [y/n]: ' % {'repo': overlay.name}
 if not get_ans(msg, color='green'):
 msg = 'layman will not add "%(repo)s", due to user\'s'\



[gentoo-commits] proj/layman:master commit in: layman/

2015-09-05 Thread Devan Franchini
commit: 3ed3bc4d73658acc7f9541d34c7e9d1190211a41
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Sep  5 06:03:32 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Sep  5 06:03:35 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=3ed3bc4d

api.py: Corrects typo in enable/disable_repo functions()

References git issue #30.

 layman/api.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/layman/api.py b/layman/api.py
index 20fe402..2c46bb7 100755
--- a/layman/api.py
+++ b/layman/api.py
@@ -193,7 +193,7 @@ class LaymanAPI(object):
 for ovl in repos:
 if not self.is_repo(ovl):
 self.output.error(UnknownOverlayMessage(ovl))
-result.append(False)
+results.append(False)
 continue
 success = False
 try:
@@ -218,7 +218,7 @@ class LaymanAPI(object):
 for ovl in repos:
 if not self.is_repo(ovl):
 self.output.error(UnknownOverlayMessage(ovl))
-result.append(False)
+results.append(False)
 continue
 success = False
 try:



[gentoo-commits] proj/layman:master commit in: doc/, etc/

2015-09-05 Thread Devan Franchini
commit: 6177908118a2f7fd1765d5561177c8b1a2dc7061
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Sep  5 23:29:50 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Sep  5 23:29:50 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=61779081

Adds documentation for multiple database type support

 doc/layman.8.txt | 8 
 etc/layman.cfg   | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/doc/layman.8.txt b/doc/layman.8.txt
index cb391f1..4152566 100644
--- a/doc/layman.8.txt
+++ b/doc/layman.8.txt
@@ -287,6 +287,14 @@ git_postsync::
 These are a space separated list of commands that are run after each add, 
sync operation if they
 are defined.
 
+DATABASE CONFIGURATION OPTIONS
+~~
+*layman* now supports multiple database types for layman's install file. The
+options allowed include: *xml*, *json*, and *sqlite*. While xml is the default
+database type you may migrate from one database type to the other using the
+*layman-updater* tool while supplying the *-m* flag, followed by the database
+type you'd like to use.
+
 REPO CONFIGURATION OPTIONS
 ~~
 

diff --git a/etc/layman.cfg b/etc/layman.cfg
index e1caa33..c6038ee 100644
--- a/etc/layman.cfg
+++ b/etc/layman.cfg
@@ -68,7 +68,7 @@ conf_type : repos.conf
  Database Config Options   COMING SOON 
 #---
 # Database types used by layman, only one should be specified.
-# (xml, json)
+# (xml, json, sqlite)
 #db_type : xml
 
 #---



[gentoo-commits] proj/layman:master commit in: /

2015-09-05 Thread Devan Franchini
commit: 64f2c5530097774d063fac98ca7bdbfe1c5abebc
Author: Devan Franchini  gentoo  org>
AuthorDate: Sat Sep  5 23:30:23 2015 +
Commit:     Devan Franchini  gentoo  org>
CommitDate: Sat Sep  5 23:30:23 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=64f2c553

CHANGES: Updates to reflect new changes

 CHANGES | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/CHANGES b/CHANGES
index af7da09..f35ee3b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,8 +1,18 @@
 CHANGES
 ---
 
-Version 2.3.1 - Release 2015-03-28
+Version 2.4.0 - Release 2015-??-??
 ==
+ - adds support for different overlay database types
+ - adds json database support
+ - adds sqlite database support
+ - adds database migration tool in layman-updater
+ - adds AddDeleteDB tests in test suite
+ - adds file locker utility class
+ - corrects importing of laymansync classes
+ - corrects type in enable/disable_repos()
+ - adds multiple owner support
+ - deprecates get_all_info() function
  - adds repos.conf dir creation if it doesn't exist
  - fixes bug #540012
  - moves Layman class initialization into a layman sub-file



[gentoo-commits] proj/layman:master commit in: layman/

2015-08-27 Thread Devan Franchini
commit: d5ca0ce0d10220401176b981882349c9f25294c4
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Fri Aug 28 01:45:45 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Fri Aug 28 01:47:15 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=d5ca0ce0

maker.py: Modifies query prompts

These modifications remove a lot of duplicated prompts that were created
when trying to prompt the user for an item that could be of more than
one value.

 layman/maker.py | 70 ++---
 1 file changed, 27 insertions(+), 43 deletions(-)

diff --git a/layman/maker.py b/layman/maker.py
index 06d624b..c184f6b 100644
--- a/layman/maker.py
+++ b/layman/maker.py
@@ -295,11 +295,11 @@ class Interactive(object):
 feeds = []
 
 for i in range(1, feed_amount + 1):
+extra = ''
 if feed_amount  1:
-msg = 'Define overlay feed[%(i)s]: ' % ({'i': str(i)})
-feeds.append(get_input(msg))
-else:
-feeds.append(get_input('Define overlay feed: '))
+extra = '[%(i)s]' % {'i': str(i)}
+feeds.append(get_input('Define overlay%(extra)s feed: '\
+ % {'extra': extra}))
 
 self.overlay['feed'] = feeds
 self.output.notice('')
@@ -344,48 +344,32 @@ class Interactive(object):
 for i in range(1, source_amount + 1):
 sources = []
 correct = False
+extra = ''
 if source_amount  1:
-msg = 'Define source[%(i)s]\'s URL: ' % ({'i': str(i)})
-sources.append(get_input(msg))
+extra = '[%(i)s]\'s' % {'i': str(i)}
 
-ovl_type = self.guess_overlay_type(sources[0])
-if ovl_type:
-msg = 'Is %(type)s the correct overlay type?: '\
-% ({'type': ovl_type})
-correct = get_ans(msg)
-while not ovl_type or not correct:
-msg = 'Please provide overlay type: '
-ovl_type = self.check_overlay_type(\
-get_input(msg, color='yellow'))
-correct = True
-
-sources.append(ovl_type)
-if 'branch' in self.required:
-msg = 'Define source[%(i)s]\'s branch (if applicable): '\
-  % ({'i': str(i)})
-sources.append(get_input(msg))
-else:
-sources.append('')
+msg = 'Define source%(extra)s URL: ' % {'extra': extra}
+sources.append(get_input(msg))
+
+ovl_type = self.guess_overlay_type(sources[0])
+if ovl_type:
+msg = 'Is %(type)s the correct overlay type?: '\
+% ({'type': ovl_type})
+correct = get_ans(msg)
+while not ovl_type or not correct:
+msg = 'Please provide overlay type: '
+ovl_type = self.check_overlay_type(\
+get_input(msg, color='yellow'))
+correct = True
+
+sources.append(ovl_type)
+if 'branch' in self.required:
+msg = 'Define source%(extra)s branch (if applicable): '\
+  % {'extra': extra}
+sources.append(get_input(msg))
 else:
-sources.append(get_input('Define source URL: '))
-
-ovl_type = self.guess_overlay_type(sources[0])
-if ovl_type:
-msg = 'Is %(type)s the correct overlay type?: '\
-   % ({'type': ovl_type})
-correct = get_ans(msg)
-while not ovl_type or not correct:
-msg = 'Please provide overlay type: '
-ovl_type = self.check_overlay_type(\
-   get_input(msg, color='yellow'))
-correct = True
-
-sources.append(ovl_type)
-if 'branch' in self.required:
-msg = 'Define source branch (if applicable): '
-sources.append(get_input(msg))
-else:
-sources.append('')
+sources.append('')
+
 if self.auto_complete:
 sources = self._set_additional_info(sources)
 for source in sources:



[gentoo-commits] proj/layman:master commit in: layman/

2015-08-27 Thread Devan Franchini
commit: a84d2c42eda377be883b889fbe3d094ecc48221e
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Fri Aug 28 01:33:19 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Fri Aug 28 01:47:11 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=a84d2c42

maker.py: Adds multiple owner user query

 layman/maker.py | 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/layman/maker.py b/layman/maker.py
index caf5655..06d624b 100644
--- a/layman/maker.py
+++ b/layman/maker.py
@@ -401,9 +401,25 @@ class Interactive(object):
 then appends the values to the overlay
 being created.
 '''
+self.overlay['owner'] = []
 self.output.notice('')
-self.overlay['owner_name'] = get_input('Define owner name: ')
-self.overlay['owner_email'] = get_input('Define owner email: ')
+
+msg = 'How many people own this overlay?: '
+owner_amount = int(get_input(msg))
+
+for i in range(1, owner_amount + 1):
+owner = {}
+extra = ''
+
+if owner_amount  1:
+extra = '[%(i)s]\'s' % {'i': str(i)}
+
+owner['name'] = get_input('Define owner%(extra)s name: '\
+% {'extra': extra})
+owner['email'] = get_input('Define owner%(extra)s email: '\
+ % {'extra': extra})
+self.overlay['owner'].append(owner)
+
 self.output.notice('')
 
 



[gentoo-commits] proj/layman:master commit in: layman/

2015-08-27 Thread Devan Franchini
commit: b5239542b305a6b2638b5dc8cfe19ddb3fe09ef4
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Fri Aug 28 00:52:16 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Fri Aug 28 00:52:18 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=b5239542

utils.py: Gives create_overlay_dict a well needed updating

As this function exists with the API consumer in mind the function
was well overdue for getting it the result keys updated to reflect
all the ongoing changes in layman's API.

 layman/utils.py | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/layman/utils.py b/layman/utils.py
index b8e1e2a..9530701 100644
--- a/layman/utils.py
+++ b/layman/utils.py
@@ -331,13 +331,12 @@ def create_overlay_dict(**kwargs):
 
 result = {
 'name': '',
-'owner_name': '',
-'owner_email': '',
+'owner': [],
 'homepage': '',
 'irc': '',
-'description': '',
-'feeds': [],
-'sources': [('','','')],
+'description': [],
+'feed': [],
+'source': [('','','')],
 'priority': 50,
 'quality': 'experimental',
 'status': '',



[gentoo-commits] proj/layman:master commit in: layman/overlays/

2015-08-27 Thread Devan Franchini
commit: 4c8a81001eb813a4ec25584cacdd97c87f176c84
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Fri Aug 28 03:47:35 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Fri Aug 28 03:47:38 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=4c8a8100

overlay.py: Fixes method of assigning owner info if contact attrib is found

Prior to this commit the overlay would not set the owner info if the
contact attribute was found, breaking backwards compatibility. To allow
for this backwards compatibility while maintaining multiple owner
support layman will be defaulting to the contact attribute if it is
present in any XML overlays.

 layman/overlays/overlay.py | 49 --
 1 file changed, 26 insertions(+), 23 deletions(-)

diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index 8052d4c..9cbeb99 100755
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -454,32 +454,35 @@ class Overlay(object):
 _owners = xml.findall('owner')
 self.owners = []
 
-for _owner in _owners:
-owner = {}
+# For backwards compatibility with older Overlay XML formats
+# default to this.
+if 'contact' in xml.attrib:
+owner = {'email': encode(xml.attrib['contact']),
+ 'name': None}
+self.owners.append(owner)
+else:
+for _owner in _owners:
+owner = {}
 
-_email = _owner.find('email')
-_name = _owner.find('name')
+_email = _owner.find('email')
+_name = _owner.find('name')
 
-if _name != None:
-owner['name'] = encode(strip_text(_name))
-else:
-owner['name'] = None
-if _email != None:
-owner['email'] = encode(strip_text(_email))
-else:
-owner['email'] = None
-msg = 'Overlay from_xml(), %(name)s is missing an '\
-  'owner.email entry!' % {'name': self.name}
-if not ignore:
-raise Exception(msg)
-elif ignore == 1:
-self.output.warn(msg, 4)
+if _name != None:
+owner['name'] = encode(strip_text(_name))
+else:
+owner['name'] = None
+if _email != None:
+owner['email'] = encode(strip_text(_email))
+else:
+owner['email'] = None
+msg = 'Overlay from_xml(), %(name)s is missing an '\
+  'owner.email entry!' % {'name': self.name}
+if not ignore:
+raise Exception(msg)
+elif ignore == 1:
+self.output.warn(msg, 4)
 
-# For backwards compatibility with older Overlay XML formats.
-if not _email and not _name and 'contact' in xml.attrib:
-owner['email'] = encode(xml.attrib['contact'])
-owner['name'] = None
-self.owners.append(owner)
+self.owners.append(owner)
 
 _desc = xml.findall('description')
 if _desc != None:



[gentoo-commits] proj/layman:master commit in: layman/tests/, layman/tests/testfiles/, layman/

2015-08-27 Thread Devan Franchini
commit: 794f56f5ae531a5b24200ad3c0d6cf7112305da8
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Fri Aug 28 03:37:32 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Fri Aug 28 03:40:15 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=794f56f5

Deprecates get_all_info() function

The api function get_all_info() is being deprecated as it was much
slower than the get_info_str() function and was no longer used in
layman's code. The only instance found making use of it was older test
code which has been changed to also use the get_info_str() function.

external.py: Deprecates the get_all_info() function and adds multiple
owner testing compatibility.
api.py: Removes the get_all_info() function.
cli.py: Removes commented out use of get_all_info() function.
global-overlays.json: Changes structure of 'owner' attribute to reflect
changes for multiple owner support.

 layman/api.py   | 69 -
 layman/cli.py   |  6 ---
 layman/tests/external.py| 40 ++---
 layman/tests/testfiles/global-overlays.json | 12 +++--
 4 files changed, 22 insertions(+), 105 deletions(-)

diff --git a/layman/api.py b/layman/api.py
index 0718dce..20fe402 100755
--- a/layman/api.py
+++ b/layman/api.py
@@ -237,75 +237,6 @@ class LaymanAPI(object):
 return True
 
 
-def get_all_info(self, repos, local=False):
-retrieves the recorded information about the repo(s)
-specified by repo-id
-
-@type repos: list of strings or string
-@param repos: ['repo-id1', ...] or 'repo-id'
-@rtype list of tuples [(str, bool, bool),...]
-@return: dictionary of dictionaries
-{'ovl1':
-{'name': str,
-'owner_name': str,
-'owner_email': str,
-' homepage': str,
-'description': str,
-'src_uris': list of str ['uri1',...]
-'src_type': str,
-'priority': int,
-'quality': str
-'status':,
-'official': bool,
-'supported': bool,
-},
-'ovl2': {...}
-}
-
-
-repos = self._check_repo_type(repos, get_info)
-result = {}
-
-if local:
-db = self._get_installed_db()
-else:
-db = self._get_remote_db()
-
-for ovl in repos:
-if not self.is_repo(ovl):
-self.output.error(UnknownOverlayMessage(ovl))
-result[ovl] = ('', False, False)
-continue
-try:
-overlay = db.select(ovl)
-except UnknownOverlayException as error:
-self._error(error)
-result[ovl] = ('', False, False)
-else:
-result[ovl] = {
-'name': overlay.name,
-'owner_name': overlay.owner_name,
-'owner_email': overlay.owner_email,
-'homepage': overlay.homepage,
-'irc': overlay.irc,
-'description': [e for e in overlay.descriptions],
-'feeds': overlay.feeds,
-'sources': [(e.src, e.type, e.branch) \
-for e in overlay.sources],
-#'src_uris': [e.src for e in overlay.sources],
-'src_uris': overlay.source_uris(),
-'src_types': overlay.source_types(),
-#'src_types': [e.type for e in overlay.sources],
-'priority': overlay.priority,
-'quality': overlay.quality,
-'status': overlay.status,
-'official': overlay.is_official(),
-'supported': overlay.is_supported(),
-}
-
-return result
-
-
 def get_info_str(self, repos, local=True, verbose=False, width=0):
 retrieves the string representation of the recorded information
 about the repo(s) specified by ovl

diff --git a/layman/cli.py b/layman/cli.py
index bb9ea6f..86d6e70 100644
--- a/layman/cli.py
+++ b/layman/cli.py
@@ -381,17 +381,11 @@ class Main(object):
 self.output.debug('Printing installed overlays.', 6)
 list_printer = ListPrinter(self.config)
 
-#
-# fast way
 info = self.api.get_info_list(verbose=self.config['verbose'],
   width=list_printer.width)
 #self.output.debug('CLI: ListLocal() info = %s' % len(info), 4)
 #self.output.debug('\n'.join([ str(x) for x in info]), 4)
 list_printer.print_shortlist(info, complain=True)
-#
-# slow way
-#info = self.api.get_all_info(self.api.get_installed(), local=True)
-#list_printer.print_fulldict(info, complain=_complain)
 
 # blank newline

[gentoo-commits] proj/layman:master commit in: layman/overlays/

2015-08-27 Thread Devan Franchini
commit: 8363c11894f9fc724f1c5d46d115c3d5919cbc37
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Fri Aug 28 02:54:22 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Fri Aug 28 02:54:26 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=8363c118

overlay.py: Modifies __eq__ attribute requirements

The previous method still made use of owner_name and owner_email to see
if the two were equal while it should've been checking for the owners
overlay attribute.

 layman/overlays/overlay.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index 11536d4..8052d4c 100755
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -76,8 +76,8 @@ class Overlay(object):
 
 
 def __eq__(self, other):
-for i in ('descriptions', 'homepage', 'name', 'owner_email',
-'owner_name', 'priority', 'status'):
+for i in ('descriptions', 'homepage', 'name', 'owners', 'priority',
+  'status'):
 if getattr(self, i) != getattr(other, i):
 return False
 for i in self.sources + other.sources:



[gentoo-commits] proj/layman:master commit in: layman/overlays/, layman/db_modules/sqlite_db/

2015-08-27 Thread Devan Franchini
commit: 03f39c1a46149d472797e4adb6654705579c412c
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Fri Aug 28 00:36:37 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Fri Aug 28 00:36:40 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=03f39c1a

Adds multiple owner support to layman overlays

 layman/db_modules/sqlite_db/sqlite_db.py |  69 -
 layman/overlays/overlay.py   | 164 ++-
 2 files changed, 137 insertions(+), 96 deletions(-)

diff --git a/layman/db_modules/sqlite_db/sqlite_db.py 
b/layman/db_modules/sqlite_db/sqlite_db.py
index 22ae5f3..a3305a7 100644
--- a/layman/db_modules/sqlite_db/sqlite_db.py
+++ b/layman/db_modules/sqlite_db/sqlite_db.py
@@ -172,12 +172,21 @@ class DBHandler(object):
 cursor.execute('''SELECT Owner_Email, Owner_Name FROM 
 Overlay_Owner JOIN Overlay USING (Overlay_ID) JOIN Owner USING 
 (Owner_ID) WHERE Overlay_ID = ?''', (overlay_id,))
-owner_info = cursor.fetchall()[0]
-
-overlay['owner_email'] = owner_info[0]
-
-if len(owner_info)  1:
-overlay['owner_name'] = owner_info[1]
+owner_info = cursor.fetchall()
+overlay['owner'] = []
+
+for _owner in owner_info:
+owner = {}
+if _owner[0]:
+owner['email'] = _owner[0]
+else:
+owner['email'] = None
+if len(_owner)  1:
+if _owner[1]:
+owner['name'] = _owner[1]
+else:
+owner['name'] = None
+overlay['owner'].append(owner)
 
 cursor.execute('''SELECT Description FROM Description JOIN 
 Overlay USING (Overlay_ID) WHERE Overlay_ID = ?''',
@@ -225,7 +234,7 @@ class DBHandler(object):
 '''
 overlay_id = None
 owner_id = None
-source_ids = []
+source_id = None
 cursor = None
 
 cursor = connection.cursor()
@@ -239,22 +248,37 @@ class DBHandler(object):
 (overlay.name,))
 overlay_id = cursor.fetchone()[0]
 
-cursor.execute('''INSERT INTO Owner ( Owner_Name, Owner_Email ) 
-VALUES ( ?, ? )''', (overlay.owner_name, overlay.owner_email,))
-connection.commit()
+for owner in overlay.owners:
+_name = owner['name']
+_email = owner['email']
+
+cursor.execute('''INSERT INTO Owner ( Owner_Name, Owner_Email ) 
+VALUES ( ?, ? )''', (owner['name'], owner['email'],))
+connection.commit()
+
+if _name != None:
+cursor.execute('''SELECT Owner_ID from Owner WHERE 
+Owner_Email = ? AND Owner_Name = ?''', (_email, _name,))
+else:
+cursor.execute('''SELECT Owner_ID from Owner WHERE 
+Owner_Email = ?''', (_email,))
+owner_id = cursor.fetchone()[0]
 
-cursor.execute('''SELECT Owner_ID from Owner WHERE Owner_Email = ?;''',
-(overlay.owner_email,))
-owner_id = cursor.fetchone()[0]
+cursor.execute('''INSERT INTO Overlay_Owner ( Overlay_ID, 
+Owner_ID ) VALUES ( ?, ? )''', (overlay_id, owner_id,))
 
 for source in overlay.sources:
 cursor.execute('''INSERT INTO Source ( Type, Branch, URL )
 VALUES ( ?, ?, ? )''', (source.type_key, source.branch,
 source.src,))
 connection.commit()
+
 cursor.execute('''SELECT Source_ID FROM Source WHERE URL = ?;''',
 (source.src,))
-source_ids.append(cursor.fetchone()[0])
+source_id = cursor.fetchone()[0]
+
+cursor.execute('''INSERT INTO Overlay_Source ( Overlay_ID, 
+Source_ID ) VALUES ( ?, ? )''', (overlay_id, source_id, ))
 
 for description in overlay.descriptions:
 cursor.execute('''INSERT INTO Description ( Overlay_ID, 
@@ -264,13 +288,6 @@ class DBHandler(object):
 cursor.execute('''INSERT INTO Feed ( Overlay_ID, Feed ) VALUES ( ?,
  ? )''', (overlay_id, feed,))
 
-cursor.execute('''INSERT INTO Overlay_Owner ( Overlay_ID, Owner_ID ) 
-VALUES ( ?, ? )''', (overlay_id, owner_id,))
-
-for source_id in source_ids:
-cursor.execute('''INSERT INTO Overlay_Source ( Overlay_ID, 
-Source_ID ) VALUES ( ?, ? )''', (overlay_id, source_id,))
-
 connection.commit()
 
 
@@ -280,7 +297,7 @@ class DBHandler(object):
 '''
 cursor = None
 overlay_id = 0
-owner_id = 0
+owner_ids = []
 source_ids = []
 
 if overlay.name in self.overlays:
@@ -295,7 +312,7 @@ class DBHandler(object

[gentoo-commits] proj/layman:master commit in: layman/overlays/

2015-08-27 Thread Devan Franchini
commit: bd5d65f3a1c6030fa63f6f3972a67f688d015cbc
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Thu Aug 27 17:36:22 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Thu Aug 27 17:36:22 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=bd5d65f3

overlay.py: Improves to_json() setting of descriptions

 layman/overlays/overlay.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index 31fe400..defa4e3 100755
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -661,9 +661,7 @@ class Overlay(object):
 if self.license != None:
 repo['@license'] = self.license
 repo['name'] = self.name
-repo['description'] = []
-for i in self.descriptions:
-repo['description'].append(i)
+repo['description'] = [i for i in self.descriptions]
 if self.homepage != None:
 repo['homepage'] = self.homepage
 if self.irc != None:



[gentoo-commits] proj/layman:master commit in: layman/db_modules/sqlite_db/, layman/db_modules/json_db/, layman/, ...

2015-08-15 Thread Devan Franchini
commit: a7a267a46660e168bc1d46c4b39c4e89bed20767
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Sat Aug 15 08:00:35 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Sat Aug 15 08:00:37 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=a7a267a4

Adds remove parameter to database write() function

This parameter has been added in order to obtain proper
parallelization support for layman sqlite databases. With this
additional parameter it prompts the sqlite db module's write function to
simply return when removing an overlay, preventing it from re-adding any
database entires and causing oddness, run-time errors, or other unwanted
badness.

 layman/db.py |  2 +-
 layman/db_modules/json_db/json_db.py |  2 +-
 layman/db_modules/sqlite_db/sqlite_db.py | 11 +++
 layman/db_modules/xml_db/xml_db.py   |  2 +-
 layman/dbbase.py |  4 ++--
 5 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/layman/db.py b/layman/db.py
index 673e6bf..a7ed1ce 100644
--- a/layman/db.py
+++ b/layman/db.py
@@ -149,7 +149,7 @@ class DB(DbBase):
 overlay.delete(self.config['storage'])
 repo_ok = self.repo_conf.delete(overlay)
 self.remove(overlay, self.path)
-self.write(self.path)
+self.write(self.path, remove=True)
 else:
 self.output.error('No local overlay named ' + overlay.name + '!')
 return False

diff --git a/layman/db_modules/json_db/json_db.py 
b/layman/db_modules/json_db/json_db.py
index d466385..70e41d5 100644
--- a/layman/db_modules/json_db/json_db.py
+++ b/layman/db_modules/json_db/json_db.py
@@ -112,7 +112,7 @@ class DBHandler(object):
 del self.overlays[overlay.name]
 
 
-def write(self, path):
+def write(self, path, remove=False):
 '''
 Write the list of overlays to a file.
 '''

diff --git a/layman/db_modules/sqlite_db/sqlite_db.py 
b/layman/db_modules/sqlite_db/sqlite_db.py
index 6619699..22ae5f3 100644
--- a/layman/db_modules/sqlite_db/sqlite_db.py
+++ b/layman/db_modules/sqlite_db/sqlite_db.py
@@ -283,6 +283,9 @@ class DBHandler(object):
 owner_id = 0
 source_ids = []
 
+if overlay.name in self.overlays:
+del self.overlays[overlay.name]
+
 with self.__connect__(path) as connection:
 cursor = connection.cursor()
 
@@ -318,14 +321,14 @@ class DBHandler(object):
 
 connection.commit()
 
-if overlay.name in self.overlays:
-del self.overlays[overlay.name]
-
 
-def write(self, path):
+def write(self, path, remove=False):
 '''
 Write the list of overlays to the database.
 '''
+if remove:
+return
+
 try:
 with self.__connect__(path) as connection:
 for overlay in self.overlays:

diff --git a/layman/db_modules/xml_db/xml_db.py 
b/layman/db_modules/xml_db/xml_db.py
index 316d8f9..fbd7a6a 100644
--- a/layman/db_modules/xml_db/xml_db.py
+++ b/layman/db_modules/xml_db/xml_db.py
@@ -157,7 +157,7 @@ class DBHandler(object):
 del self.overlays[overlay.name]
 
 
-def write(self, path):
+def write(self, path, remove=False):
 '''
 Write the list of overlays to a file.
 '''

diff --git a/layman/dbbase.py b/layman/dbbase.py
index cecbf5c..dc089d8 100644
--- a/layman/dbbase.py
+++ b/layman/dbbase.py
@@ -197,7 +197,7 @@ class DbBase(object):
 db_ctl.read_db(path, text=text)
 
 
-def write(self, path, migrate_type=None):
+def write(self, path, remove=False, migrate_type=None):
 '''
 Write the list of overlays to a file.
 '''
@@ -212,7 +212,7 @@ class DbBase(object):
  self.ignore,
  self.ignore_init_read_errors)
 
-db_ctl.write(path)
+db_ctl.write(path, remove=remove)
 
 
 def remove(self, overlay, path):



[gentoo-commits] proj/layman:master commit in: layman/db_modules/sqlite_db/

2015-08-13 Thread Devan Franchini
commit: 3e582a86a5389c5013fd0b8c5a6cc964d3252a2c
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Thu Aug 13 07:04:40 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Thu Aug 13 07:04:44 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=3e582a86

sqlite_db.py: Modifies owner information gathering method

Due to the fact that including the owner name isn't necessary layman
needed to modify the way it gathered owner information to prevent
run-time errors.

 layman/db_modules/sqlite_db/sqlite_db.py | 23 +--
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/layman/db_modules/sqlite_db/sqlite_db.py 
b/layman/db_modules/sqlite_db/sqlite_db.py
index 14bfa25..6619699 100644
--- a/layman/db_modules/sqlite_db/sqlite_db.py
+++ b/layman/db_modules/sqlite_db/sqlite_db.py
@@ -169,15 +169,15 @@ class DBHandler(object):
 WHERE Overlay_ID = ?''', (overlay_id,))
 overlay['source'] = cursor.fetchall()
 
-cursor.execute('''SELECT Owner_Name, Owner_Email FROM 
+cursor.execute('''SELECT Owner_Email, Owner_Name FROM 
 Overlay_Owner JOIN Overlay USING (Overlay_ID) JOIN Owner USING 
 (Owner_ID) WHERE Overlay_ID = ?''', (overlay_id,))
-owner_info = cursor.fetchall()
+owner_info = cursor.fetchall()[0]
 
-if len(owner_info):
-owner_info = owner_info[0]
-overlay['owner_name'] = owner_info[0]
-overlay['owner_email'] = owner_info[1]
+overlay['owner_email'] = owner_info[0]
+
+if len(owner_info)  1:
+overlay['owner_name'] = owner_info[1]
 
 cursor.execute('''SELECT Description FROM Description JOIN 
 Overlay USING (Overlay_ID) WHERE Overlay_ID = ?''',
@@ -187,12 +187,7 @@ class DBHandler(object):
 overlay['status'] = overlay_info[3]
 overlay['quality'] = overlay_info[4]
 overlay['priority'] = overlay_info[2]
-
-if overlay_info[7]:
-overlay['license'] = overlay_info[7]
-else:
-overlay['license'] = None
-
+overlay['license'] = overlay_info[7]
 overlay['homepage'] = overlay_info[5]
 overlay['IRC'] = overlay_info[6]
 
@@ -248,8 +243,8 @@ class DBHandler(object):
 VALUES ( ?, ? )''', (overlay.owner_name, overlay.owner_email,))
 connection.commit()
 
-cursor.execute('''SELECT Owner_ID from Owner WHERE Owner_Name = ?;''',
-(overlay.owner_name,))
+cursor.execute('''SELECT Owner_ID from Owner WHERE Owner_Email = ?;''',
+(overlay.owner_email,))
 owner_id = cursor.fetchone()[0]
 
 for source in overlay.sources:



[gentoo-commits] proj/layman:master commit in: layman/db_modules/xml_db/, layman/db_modules/sqlite_db/, layman/, ...

2015-08-05 Thread Devan Franchini
commit: daafd7d31457b018797407d97188a4829839172e
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Wed Aug  5 05:55:16 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Wed Aug  5 05:58:59 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=daafd7d3

Adds remove function for overlay removal from databases

sqlite_db.py: Also changes the way in which feeds are gathered in
read_db(), this shows the nature of feeds being an unrequired attribute
of the overlay.

 layman/db.py |  2 +-
 layman/db_modules/json_db/__init__.py|  3 ++-
 layman/db_modules/json_db/json_db.py |  8 
 layman/db_modules/sqlite_db/__init__.py  |  5 +++--
 layman/db_modules/sqlite_db/sqlite_db.py | 23 ---
 layman/db_modules/xml_db/__init__.py |  3 ++-
 layman/db_modules/xml_db/xml_db.py   |  8 
 layman/dbbase.py | 13 +
 8 files changed, 53 insertions(+), 12 deletions(-)

diff --git a/layman/db.py b/layman/db.py
index ba7399c..673e6bf 100644
--- a/layman/db.py
+++ b/layman/db.py
@@ -148,7 +148,7 @@ class DB(DbBase):
 if overlay.name in self.overlays.keys():
 overlay.delete(self.config['storage'])
 repo_ok = self.repo_conf.delete(overlay)
-del self.overlays[overlay.name]
+self.remove(overlay, self.path)
 self.write(self.path)
 else:
 self.output.error('No local overlay named ' + overlay.name + '!')

diff --git a/layman/db_modules/json_db/__init__.py 
b/layman/db_modules/json_db/__init__.py
index 1502b9d..ac4daa7 100644
--- a/layman/db_modules/json_db/__init__.py
+++ b/layman/db_modules/json_db/__init__.py
@@ -13,10 +13,11 @@ module_spec = {
 'name': 'json_db',
 'class': 'DBHandler',
 'description': __doc__,
-'functions': ['add_new', 'read_db', 'write'],
+'functions': ['add_new', 'read_db', 'remove', 'write'],
 'func_desc': {
 'add_new': 'Adds overlay(s) from provided database text',
 'read_db': 'Reads the list of overlays from database file',
+'remove' : 'Removes overlay from installed overlays list',
 'write'  : 'Writes the list of overlays to database file',
 },
 }

diff --git a/layman/db_modules/json_db/json_db.py 
b/layman/db_modules/json_db/json_db.py
index 47413c6..d466385 100644
--- a/layman/db_modules/json_db/json_db.py
+++ b/layman/db_modules/json_db/json_db.py
@@ -104,6 +104,14 @@ class DBHandler(object):
 return True
 
 
+def remove(self, overlay, path):
+'''
+Removes an overlay from installed overlays list.
+'''
+if overlay.name in self.overlays:
+del self.overlays[overlay.name]
+
+
 def write(self, path):
 '''
 Write the list of overlays to a file.

diff --git a/layman/db_modules/sqlite_db/__init__.py 
b/layman/db_modules/sqlite_db/__init__.py
index 7d2fba4..536fc2d 100644
--- a/layman/db_modules/sqlite_db/__init__.py
+++ b/layman/db_modules/sqlite_db/__init__.py
@@ -13,10 +13,11 @@ module_spec = {
 'name': 'sqlite_db',
 'class': 'DBHandler',
 'description': __doc__,
-'functions': ['add_new', 'read_db', 'write'],
+'functions': ['add_new', 'read_db', 'remove', 'write'],
 'func_desc': {
-'add_new': 'Adds overlay(s) from provided database text',
+'add_new': 'Adds overlay(s) from provided database file',
 'read_db': 'Reads the list of overlays from database file',
+'remove' : 'Removes overlay from provided database file',
 'write'  : 'Writes the list of overlays to database file',
 },
 }

diff --git a/layman/db_modules/sqlite_db/sqlite_db.py 
b/layman/db_modules/sqlite_db/sqlite_db.py
index 1d079a3..aef9661 100644
--- a/layman/db_modules/sqlite_db/sqlite_db.py
+++ b/layman/db_modules/sqlite_db/sqlite_db.py
@@ -103,8 +103,8 @@ class DBHandler(object):
 cursor.execute('''CREATE TABLE IF NOT EXISTS Overlay
 ( Overlay_ID INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT, 
 Priority TEXT, Status TEXT, Quality TEXT, Homepage 
-TEXT, IRC TEXT, License TEXT, UNIQUE (Name, Homepage, License) 
-ON CONFLICT IGNORE )''')
+TEXT, IRC TEXT, License TEXT, UNIQUE (Name) ON CONFLICT IGNORE 
)
+''')
 cursor.execute('''CREATE TABLE IF NOT EXISTS Owner ( Owner_ID
 INTEGER PRIMARY KEY AUTOINCREMENT, Owner_Name TEXT, 
 Owner_Email TEXT, UNIQUE (Owner_Name, Owner_Email) ON 
@@ -180,15 +180,17 @@ class DBHandler(object):
 
 cursor.execute('''SELECT Description FROM Description JOIN Overlay 
 USING (Overlay_ID

[gentoo-commits] proj/layman:master commit in: layman/db_modules/sqlite_db/

2015-08-05 Thread Devan Franchini
commit: 59ce97acb46ddef1b564ab4032c145ed70c92427
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Wed Aug  5 06:22:24 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Wed Aug  5 06:22:31 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=59ce97ac

sqlite_db.py: read_db() connects to database with with command

 layman/db_modules/sqlite_db/sqlite_db.py | 107 ---
 1 file changed, 54 insertions(+), 53 deletions(-)

diff --git a/layman/db_modules/sqlite_db/sqlite_db.py 
b/layman/db_modules/sqlite_db/sqlite_db.py
index aef9661..14bfa25 100644
--- a/layman/db_modules/sqlite_db/sqlite_db.py
+++ b/layman/db_modules/sqlite_db/sqlite_db.py
@@ -148,63 +148,64 @@ class DBHandler(object):
 '''
 Read the overlay definitions from the database and generate overlays.
 '''
-connection = self.__connect__(path)
-cursor = connection.cursor()
+cursor = None
 overlay_id = None
 overlay = {}
 
-cursor.execute('''SELECT Overlay_ID, Name, Priority, Status, Quality, 
-Homepage, IRC, License FROM Overlay''')
-overlays_info = cursor.fetchall()
-connection.commit()
+with self.__connect__(path) as connection:
+cursor = connection.cursor()
+cursor.execute('''SELECT Overlay_ID, Name, Priority, Status, 
+Quality, Homepage, IRC, License FROM Overlay''')
+overlays_info = cursor.fetchall()
+connection.commit()
 
-for overlay_info in overlays_info:
-overlay = {}
-overlay_id = overlay_info[0]
-overlay['name'] = overlay_info[1]
-
-cursor.execute('''SELECT URL, Type, Branch FROM Overlay_Source 
-JOIN Overlay USING (Overlay_ID) JOIN Source USING (Source_ID) 
-WHERE Overlay_ID = ?''', (overlay_id,))
-overlay['source'] = cursor.fetchall()
-
-cursor.execute('''SELECT Owner_Name, Owner_Email FROM 
-Overlay_Owner JOIN Overlay USING (Overlay_ID) JOIN Owner USING 
-(Owner_ID) WHERE Overlay_ID = ?''', (overlay_id,))
-owner_info = cursor.fetchall()
-
-if len(owner_info):
-owner_info = owner_info[0]
-overlay['owner_name'] = owner_info[0]
-overlay['owner_email'] = owner_info[1]
-
-cursor.execute('''SELECT Description FROM Description JOIN Overlay 
-USING (Overlay_ID) WHERE Overlay_ID = ?''', (overlay_id,))
-overlay['description'] = cursor.fetchall()[0]
-
-overlay['status'] = overlay_info[3]
-overlay['quality'] = overlay_info[4]
-overlay['priority'] = overlay_info[2]
-
-if overlay_info[7]:
-overlay['license'] = overlay_info[7]
-else:
-overlay['license'] = None
-
-overlay['homepage'] = overlay_info[5]
-overlay['IRC'] = overlay_info[6]
-
-cursor.execute('''SELECT Feed FROM Feed JOIN Overlay USING 
-(Overlay_ID) WHERE Overlay_ID = ?''', (overlay_id,))
-overlay['feed'] = cursor.fetchall()
-
-if len(overlay['feed']):
-overlay['feed'] = overlay['feed'][0]
-
-self.overlays[overlay_info[1]] = Overlay(self.config,
- ovl_dict=overlay,
- ignore=self.ignore)
-connection.close()
+for overlay_info in overlays_info:
+overlay = {}
+overlay_id = overlay_info[0]
+overlay['name'] = overlay_info[1]
+
+cursor.execute('''SELECT URL, Type, Branch FROM Overlay_Source 
+JOIN Overlay USING (Overlay_ID) JOIN Source USING (Source_ID) 
+WHERE Overlay_ID = ?''', (overlay_id,))
+overlay['source'] = cursor.fetchall()
+
+cursor.execute('''SELECT Owner_Name, Owner_Email FROM 
+Overlay_Owner JOIN Overlay USING (Overlay_ID) JOIN Owner USING 
+(Owner_ID) WHERE Overlay_ID = ?''', (overlay_id,))
+owner_info = cursor.fetchall()
+
+if len(owner_info):
+owner_info = owner_info[0]
+overlay['owner_name'] = owner_info[0]
+overlay['owner_email'] = owner_info[1]
+
+cursor.execute('''SELECT Description FROM Description JOIN 
+Overlay USING (Overlay_ID) WHERE Overlay_ID = ?''',
+(overlay_id,))
+overlay['description'] = cursor.fetchall()[0]
+
+overlay['status'] = overlay_info[3]
+overlay['quality'] = overlay_info[4]
+overlay['priority'] = overlay_info[2]
+
+if overlay_info[7]:
+overlay['license

[gentoo-commits] proj/layman:master commit in: layman/, /, layman/db_modules/sqlite_db/

2015-08-03 Thread Devan Franchini
commit: b8963040c8da23570823075399ec807c2787f484
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Tue Aug  4 00:19:39 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Tue Aug  4 00:19:42 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=b8963040

Adds SQLite databasing module support

constants.py: Adds sqlite to list of supported database modules.
setup.py: Adds db_modules.sqlite_db.sqlite_db to list of installable
modules.

 layman/constants.py  |   2 +-
 layman/db_modules/sqlite_db/__init__.py  |  24 +++
 layman/db_modules/sqlite_db/sqlite_db.py | 332 +++
 setup.py |   4 +-
 4 files changed, 359 insertions(+), 3 deletions(-)

diff --git a/layman/constants.py b/layman/constants.py
index f8292f7..a83ce07 100644
--- a/layman/constants.py
+++ b/layman/constants.py
@@ -91,4 +91,4 @@ MOUNT_TYPES = ['Squashfs']
 ## Supported database types
 ##
 

-DB_TYPES = ['json', 'xml']
+DB_TYPES = ['json', 'sqlite', 'xml']

diff --git a/layman/db_modules/sqlite_db/__init__.py 
b/layman/db_modules/sqlite_db/__init__.py
new file mode 100644
index 000..7d2fba4
--- /dev/null
+++ b/layman/db_modules/sqlite_db/__init__.py
@@ -0,0 +1,24 @@
+# Copyright 2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+'''
+SQLite database plug-in module for layman.
+'''
+
+module_spec = {
+'name': 'sqlite_db',
+'description': __doc__,
+'provides':{
+'sqlite-module': {
+'name': 'sqlite_db',
+'class': 'DBHandler',
+'description': __doc__,
+'functions': ['add_new', 'read_db', 'write'],
+'func_desc': {
+'add_new': 'Adds overlay(s) from provided database text',
+'read_db': 'Reads the list of overlays from database file',
+'write'  : 'Writes the list of overlays to database file',
+},
+}
+}
+}

diff --git a/layman/db_modules/sqlite_db/sqlite_db.py 
b/layman/db_modules/sqlite_db/sqlite_db.py
new file mode 100644
index 000..1d079a3
--- /dev/null
+++ b/layman/db_modules/sqlite_db/sqlite_db.py
@@ -0,0 +1,332 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# LAYMAN SQLite DB
+#
+# File:   sqlite_db.py
+#
+# Access SQLite overlay database(s).
+#
+# Copyright:
+# (c) 2015Devan Franchini
+# Distributed under the terms of the GNU General Public License v2
+#
+# Author(s):
+# Devan Franchini twitch...@gentoo.org
+#
+'''Handler for sqlite overlay databases.'''
+
+from __future__ import unicode_literals
+
+__version__ = $Id: sqlite_db.py 273 2015-08-03 20:17:30Z twitch153 $
+
+#===
+#
+# Dependencies
+#
+#---
+
+import os
+import sys
+import sqlite3
+
+from   layman.overlays.overlay   import Overlay
+
+#py3.2+
+if sys.hexversion = 0x30200f0:
+_UNICODE = 'unicode'
+else:
+_UNICODE = 'UTF-8'
+
+
+#===
+#
+# Class DBHandler
+#
+#---
+
+class DBHandler(object):
+'''
+Handle a SQLite overlay database.
+'''
+
+def __init__(self, config, overlays, paths=None, ignore=0,
+ ignore_init_read_errors=False):
+
+self.config = config
+self.ignore = ignore
+self.overlays = overlays
+self.paths = paths
+self.output = config['output']
+self.ignore_init_read_errors = ignore_init_read_errors
+
+self.output.debug('Initializing SQLite overlay list handler', 8)
+
+
+def __connect__(self, path):
+'''
+Establish connection with the SQLite database.
+'''
+if not os.path.exists(path):
+if not self.ignore_init_read_errors:
+msg = 'SQLite DBHandler warning; database previously '\
+  'non-existent.\nCreating database now...'
+self.output.warn(msg, 2)
+
+if not os.access(os.path.dirname(path), os.W_OK):
+msg = 'SQLite DBHandler error; cannot create database.\n'
+errmsg = 'Write permissions are not given in dir: %(dir)s'\
+  % {'dir': os.path.dirname(path)}
+self.output.error(msg + errmsg)
+
+raise Exception(errmsg)
+
+if os.path.exists(path) and not os.access(path, os.R_OK):
+msg = 'SQLite DBHandler error; database

[gentoo-commits] proj/layman:master commit in: layman/overlays/

2015-08-03 Thread Devan Franchini
commit: 16752532c5f7e3dd74745f4ca093278f8c71a90f
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Mon Aug  3 20:26:41 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Mon Aug  3 20:26:41 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=16752532

overlay.py: Reorganizes imports and cleans up init params

 layman/overlays/overlay.py | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index 8f31a76..31fe400 100755
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -32,9 +32,12 @@ __version__ = 0.2
 #
 
#---
 
-import sys, re, os, os.path
 import codecs
 import locale
+import os
+import os.path
+import re
+import sys
 import xml.etree.ElementTree as ET # Python 2.5
 
 from  layman.compatibility import encode
@@ -56,8 +59,7 @@ WHITESPACE_REGEX = re.compile('\s+')
 class Overlay(object):
 ''' Derive the real implementations from this.'''
 
-def __init__(self, config, json=None, ovl_dict=None, xml=None,
-ignore = 0):
+def __init__(self, config, json=None, ovl_dict=None, xml=None, ignore=0):
 self.config = config
 self.output = config['output']
 self.module_controller = Modules(path=MOD_PATH,



[gentoo-commits] proj/layman:master commit in: layman/

2015-08-03 Thread Devan Franchini
commit: d95ae901856d94b2f7693b58aaa5618582c17280
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Tue Aug  4 01:02:38 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Tue Aug  4 01:02:38 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=d95ae901

update.py: Adds functionality to ensure proper sqlite migration

 layman/updater.py | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/layman/updater.py b/layman/updater.py
index 746373d..25abf72 100644
--- a/layman/updater.py
+++ b/layman/updater.py
@@ -140,7 +140,10 @@ class Main(object):
 self.output.info(msg)
 
 try:
-shutil.copy(installed, backup_name)
+if migrate_type in ('json', 'xml'):
+shutil.copy(installed, backup_name)
+else:
+shutil.move(installed, backup_name)
 except IOError as err:
 msg = '  migrate_database() error; failed to back up old database 
'\
   'file.\n  Error was: %(err)s' % {'err': err}



[gentoo-commits] proj/layman:master commit in: /

2015-08-03 Thread Devan Franchini
commit: e6fa93587985ce4b39d866c74775eda27a398c71
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Tue Aug  4 00:53:46 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Tue Aug  4 00:53:46 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=e6fa9358

setup.py: Fixes sqlite_db module name

 setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 8ff41b0..a0343f9 100755
--- a/setup.py
+++ b/setup.py
@@ -85,7 +85,7 @@ setup(
 packages  = ['layman', 'layman.config_modules',
 'layman.config_modules.makeconf', 'layman.config_modules.reposconf',
 'layman.db_modules', 'layman.db_modules.json_db', 
-'layman.db_modules.sqlite', 'layman.db_modules.xml_db',
+'layman.db_modules.sqlite_db', 'layman.db_modules.xml_db',
 'layman.overlays', 'layman.overlays.modules',
 ] + modules,
 scripts   = ['bin/layman', 'bin/layman-overlay-maker',



[gentoo-commits] proj/layman:master commit in: layman/overlays/

2015-07-21 Thread Devan Franchini
commit: 8133bd98d60e3e1ed38fa75662ae9b070a156336
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Tue Jul 21 16:37:53 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Tue Jul 21 16:37:53 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=8133bd98

overlay.py: Adds optional license attribute to overlay object

 layman/overlays/overlay.py | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index c6a0cee..8f31a76 100755
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -237,6 +237,11 @@ class Overlay(object):
 else:
 self.priority = 50
 
+if 'license' in overlay:
+self.license = encode(overlay['license'])
+else:
+self.license = None
+
 if 'homepage' in overlay:
 self.homepage = encode(overlay['homepage'])
 else:
@@ -352,6 +357,11 @@ class Overlay(object):
 else:
 self.priority = 50
 
+if '@license' in json:
+self.license = encode(json['@license'])
+else:
+self.license = None
+
 if 'homepage' in json:
 self.homepage = encode(json['homepage'])
 else:
@@ -486,6 +496,11 @@ class Overlay(object):
 else:
 self.priority = 50
 
+if 'license' in xml.attrib:
+self.license = encode(xml.attrib['license'])
+else:
+self.license = None
+
 h = xml.find('homepage')
 l = xml.find('link')
 
@@ -641,6 +656,8 @@ class Overlay(object):
 repo['@quality'] = self.quality
 if self.status != None:
 repo['@status'] = self.status
+if self.license != None:
+repo['@license'] = self.license
 repo['name'] = self.name
 repo['description'] = []
 for i in self.descriptions:
@@ -677,6 +694,8 @@ class Overlay(object):
 repo.attrib['status'] = self.status
 repo.attrib['quality'] = self.quality
 repo.attrib['priority'] = str(self.priority)
+if self.license != None:
+repo.attrib['license'] = self.license
 name = ET.Element('name')
 name.text = self.name
 repo.append(name)



[gentoo-commits] proj/layman:master commit in: layman/tests/testfiles/, layman/, layman/tests/

2015-07-20 Thread Devan Franchini
commit: e8160e953d4c1c9792c8640fd3edbe6ac1d39e9e
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Mon Jul 20 13:57:09 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Mon Jul 20 13:57:11 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=e8160e95

external.py: Adds json DB testing

updater.py: Adds proper line spacing for database migration output

 layman/tests/external.py| 28 ++
 layman/tests/testfiles/global-overlays.json | 44 +
 layman/updater.py   |  2 +-
 3 files changed, 73 insertions(+), 1 deletion(-)

diff --git a/layman/tests/external.py b/layman/tests/external.py
index e9f419a..f61d4b6 100755
--- a/layman/tests/external.py
+++ b/layman/tests/external.py
@@ -673,6 +673,7 @@ class ReadWriteSelectListDbBase(unittest.TestCase):
 
 def read_db(self):
 output = Message()
+# First test if XML databasing works.
 config = {'output': output,
   'db_type': 'xml',}
 db = DbBase(config, [HERE + '/testfiles/global-overlays.xml', ])
@@ -682,6 +683,15 @@ class ReadWriteSelectListDbBase(unittest.TestCase):
 url = ['rsync://gunnarwrobel.de/wrobel-stable']
 self.assertEqual(list(db.overlays['wrobel-stable'].source_uris()), url)
 
+# Test JSON databasing after.
+config['db_type'] = 'json'
+db = DbBase(config, [HERE + '/testfiles/global-overlays.json', ])
+keys = sorted(db.overlays)
+self.assertEqual(keys, ['twitch153', 'wrobel-stable'])
+
+url = ['git://github.com/twitch153/ebuilds.git']
+self.assertEqual(list(db.overlays['twitch153'].source_uris()), url)
+
 
 def select_db(self):
 output = Message()
@@ -691,10 +701,16 @@ class ReadWriteSelectListDbBase(unittest.TestCase):
 url = ['rsync://gunnarwrobel.de/wrobel-stable']
 self.assertEqual(list(db.select('wrobel-stable').source_uris()), url)
 
+config['db_type'] = 'json'
+db = DbBase(config, [HERE + '/testfiles/global-overlays.json', ])
+url = ['git://github.com/twitch153/ebuilds.git']
+self.assertEqual(list(db.select('twitch153').source_uris()), url)
+
 
 def write_db(self):
 tmpdir = tempfile.mkdtemp(prefix='laymantmp_')
 test_xml = os.path.join(tmpdir, 'test.xml')
+test_json = os.path.join(tmpdir, 'test.json')
 config = BareConfig()
 
 a = DbBase(config, [HERE + '/testfiles/global-overlays.xml', ])
@@ -707,8 +723,20 @@ class ReadWriteSelectListDbBase(unittest.TestCase):
 keys = sorted(c.overlays)
 self.assertEqual(keys, ['wrobel-stable'])
 
+config.set_option('db_type', 'json')
+a = DbBase(config, [HERE + '/testfiles/global-overlays.json', ])
+b = DbBase({'output': Message(), 'db_type': 'json'}, [test_json,])
+
+b.overlays['twitch153'] = a.overlays['twitch153']
+b.write(test_json)
+
+c = DbBase({'output': Message(), 'db_type': 'json'}, [test_json,])
+keys = sorted(c.overlays)
+self.assertEqual(keys, ['twitch153'])
+
 # Clean up:
 os.unlink(test_xml)
+os.unlink(test_json)
 shutil.rmtree(tmpdir)
 
 

diff --git a/layman/tests/testfiles/global-overlays.json 
b/layman/tests/testfiles/global-overlays.json
new file mode 100644
index 000..53267cf
--- /dev/null
+++ b/layman/tests/testfiles/global-overlays.json
@@ -0,0 +1,44 @@
+{
+  @encoding: unicode,
+  @version: 1.0,
+  repo: [
+{
+  @priority: 40,
+  @quality: experimental,
+  @status: unofficial,
+  description: [
+Twitch test
+  ],
+  feed: [
+https://github.com/twitch153/ebuilds/commits/master.atom;
+  ],
+  homepage: https://github.com/twitch153/ebuilds;,
+  name: twitch153,
+  owner: {
+email: twitch...@gentoo.org,
+name: Devan Franchini
+  },
+  source: [
+{
+  #text: git://github.com/twitch153/ebuilds.git,
+  @type: git
+}
+  ]
+},
+{
+  description: [
+A collection of ebuilds from Gunnar Wrobel [wro...@gentoo.org].
+  ],
+  name: wrobel-stable,
+  owner: {
+email: nob...@gentoo.org
+  },
+  source: [
+{
+  #text: rsync://gunnarwrobel.de/wrobel-stable,
+  @type: rsync
+}
+  ]
+}
+  ]
+}

diff --git a/layman/updater.py b/layman/updater.py
index 9d7b176..746373d 100644
--- a/layman/updater.py
+++ b/layman/updater.py
@@ -158,7 +158,7 @@ class Main(object):
 raise err
 
 msg = '  Successfully migrated database from %(from_type)s to '\
-  '%(to_type)s\n' % {'from_type': self.config['db_type'],
+  ' %(to_type)s\n' % {'from_type': self.config['db_type'],
'to_type': migrate_type}
 self.output.info(msg)
 



[gentoo-commits] proj/layman:master commit in: layman/

2015-07-18 Thread Devan Franchini
commit: 4adf2984147062b8cadc5e769aa49c48abab2e93
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Sun Jul 19 03:50:25 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Sun Jul 19 03:52:15 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=4adf2984

updater.py: Modifies the db_type setting method

In order to preserve the config file set up of the layman config
file the set_db_type() function has been modified to not use
configparser as it doesn't preserve comments. Changes have also
been made in case the database file ends with the old extension,
so the backup name will end in .bak as opposed to the database's
file type.

 layman/updater.py | 36 +---
 1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/layman/updater.py b/layman/updater.py
index f727632..9d7b176 100644
--- a/layman/updater.py
+++ b/layman/updater.py
@@ -7,6 +7,7 @@ import argparse
 import os
 import shutil
 import sys
+import re
 
 from layman.api   import LaymanAPI
 from layman.compatibility import fileopen
@@ -122,8 +123,10 @@ class Main(object):
 
 db = DB(self.config)
 installed = self.config['installed']
-backup_name = installed + '.' + self.config['db_type']
 old_ext = os.path.splitext(installed)[1]
+backup_name = installed + '.' + self.config['db_type']
+if old_ext == self.config['db_type']:
+backup_name = installed + '.bak'
 new_name = installed.replace(old_ext, '.db')
 
 if not os.path.isfile(installed):
@@ -271,17 +274,15 @@ class Main(object):
 repos_conf = ConfigHandler(self.config, overlays)
 repos_conf.write()
 
-def set_db_type(self, migrate_type, installed):
-if sys.hexversion = 0x30200f0:
-import configparser as ConfigParser
-else:
-import ConfigParser
 
-config = ConfigParser.ConfigParser()
+def set_db_type(self, migrate_type, installed):
 config_path = self.config['config']\
   % {'configdir': self.config['configdir']}
+db_type_found = False
+installed_found = False
 new_conf = os.path.dirname(config_path) + '/' + '._cfg_' +\
os.path.basename(config_path)
+new_lines = []
 
 try:
 shutil.copy(config_path, new_conf)
@@ -300,15 +301,28 @@ class Main(object):
 raise Exception(msg)
 
 try:
-config.read(new_conf)
+with fileopen(new_conf, 'r') as laymanconf:
+lines = laymanconf.readlines()
 except Exception as err:
 msg = '  set_db_type() error; failed to read config at 
%(path)s.'\
   '\n  Error was: %(err)s' % {'path': new_conf, 'err': err}
 self.output.error(msg)
 raise err
 
-config.set('MAIN', 'db_type', migrate_type)
-config.set('MAIN', 'installed', '%(storage)s/'+installed)
+for line in lines:
+if re.search('^#*\s*db_type\s*:', line):
+db_type_found = True
+line = 'db_type : ' + migrate_type + '\n'
+if re.search('^#*\s*installed\s*:', line):
+installed_found = True
+line = 'installed : %(storage)s/' + installed + '\n'
+new_lines.append(line)
+
+if not db_type_found:
+new_lines.append('db_type : ' + migrate_type + '\n')
+if not installed_found:
+new_lines.append('installed : %(storage)s/' + installed + '\n')
 
 with fileopen(new_conf, 'w') as laymanconf:
-config.write(laymanconf)
+for line in new_lines:
+laymanconf.write(line)



[gentoo-commits] proj/layman:master commit in: layman/

2015-07-17 Thread Devan Franchini
commit: 3c05ffbe24899799a6b744212e7308d251679932
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Fri Jul 17 16:25:59 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Fri Jul 17 16:26:44 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=3c05ffbe

updater.py: Cleans up imports

 layman/updater.py | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/layman/updater.py b/layman/updater.py
index 1959a31..54ea86a 100644
--- a/layman/updater.py
+++ b/layman/updater.py
@@ -3,15 +3,14 @@
 
 from __future__ import unicode_literals
 
-from sys import stderr
+import argparse
 import os
 import sys
-import argparse
 
-from layman.config import OptionConfig
-from layman.api import LaymanAPI
-from layman.version import VERSION
+from layman.api   import LaymanAPI
 from layman.compatibility import fileopen
+from layman.configimport OptionConfig
+from layman.version   import VERSION
 
 if sys.hexversion = 0x30200f0:
 STR = str



[gentoo-commits] proj/layman:master commit in: layman/

2015-07-17 Thread Devan Franchini
commit: 46846091abef6fb8339ad640c1baa25c63e85bc9
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Fri Jul 17 16:12:26 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Fri Jul 17 16:18:04 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=46846091

constants.py: Adds constant DB_TYPES for supported db checking

 layman/constants.py | 27 +--
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/layman/constants.py b/layman/constants.py
index a39071f..f8292f7 100644
--- a/layman/constants.py
+++ b/layman/constants.py
@@ -1,8 +1,8 @@
 #!/usr/bin/python
 # -*- coding: utf-8 -*-
-#
+
 # LAYMAN CONSTANTS
-#
+
 # File:   constants.py
 #
 # Handles layman actions via the command line interface.
@@ -26,11 +26,11 @@ __version__ = $Id: constants.py 2011-01-16 23:52 PST Brian 
Dolbec$
 
 
 
-#
+
 ##
 ## Color codes (taken from portage)
 ##
-#
+
 
 esc_seq = '\x1b['
 
@@ -57,31 +57,38 @@ DEBUG_VERBOSITY = 2
 FAILURE = 1
 SUCCEED = 0
 
-#
+
 ##
 ## Overlay components
 ##
-#
+
 
 COMPONENT_DEFAULTS  = ['name', 'description', 'owner', 'type', 'source']
 POSSIBLE_COMPONENTS = ['name', 'description', 'homepage', 'owner', 'quality',
'priority', 'source', 'branch', 'irc', 'feed']
 
-###
+
 ##
 ## Archive overlay possible file extensions
 ##
-###
+
 
 FILE_EXTENSIONS = {'Squashfs': ('.squashfs', '.squash', '.sqfs', '.sfs'),
'Tar': ('bz2', 'gz', 'lzma', 'xz', 'Z', 'tgz', 'tbz', 'taz',
'tlz', 'txz'),
   }
 
-###
+
 ##
 ## Overlay types mountable by script
 ##
-
+
 
 MOUNT_TYPES = ['Squashfs']
+
+
+##
+## Supported database types
+##
+
+DB_TYPES = ['json', 'xml']



[gentoo-commits] proj/layman:master commit in: layman/, layman/tests/, etc/

2015-07-17 Thread Devan Franchini
commit: 8fce6fd8a4057222edc07478c6ba19c68bb0aaa3
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Fri Jul 17 16:21:37 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Fri Jul 17 16:23:48 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=8fce6fd8

Removes unnecessary _db appendage to db_type var

To avoid namespace collisions in py2.7 the database modules needed
to have _db appended to their name. In order to avoid having this
ugliness in the user's config file and elsewhere in layman's code
the DbBase class simply adds the _db portion of the name itself.

 etc/layman.cfg   |  4 ++--
 layman/config.py |  2 +-
 layman/dbbase.py |  6 +++---
 layman/remotedb.py   |  2 +-
 layman/tests/external.py | 20 ++--
 5 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/etc/layman.cfg b/etc/layman.cfg
index 5101f4d..e1caa33 100644
--- a/etc/layman.cfg
+++ b/etc/layman.cfg
@@ -68,8 +68,8 @@ conf_type : repos.conf
  Database Config Options   COMING SOON 
 #---
 # Database types used by layman, only one should be specified.
-# (xml_db, json_db)
-#db_type : xml_db
+# (xml, json)
+#db_type : xml
 
 #---
 

diff --git a/layman/config.py b/layman/config.py
index 0ad975b..853e22f 100644
--- a/layman/config.py
+++ b/layman/config.py
@@ -100,7 +100,7 @@ class BareConfig(object):
 'auto_sync': 'No',
 'check_official': 'Yes',
 'conf_type': 'repos.conf',
-'db_type': 'xml_db',
+'db_type': 'xml',
 'require_repoconfig': 'Yes',
 'clean_archive': 'yes',
 'make_conf' : '%(storage)s/make.conf',

diff --git a/layman/dbbase.py b/layman/dbbase.py
index 283d65c..7832565 100644
--- a/layman/dbbase.py
+++ b/layman/dbbase.py
@@ -105,7 +105,7 @@ class DbBase(object):
   % {'db_types': self.db_type, 'db_type': self.db_type[0]}
 self.output.warn(msg)
 
-self.db_type = self.db_type[0]
+self.db_type = self.db_type[0] + '_db'
 
 for path in self.paths:
 if not os.path.exists(path):
@@ -182,7 +182,7 @@ class DbBase(object):
 db_type = self.db_type
 
 if text and text_type:
-db_type = text_type
+db_type = text_type + '_db'
 
 #Added to keep xml functionality for cached overlay XML definitions
 if 'cache' in path and '.xml' in path:
@@ -204,7 +204,7 @@ class DbBase(object):
 db_type = self.db_type
 
 if migrate_type:
-db_type = migrate_type
+db_type = migrate_type + '_db'
 
 db_ctl = self.mod_ctl.get_class(db_type)(self.config,
  self.overlays,

diff --git a/layman/remotedb.py b/layman/remotedb.py
index 89caf7a..b9c4ae0 100644
--- a/layman/remotedb.py
+++ b/layman/remotedb.py
@@ -280,7 +280,7 @@ class RemoteDB(DbBase):
 def _check_download(self, olist, url):
 
 try:
-self.read_db(url, text=olist, text_type=xml_db)
+self.read_db(url, text=olist, text_type=xml)
 except Exception as error:
 self.output.debug(RemoteDB._check_download(), url=%s \nolist:\n
 % url,2)

diff --git a/layman/tests/external.py b/layman/tests/external.py
index 01cf5b3..e9f419a 100755
--- a/layman/tests/external.py
+++ b/layman/tests/external.py
@@ -154,7 +154,7 @@ class AddDeleteDB(unittest.TestCase):
 
 my_opts = {'installed' : temp_xml_path,
'conf_type' : ['make.conf', 'repos.conf'],
-   'db_type'   : 'xml_db',
+   'db_type'   : 'xml',
'nocheck'   : 'yes',
'make_conf' : make_conf,
'repos_conf': repo_conf,
@@ -556,7 +556,7 @@ class OverlayObjTest(unittest.TestCase):
 overlays = document.findall('overlay') + document.findall('repo')
 output = Message()
 
-ovl_a = Overlay({'output': output, 'db_type': 'xml_db'}, 
xml=overlays[0])
+ovl_a = Overlay({'output': output, 'db_type': 'xml'}, xml=overlays[0])
 self.assertEqual(ovl_a.name, 'wrobel')
 self.assertEqual(ovl_a.is_official(), True)
 url = ['https://overlays.gentoo.org/svn/dev/wrobel']
@@ -565,7 +565,7 @@ class OverlayObjTest(unittest.TestCase):
 self.assertEqual(ovl_a.descriptions, ['Test'])
 self.assertEqual(ovl_a.priority, 10)
 
-ovl_b = Overlay({'output': output, 'db_type': 'xml_db'}, 
xml=overlays[1])
+ovl_b = Overlay({'output': output, 'db_type': 'xml'}, xml=overlays[1])
 self.assertEqual(ovl_b.is_official(), False)
 
 
@@ -574,7 +574,7 @@ class OverlayObjTest(unittest.TestCase):
 overlays = document.findall('overlay') + document.findall('repo')
 output = Message

[gentoo-commits] proj/layman:master commit in: layman/

2015-07-17 Thread Devan Franchini
commit: 8448d587d1e8367ba5b2cc5aa6214166dc0649f1
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Fri Jul 17 17:05:01 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Fri Jul 17 17:06:02 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=8448d587

updater.py: Adds database migration tool

 layman/updater.py | 105 +-
 1 file changed, 104 insertions(+), 1 deletion(-)

diff --git a/layman/updater.py b/layman/updater.py
index 54ea86a..f727632 100644
--- a/layman/updater.py
+++ b/layman/updater.py
@@ -5,11 +5,14 @@ from __future__ import unicode_literals
 
 import argparse
 import os
+import shutil
 import sys
 
 from layman.api   import LaymanAPI
 from layman.compatibility import fileopen
 from layman.configimport OptionConfig
+from layman.constants import DB_TYPES
+from layman.dbimport DB
 from layman.version   import VERSION
 
 if sys.hexversion = 0x30200f0:
@@ -56,6 +59,8 @@ class Main(object):
 help = 'Print the NEW INSTALL help messages.')
 self.parser.add_argument(-c, --config,
 help='the path to config file')
+self.parser.add_argument(-m, --migrate_db,
+help=the database you'd like to migrate to)
 self.parser.add_argument(-R, --rebuild, action='store_true',
 help='rebuild the Package Manager config file')
 self.parser.add_argument('--version', action='version',
@@ -88,7 +93,8 @@ class Main(object):
 self.print_instructions()
 elif not self.check_is_new(self.args.rebuild):
 self.rename_check()
-
+if self.args.migrate_db:
+self.migrate_database(self.args.migrate_db)
 
 def check_is_new(self, rebuild=False):
 print_instructions = False
@@ -106,6 +112,61 @@ class Main(object):
 return False
 
 
+
+def migrate_database(self, migrate_type):
+if migrate_type not in DB_TYPES:
+msg = 'migrate_database() error; invalid migration type: '\
+  '%(db_type)s' % {'db_type': migrate_type}
+self.output.error('  ' + msg)
+raise Exception(msg)
+
+db = DB(self.config)
+installed = self.config['installed']
+backup_name = installed + '.' + self.config['db_type']
+old_ext = os.path.splitext(installed)[1]
+new_name = installed.replace(old_ext, '.db')
+
+if not os.path.isfile(installed):
+msg = 'migrate_database() error; database file %(loc)s does not 
'\
+  'exist!' % {'loc': backup_name}
+self.output.error('  ' + msg)
+raise Exception(msg)
+
+msg = '  Creating backup of %(db)s at:\n %(loc)s\n'\
+  % {'db': installed, 'loc': backup_name}
+self.output.info(msg)
+
+try:
+shutil.copy(installed, backup_name)
+except IOError as err:
+msg = '  migrate_database() error; failed to back up old database 
'\
+  'file.\n  Error was: %(err)s' % {'err': err}
+self.output.error(msg)
+raise err
+
+db.write(installed, migrate_type=migrate_type)
+
+try:
+os.rename(installed, new_name)
+except OSError as err:
+msg = '  migrate_database() error: failed to rename old database '\
+  ' to %(name)s.\n  Error was: %(err)s' % {'err': err}
+self.output.error(msg)
+raise err
+
+msg = '  Successfully migrated database from %(from_type)s to '\
+  '%(to_type)s\n' % {'from_type': self.config['db_type'],
+   'to_type': migrate_type}
+self.output.info(msg)
+
+self.set_db_type(migrate_type, os.path.basename(installed))
+
+msg = '  Warning: Please be sure to update your config file via '\
+  'the\n  `dispatch-conf` command or you *will* lose database '\
+  'functionality!\n'
+self.output.warn(msg)
+
+
 def rename_check(self):
 '''Checks for and renames the installed db if needed
 '''
@@ -209,3 +270,45 @@ class Main(object):
 from layman.config_modules.reposconf.reposconf import ConfigHandler
 repos_conf = ConfigHandler(self.config, overlays)
 repos_conf.write()
+
+def set_db_type(self, migrate_type, installed):
+if sys.hexversion = 0x30200f0:
+import configparser as ConfigParser
+else:
+import ConfigParser
+
+config = ConfigParser.ConfigParser()
+config_path = self.config['config']\
+  % {'configdir': self.config['configdir']}
+new_conf = os.path.dirname(config_path) + '/' + '._cfg_' +\
+   os.path.basename(config_path)
+
+try:
+shutil.copy(config_path, new_conf)
+except IOError as err:
+msg

[gentoo-commits] proj/layman:master commit in: layman/

2015-07-15 Thread Devan Franchini
commit: 57848c6abf1a43a9df8efcefc4cbe2297d4ecac4
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Wed Jul 15 15:54:28 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Wed Jul 15 15:54:28 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=57848c6a

dbbase.py: Optimizes if check for db_type

 layman/dbbase.py | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/layman/dbbase.py b/layman/dbbase.py
index 0bdd4e9..283d65c 100644
--- a/layman/dbbase.py
+++ b/layman/dbbase.py
@@ -179,10 +179,10 @@ class DbBase(object):
 '''
 Read the overlay database for installed overlay definitions.
 '''
+db_type = self.db_type
+
 if text and text_type:
 db_type = text_type
-else:
-db_type = self.db_type
 
 #Added to keep xml functionality for cached overlay XML definitions
 if 'cache' in path and '.xml' in path:
@@ -197,11 +197,16 @@ class DbBase(object):
 db_ctl.read_db(path, text=text)
 
 
-def write(self, path):
+def write(self, path, migrate_type=None):
 '''
 Write the list of overlays to a file.
 '''
-db_ctl = self.mod_ctl.get_class(self.db_type)(self.config,
+db_type = self.db_type
+
+if migrate_type:
+db_type = migrate_type
+
+db_ctl = self.mod_ctl.get_class(db_type)(self.config,
  self.overlays,
  self.paths,
  self.ignore,



[gentoo-commits] proj/layman:master commit in: layman/

2015-07-15 Thread Devan Franchini
commit: 1a95bc82b26678e8dc22560949756f6580169855
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Wed Jul 15 16:15:29 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Wed Jul 15 16:15:32 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=1a95bc82

version.py: Changes version to 2.4.0-git

As the next release will include some noticeable changes an increment
of the second version number in layman was necessary.

 layman/version.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layman/version.py b/layman/version.py
index ee73005..e6d19ff 100644
--- a/layman/version.py
+++ b/layman/version.py
@@ -24,7 +24,7 @@ from __future__ import unicode_literals
 __version__ = $Id: version.py 309 2007-04-09 16:23:38Z wrobel $
 
 
-VERSION = '2.3.1-git'
+VERSION = '2.4.0-git'
 
 if __name__ == '__main__':
 print(VERSION)



[gentoo-commits] proj/layman:master commit in: layman/tests/

2015-07-14 Thread Devan Franchini
commit: 7428f47c435073a929f9a41f72a6bd8a675b631e
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Tue Jul 14 13:30:16 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Tue Jul 14 13:30:37 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=7428f47c

external.py: Adds db_type config option to tests which need it

The Overlay, DbBase, and DB would require the db_type config option
to be set. To prevent it from falling back on config option defaults
it's best to specify it.

 layman/tests/external.py | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/layman/tests/external.py b/layman/tests/external.py
index 0dad278..3e41bd1 100755
--- a/layman/tests/external.py
+++ b/layman/tests/external.py
@@ -154,6 +154,7 @@ class AddDeleteDB(unittest.TestCase):
 
 my_opts = {'installed' : temp_xml_path,
'conf_type' : ['make.conf', 'repos.conf'],
+   'db_type'   : 'xml_db',
'nocheck'   : 'yes',
'make_conf' : make_conf,
'repos_conf': repo_conf,
@@ -480,6 +481,7 @@ class FormatBranchCategory(unittest.TestCase):
 def _run(self, number):
 #config = {'output': Message()}
 config = BareConfig()
+
 # Discuss renaming files to branch-%d.xml
 filename1 = os.path.join(HERE, 'testfiles',
 'subpath-%d.xml' % number)
@@ -554,7 +556,7 @@ class OverlayObjTest(unittest.TestCase):
 overlays = document.findall('overlay') + document.findall('repo')
 output = Message()
 
-ovl_a = Overlay({'output': output}, overlays[0])
+ovl_a = Overlay({'output': output, 'db_type': 'xml_db'}, 
xml=overlays[0])
 self.assertEqual(ovl_a.name, 'wrobel')
 self.assertEqual(ovl_a.is_official(), True)
 url = ['https://overlays.gentoo.org/svn/dev/wrobel']
@@ -563,7 +565,7 @@ class OverlayObjTest(unittest.TestCase):
 self.assertEqual(ovl_a.descriptions, ['Test'])
 self.assertEqual(ovl_a.priority, 10)
 
-ovl_b = Overlay({'output': output}, overlays[1])
+ovl_b = Overlay({'output': output, 'db_type': 'xml_db'}, 
xml=overlays[1])
 self.assertEqual(ovl_b.is_official(), False)
 
 
@@ -572,7 +574,7 @@ class OverlayObjTest(unittest.TestCase):
 overlays = document.findall('overlay') + document.findall('repo')
 output = Message()
 
-ovl = Overlay({'output': output}, overlays[0])
+ovl = Overlay({'output': output, 'db_type': 'xml_db'}, xml=overlays[0])
 test_infostr = 'wrobel\n~~\nSource  : '\
'https://overlays.gentoo.org/svn/dev/wrobel\nContact '\
': nob...@gentoo.org\nType: Subversion; Priority: '\
@@ -586,7 +588,7 @@ class OverlayObjTest(unittest.TestCase):
 overlays = document.findall('overlay') + document.findall('repo')
 output = Message()
 
-ovl = Overlay({'output': output}, overlays[0])
+ovl = Overlay({'output': output, 'db_type': 'xml_db'}, xml=overlays[0])
 test_short_list = 'wrobel[Subversion] '\
   '(https://o.g.o/svn/dev/wrobel )'
 self.assertEqual(ovl.short_list(80).decode('utf-8'), test_short_list)



[gentoo-commits] proj/layman:master commit in: layman/tests/

2015-07-14 Thread Devan Franchini
commit: c8783443cc42d4254d4b2a71796202495487fe0f
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Tue Jul 14 13:32:33 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Tue Jul 14 13:32:33 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=c8783443

external.py: Modifies ovl_dict keys to conform to new changes

 layman/tests/external.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/layman/tests/external.py b/layman/tests/external.py
index 3e41bd1..01cf5b3 100755
--- a/layman/tests/external.py
+++ b/layman/tests/external.py
@@ -522,11 +522,11 @@ class MakeOverlayXML(unittest.TestCase):
 
 ovl_dict = {
 'name': 'wrobel',
-'descriptions': ['Test'],
+'description': ['Test'],
 'owner_name': 'nobody',
 'owner_email': 'nob...@gentoo.org',
 'status': 'official',
-'sources': [['https://overlays.gentoo.org/svn/dev/wrobel',
+'source': [['https://overlays.gentoo.org/svn/dev/wrobel',
  'svn', '']],
 'priority': '10',
}



[gentoo-commits] proj/layman:master commit in: /

2015-07-14 Thread Devan Franchini
commit: a4d4a032db98ee94210aef10b22986fc56457d27
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Tue Jul 14 13:41:26 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Tue Jul 14 13:41:26 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=a4d4a032

setup.py: Adds db_modules packages to list of install packages

 setup.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index aa8b37b..e923bc9 100755
--- a/setup.py
+++ b/setup.py
@@ -84,7 +84,9 @@ setup(
 'http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=summary',
 packages  = ['layman', 'layman.config_modules',
 'layman.config_modules.makeconf', 'layman.config_modules.reposconf',
-'layman.overlays', 'layman.overlays.modules',
+'layman.db_modules', 'layman.db_modules.json_db', 
+'layman.db_modules.xml_db', 'layman.overlays',
+'layman.overlays.modules',
 ] + modules,
 scripts   = ['bin/layman', 'bin/layman-overlay-maker',
'bin/layman-mounter', 'bin/layman-updater'],



[gentoo-commits] proj/layman:master commit in: layman/overlays/

2015-07-14 Thread Devan Franchini
commit: cf8329cb7218173bba6cc57ed8f43e54e8ec9775
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Tue Jul 14 15:15:54 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Tue Jul 14 15:15:54 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=cf8329cb

overlay.py: Adds better error handling for missing source entries

 layman/overlays/overlay.py | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index 6e289b6..c6a0cee 100755
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -160,10 +160,13 @@ class Overlay(object):
 msg = 'Overlay from_dict(), name entry missing from dictionary!'
 raise Exception(msg)
 
-_sources = overlay['source']
+if 'source' in overlay:
+_sources = overlay['source']
+else:
+_sources = None
 
 if _sources == None:
-msg = 'Overlay from_dict(), %(name)s is missing a source'\
+msg = 'Overlay from_dict(), %(name)s is missing a source '\
   'entry!' % {'name': self.name}
 raise Exception(msg)
 
@@ -267,10 +270,13 @@ class Overlay(object):
 msg = 'Overlay from_json(), name entry missing from json!'
 raise Exception(msg)
 
-_sources = json['source']
+if 'source' in json:
+_sources = json['source']
+else:
+_sources = None
 
 if _sources == None:
-msg = 'Overlay from_json(), %(name)s is missing a source'\
+msg = 'Overlay from_json(), %(name)s is missing a source '\
   'entry!' % {'name': self.name}
 raise Exception(msg)
 



[gentoo-commits] proj/layman:master commit in: layman/db_modules/xml_db/

2015-07-13 Thread Devan Franchini
commit: 4c08c57f337abba1f6f4fe678bfa2a0cab569b7a
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Mon Jul 13 13:33:00 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Mon Jul 13 13:33:02 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=4c08c57f

xml_db.py: Removes unnecessary __eq__ and __ne__ functions

These functions are in the DbBase class and will continue to be used
in that class. As such there's no need for any DBHandler class to
include them in their code.

 layman/db_modules/xml_db/xml_db.py | 11 ---
 1 file changed, 11 deletions(-)

diff --git a/layman/db_modules/xml_db/xml_db.py 
b/layman/db_modules/xml_db/xml_db.py
index 6348162..38a19d2 100644
--- a/layman/db_modules/xml_db/xml_db.py
+++ b/layman/db_modules/xml_db/xml_db.py
@@ -86,17 +86,6 @@ class DBHandler(object):
 self.output.debug('Initializing XML overlay list handler', 8)
 
 
-def __eq__(self, other):
-for key in set(self.overlays.keys()) | set(other.overlays.keys()):
-if self.overlays[key] != other.overlays[key]:
-return False
-return True
-
-
-def __ne__(self, other):
-return not self.__eq__(other)
-
-
 def _broken_catalog_hint(self):
 this_function_name = sys._getframe().f_code.co_name
 



[gentoo-commits] proj/layman:master commit in: layman/

2015-07-13 Thread Devan Franchini
commit: a3ef79ecdc93c82a599cab3eef1be49d7ca40a9d
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Mon Jul 13 13:25:36 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Mon Jul 13 13:25:39 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=a3ef79ec

Adds switch on read_db if text is provided

Logically speaking, if the database document text is provided then
it will likely not be universal to every database provided. Therefore
adding another parameter that specifies the type of text that is being
provided will help distinguish which database type it is.

 layman/dbbase.py   | 11 ---
 layman/remotedb.py |  2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/layman/dbbase.py b/layman/dbbase.py
index 56ef158..09133c2 100644
--- a/layman/dbbase.py
+++ b/layman/dbbase.py
@@ -167,12 +167,17 @@ class DbBase(object):
 return
 
 
-def read_db(self, path, text=None):
+def read_db(self, path, text=None, text_type=None):
 '''
 Read the overlay database for installed overlay definitions.
 '''
-for types in self.db_types:
-db_ctl = self.mod_ctl.get_class(types)(self.config,
+if text and text_type:
+types = [text_type]
+else:
+types = self.db_types
+
+for t in types:
+db_ctl = self.mod_ctl.get_class(t)(self.config,
  self.overlays,
  self.paths,
  self.ignore,

diff --git a/layman/remotedb.py b/layman/remotedb.py
index cd6ece3..89caf7a 100644
--- a/layman/remotedb.py
+++ b/layman/remotedb.py
@@ -280,7 +280,7 @@ class RemoteDB(DbBase):
 def _check_download(self, olist, url):
 
 try:
-self.read_db(url, text=olist)
+self.read_db(url, text=olist, text_type=xml_db)
 except Exception as error:
 self.output.debug(RemoteDB._check_download(), url=%s \nolist:\n
 % url,2)



[gentoo-commits] proj/layman:master commit in: layman/overlays/

2015-07-13 Thread Devan Franchini
commit: 9128580881ba70dbd1bd08e4cdcd8731a46699cd
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Mon Jul 13 18:52:15 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Mon Jul 13 18:52:17 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=91285808

overlay.py: Modifies error message for missing name entry

If the Overlay object has no name then trying to use the name would
result in erroneous or illogical reporting.

 layman/overlays/overlay.py | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index de0a035..024989c 100755
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -157,8 +157,7 @@ class Overlay(object):
 if _name != None:
 self.name = encode(_name)
 else:
-msg = 'Overlay from dict(), %(name)s is missing a name entry!'\
-  % {'name': self.name}
+msg = 'Overlay from_dict(), name entry missing from dictionary!'
 raise Exception(msg)
 
 _sources = overlay['source']
@@ -383,8 +382,7 @@ class Overlay(object):
 elif 'name' in xml.attrib:
 self.name = encode(xml.attrib['name'])
 else:
-msg = 'Overlay from_xml(), %(name)s is missing a name entry!'\
-  % {'name': self.name}
+msg = 'Overlay from_xml(), name entry missing from xml!'
 raise Exception(msg)
 
 _sources = xml.findall('source')



[gentoo-commits] proj/layman:master commit in: layman/overlays/

2015-07-13 Thread Devan Franchini
commit: 73aa4d1bc690dbef69c0c00dfc629209a3a8540e
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Mon Jul 13 19:00:41 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Mon Jul 13 19:00:41 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=73aa4d1b

overlay.py: Corrects else on line 316

 layman/overlays/overlay.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index 024989c..cf99499 100755
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -313,7 +313,7 @@ class Overlay(object):
   'entry!' % {'name': self.name}
 if not ignore:
 raise Exception(msg)
-else ignore == 1:
+elif ignore == 1:
 self.output.warn(msg, 4)
 
  if 'description' in overlay:



[gentoo-commits] proj/layman:master commit in: layman/overlays/

2015-07-13 Thread Devan Franchini
commit: 8279886d04bb1469753144c1d204fd1ae20f528f
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Mon Jul 13 19:05:30 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Mon Jul 13 19:05:30 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=8279886d

overlay.py: Fixes any other mistakes made in haste

 layman/overlays/overlay.py | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
index cf99499..82e2f9f 100755
--- a/layman/overlays/overlay.py
+++ b/layman/overlays/overlay.py
@@ -316,7 +316,7 @@ class Overlay(object):
 elif ignore == 1:
 self.output.warn(msg, 4)
 
- if 'description' in overlay:
+if 'description' in overlay:
 self.descriptions = []
 _descs = overlay['description']
 for d in _descs:
@@ -602,7 +602,10 @@ class Overlay(object):
 
 def source_types(self):
 for i in self.sources:
-yield i.typedef is_official(self):
+yield i.type
+
+
+def is_official(self):
 '''
 Is the overlay official?
 '''



[gentoo-commits] proj/layman:master commit in: layman/db_modules/json_db/

2015-07-13 Thread Devan Franchini
commit: a072bcba3fd58d5d860d855061e593e429d15d30
Author: Devan Franchini twitch153 AT gentoo DOT org
AuthorDate: Mon Jul 13 18:45:58 2015 +
Commit: Devan Franchini twitch153 AT gentoo DOT org
CommitDate: Mon Jul 13 18:45:58 2015 +
URL:https://gitweb.gentoo.org/proj/layman.git/commit/?id=a072bcba

json_db.py: Adds JSON databasing support to layman

 layman/db_modules/json_db/__init__.py |  24 +++
 layman/db_modules/json_db/json_db.py  | 120 ++
 2 files changed, 144 insertions(+)

diff --git a/layman/db_modules/json_db/__init__.py 
b/layman/db_modules/json_db/__init__.py
new file mode 100644
index 000..e095f4f
--- /dev/null
+++ b/layman/db_modules/json_db/__init__.py
@@ -0,0 +1,24 @@
+# Copyright 2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+'''
+JSON database plug-in module for layman.
+'''
+
+module_spec = {
+'name': 'json_db',
+'description': __doc__,
+'provides':{
+'json-module': {
+'name': 'json_db',
+'class': 'DBHandler',
+'description': __doc__,
+'functions': ['add_new', 'read_db', 'write'],
+'func_desc': {
+'add_new': 'Adds overlay from provided document text',
+'read_db': 'Reads the list of overlays from database file',
+'write': 'Writes the list of overlays to database file',
+},
+}
+}
+}

diff --git a/layman/db_modules/json_db/json_db.py 
b/layman/db_modules/json_db/json_db.py
new file mode 100644
index 000..47413c6
--- /dev/null
+++ b/layman/db_modules/json_db/json_db.py
@@ -0,0 +1,120 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# LAYMAN JSON DB
+#
+# File:   json_db.py
+#
+# Access JSON overlay database(s).
+#
+# Copyright:
+# (c) 2015Devan Franchini
+# Distributed under the terms of the GNU General Public License v2
+#
+# Author(s):
+# Devan Franchini twitch...@gentoo.org
+#
+'''Handler for json overlay databases.'''
+
+from __future__ import unicode_literals
+
+__version__ = $Id: json.py 273 2015-07-10 10:10:49Z twitch153 $
+
+#===
+#
+# Dependencies
+#
+#---
+
+import json
+import sys
+
+from   layman.compatibility  import fileopen
+from   layman.overlays.overlay   import Overlay
+
+
+#py3.2+
+if sys.hexversion = 0x30200f0:
+_UNICODE = 'unicode'
+else:
+_UNICODE = 'UTF-8'
+
+
+
+#===
+#
+# Class DBHandler
+#
+#---
+
+class DBHandler(object):
+'''
+Handle a json overlay database.
+'''
+
+def __init__(self, config, overlays, paths=None, ignore=0,
+ ignore_init_read_errors=False):
+
+self.config = config
+self.ignore = ignore
+self.overlays = overlays
+self.paths = paths
+self.output = config['output']
+self.ignore_init_read_errors = ignore_init_read_errors
+
+self.output.debug('Initializing JSON overlay list handler', 8)
+
+
+def read_db(self, path, text=None):
+'''
+Read the overlay definition file.
+'''
+document = text
+
+if not document:
+try:
+with fileopen(path, 'r') as df:
+document = df.read()
+except Exception as error:
+if not self.ignore_init_read_errors:
+msg = 'JSON DBHandler - Failed to read the overlay list 
at'\
+  '(%(path)s)' % {'path': path}
+self.output.error(msg)
+raise error
+
+self.add_new(document, origin=path)
+
+
+def add_new(self, document=None, origin=None):
+'''
+Reads in provided json text and generates overlays to populate 
database.
+'''
+if not document:
+msg = 'JSON DBHandler - add_new() failed: JSON text cannot be 
none'\
+  '.\nOrigin: %(path)s' % {'path': origin}
+self.output.warn(msg)
+return False
+
+load = json.loads(document)['repo']
+
+for ovl in load:
+overlay = Overlay(self.config, json=ovl, ignore=self.ignore)
+self.overlays[overlay.name] = overlay
+
+return True
+
+
+def write(self, path):
+'''
+Write the list of overlays to a file.
+'''
+try:
+repo = {'@encoding': 'unicode', '@version': '1.0', 'repo': []}
+repo['repo'] = [self.overlays[key].to_json() for key

  1   2   3   4   5   6   7   >