aboutsummaryrefslogtreecommitdiff
path: root/pomu/repo
diff options
context:
space:
mode:
authorMykyta Holubakha <hilobakho@gmail.com>2017-05-31 02:12:49 +0300
committerMykyta Holubakha <hilobakho@gmail.com>2017-05-31 02:12:49 +0300
commit387ab52669d0bf73e11b68f0989afacd315ab012 (patch)
treea31fee26f9abac83218c1ee12d47b837be82affb /pomu/repo
parentRenamed pomu.py to cli.py (diff)
downloadpomu-387ab52669d0bf73e11b68f0989afacd315ab012.tar.gz
pomu-387ab52669d0bf73e11b68f0989afacd315ab012.tar.bz2
pomu-387ab52669d0bf73e11b68f0989afacd315ab012.zip
Finish repo initialization
Diffstat (limited to 'pomu/repo')
-rw-r--r--pomu/repo/init.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pomu/repo/init.py b/pomu/repo/init.py
index 67dc021..19ac289 100644
--- a/pomu/repo/init.py
+++ b/pomu/repo/init.py
@@ -20,7 +20,7 @@ def init_plain_repo(create, repo_path):
return Result.Err('you do not have enough permissions to create the git repository')
Repo.init(repo_path)
try:
- init_pomu(repo_path).unwrap()
+ return Result.Ok(init_pomu(repo_path).unwrap())
except ResultException as e:
rmtree(repo_path)
return Result.Err(str(e))
@@ -51,7 +51,7 @@ def init_portage_repo(create, repo, repo_dir):
return Result.Error('you do not have enough permissions to setup a portage repo')
Repo.init(repo_path)
try:
- init_pomu(repo_path).unwrap()
+ return Result.Ok(init_pomu(repo_path).unwrap())
except ResultException as e:
rmtree(repo_path)
return Result.Err(str(e))
@@ -73,6 +73,7 @@ def init_pomu(repo_path, name=''):
open(path.join(pomu_path, '.sentinel'), 'w').close()
except PermissionError:
return Result.Err('you do not have enough permissions to modify the repo')
- r.index.add(pomu_path)
+ r.index.add([path.join('metadata', 'pomu')])
r.index.commit('Initialized pomu')
- return Result.Ok('Initialized repository ' + name + ' successfully')
+ ret = Result.Ok('Initialized repository ' + name + ' successfully')
+ return ret