With the yum.py script named like that, python tries to import from it, rather than the yum module directory when working in a checked out source directory. Rather than that, just name the scripts how they're named when installed, i.e. without .py extension. --- Makefile | 2 +- bin/yum | 32 ++++++++++++++++++++++++++++++++ bin/yum.py | 32 -------------------------------- 3 files changed, 33 insertions(+), 33 deletions(-) create mode 100755 bin/yum delete mode 100755 bin/yum.py
diff --git a/Makefile b/Makefile index fc04853..c72c387 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ install: $(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/usr/share/yum-cli', 1, '$(PYDIR)', 1)" mkdir -p $(DESTDIR)/usr/bin $(DESTDIR)/usr/sbin - install -m 755 bin/yum.py $(DESTDIR)/usr/bin/yum + install -m 755 bin/yum $(DESTDIR)/usr/bin/yum install -m 755 bin/yum-updatesd.py $(DESTDIR)/usr/sbin/yum-updatesd mkdir -p $(DESTDIR)/var/cache/yum diff --git a/bin/yum b/bin/yum new file mode 100755 index 0000000..3aac45a --- /dev/null +++ b/bin/yum @@ -0,0 +1,32 @@ +#!/usr/bin/python +import sys +try: + import yum +except ImportError: + print >> sys.stderr, """\ +There was a problem importing one of the Python modules +required to run yum. The error leading to this problem was: + + %s + +Please install a package which provides this module, or +verify that the module is installed correctly. + +It's possible that the above module doesn't match the +current version of Python, which is: +%s + +If you cannot solve this problem yourself, please go to +the yum faq at: + http://yum.baseurl.org/wiki/Faq + +""" % (sys.exc_value, sys.version) + sys.exit(1) + +sys.path.insert(0, '/usr/share/yum-cli') +try: + import yummain + yummain.user_main(sys.argv[1:], exit_code=True) +except KeyboardInterrupt, e: + print >> sys.stderr, "\n\nExiting on user cancel." + sys.exit(1) diff --git a/bin/yum.py b/bin/yum.py deleted file mode 100755 index 7ccee31..0000000 --- a/bin/yum.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/python -import sys -try: - import yum -except ImportError: - print >> sys.stderr, """\ -There was a problem importing one of the Python modules -required to run yum. The error leading to this problem was: - - %s - -Please install a package which provides this module, or -verify that the module is installed correctly. - -It's possible that the above module doesn't match the -current version of Python, which is: -%s - -If you cannot solve this problem yourself, please go to -the yum faq at: - http://yum.baseurl.org/wiki/Faq - -""" % (sys.exc_value, sys.version) - sys.exit(1) - -sys.path.insert(0, '/usr/share/yum-cli') -try: - import yummain - yummain.user_main(sys.argv[1:], exit_code=True) -except KeyboardInterrupt, e: - print >> sys.stderr, "\n\nExiting on user cancel." - sys.exit(1) -- 1.7.6.2 _______________________________________________ Yum-devel mailing list Yum-devel@lists.baseurl.org http://lists.baseurl.org/mailman/listinfo/yum-devel