pentoo-system: a better ungit from floppym

This commit is contained in:
Rick Farina (Zero_Chaos) 2015-11-30 23:48:26 -05:00
parent f498566e59
commit 377edaba17
2 changed files with 11 additions and 8 deletions

View file

@ -1,8 +1,11 @@
#!/bin/sh
PORTDIR=$(portageq envvar get_repo_path 2> /dev/null)
if [ -z "${PORTDIR}" ]; then
PORTDIR=$(portageq envvar PORTDIR 2> /dev/null)
fi
if [ -d "${PORTDIR}"/.git ]; then
rm -rf "${PORTDIR}"/.git
fi
#!/usr/bin/env python
import os.path
import portage
import shutil
repo = portage.db['/']['vartree'].settings.repositories['gentoo']
git = os.path.join(repo.location, '.git')
if repo.sync_type != 'git' and os.path.exists(git):
shutil.rmtree(git)