fix IOError: [Errno 13] Permission denied

This commit is contained in:
Dimitris Zlatanidis 2015-02-24 12:03:14 +02:00
parent 808e2ec6e9
commit 9c9be6b514

View file

@ -23,6 +23,16 @@
import os import os
import sys import sys
import getpass
def s_user(user):
'''
Check for root user
'''
if user != "root":
print("\nslpkg: error: must have root privileges\n")
sys.exit(0)
def remove_repositories(repositories, default_repositories): def remove_repositories(repositories, default_repositories):
@ -84,6 +94,8 @@ class MetaData(object):
__license__ = "GNU General Public License v3 (GPLv3)" __license__ = "GNU General Public License v3 (GPLv3)"
__email__ = "d.zlatanidis@gmail.com" __email__ = "d.zlatanidis@gmail.com"
s_user(getpass.getuser())
# Default Slackware release # Default Slackware release
slack_rel = 'stable' slack_rel = 'stable'