From 39e35cf677571123c94ff172af570a98ddb09170 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 27 Feb 2009 09:03:51 -0800 Subject: [PATCH] Linux install:calibre_postinstall now installs desktop integration even for non-root user --- src/calibre/linux.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/calibre/linux.py b/src/calibre/linux.py index d1927257a7..7abd9c027c 100644 --- a/src/calibre/linux.py +++ b/src/calibre/linux.py @@ -455,17 +455,16 @@ def post_install(): parser = option_parser() opts = parser.parse_args()[0] - if not opts.no_root and os.geteuid() != 0: - print >> sys.stderr, 'You must be root to run this command.' - sys.exit(1) - global use_destdir use_destdir = opts.destdir manifest = [] - manifest += setup_udev_rules(opts.group_file, not opts.dont_reload, opts.fatal_errors) - manifest += setup_completion(opts.fatal_errors) setup_desktop_integration(opts.fatal_errors) - manifest += install_man_pages(opts.fatal_errors) + if opts.no_root or os.geteuid() == 0: + manifest += setup_udev_rules(opts.group_file, not opts.dont_reload, opts.fatal_errors) + manifest += setup_completion(opts.fatal_errors) + manifest += install_man_pages(opts.fatal_errors) + else: + print "Skipping udev, completion, and man-page install for non-root user." try: from PyQt4 import Qt