From b9156e0b55ebe94d243083c51d6819d6598de549 Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Mon, 7 Apr 2008 16:40:03 +0300 Subject: Use setuptools for installation Signed-off-by: Jonathan Dieter --- yum-presto/ChangeLog | 5 +++++ yum-presto/Makefile | 8 -------- yum-presto/presto.py | 40 +++++++++++++++++++++++----------------- yum-presto/setup.py | 23 +++++++++++++++++++++++ 4 files changed, 51 insertions(+), 25 deletions(-) delete mode 100644 yum-presto/Makefile create mode 100644 yum-presto/setup.py diff --git a/yum-presto/ChangeLog b/yum-presto/ChangeLog index 75c795a..9cfbd46 100644 --- a/yum-presto/ChangeLog +++ b/yum-presto/ChangeLog @@ -1,3 +1,8 @@ +* Mon Apr 7 2008 Jonathan Dieter - 0.4.4 + - Show savings + - Use setuptools for installation + - Get Python Egg stuff working for F9 + * Sat Nov 17 2007 Jonathan Dieter - 0.4.3 - Fix README so it is now accurate for 0.4.x - Fix a small bug that caused AVC denials when SELinux is enabled diff --git a/yum-presto/Makefile b/yum-presto/Makefile deleted file mode 100644 index c756c05..0000000 --- a/yum-presto/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -clean: - rm -f *.pyc *.pyo *~ - -install: - mkdir -p $(DESTDIR)/usr/lib/yum-plugins - install -m 644 presto.py $(DESTDIR)/usr/lib/yum-plugins - mkdir -p $(DESTDIR)/etc/yum/pluginconf.d - install -m 644 presto.conf $(DESTDIR)/etc/yum/pluginconf.d diff --git a/yum-presto/presto.py b/yum-presto/presto.py index cf37458..5c6b05b 100644 --- a/yum-presto/presto.py +++ b/yum-presto/presto.py @@ -416,17 +416,18 @@ def config_hook(conduit): # Set up Presto repositories def postreposetup_hook(conduit): opts, commands = conduit.getCmdLine() - if not opts or not opts.disablepresto: - conduit.info(2, 'Setting up and reading Presto delta metadata') - for active_repo in conduit.getRepos().listEnabled(): - try: - deltamd = active_repo.retrieveMD("prestodelta") - except: - conduit.info(2, "No Presto metadata available for %s" %(active_repo,)) - continue - pinfo[active_repo.id] = PrestoParser(deltamd).getDeltas() - else: + if opts and opts.disablepresto: conduit.info(5, '--disablepresto specified - Presto disabled') + return + + conduit.info(2, 'Setting up and reading Presto delta metadata') + for active_repo in conduit.getRepos().listEnabled(): + try: + deltamd = active_repo.retrieveMD("prestodelta") + except: + conduit.info(2, "No Presto metadata available for %s" %(active_repo,)) + continue + pinfo[active_repo.id] = PrestoParser(deltamd).getDeltas() def predownload_hook(conduit): global complete_download_size @@ -460,11 +461,16 @@ def predownload_hook(conduit): def posttrans_hook(conduit): global complete_download_size global actual_download_size - - if complete_download_size > 0: - drpm_string = format_number(actual_download_size) - rpm_string = format_number(complete_download_size) + + opts, commands = conduit.getCmdLine() + + if (opts and opts.disablepresto) or \ + (complete_download_size == actual_download_size): + return + + drpm_string = format_number(actual_download_size) + rpm_string = format_number(complete_download_size) - conduit.info(2, "Size of all updates downloaded from Presto-enabled repositories: %s" % drpm_string) - conduit.info(2, "Size of updates that would have been downloaded if Presto wasn't enabled: %s" % rpm_string) - conduit.info(2, "This is a savings of %i percent" % (100 - ((actual_download_size * 100) / complete_download_size))) + conduit.info(2, "Size of all updates downloaded from Presto-enabled repositories: %s" % drpm_string) + conduit.info(2, "Size of updates that would have been downloaded if Presto wasn't enabled: %s" % rpm_string) + conduit.info(2, "This is a savings of %i percent" % (100 - ((actual_download_size * 100) / complete_download_size))) diff --git a/yum-presto/setup.py b/yum-presto/setup.py new file mode 100644 index 0000000..504d62c --- /dev/null +++ b/yum-presto/setup.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +""" +Build script for yum-presto. +""" +from setuptools import setup, find_packages + +setup (name = "yum-presto", + version = '0.4.4', + packages = find_packages(), + description = "Utilizes the work done on deltarpm to provide faster, smaller size downloads to Fedora users.", + author = 'Jonathan Dieter', + author_email = 'jdieter@gmail.com', + license = 'GPLv2+', + platforms=["Linux"], + + data_files=[('/usr/lib/yum-plugins/', ['presto.py']), + ('/etc/yum/pluginconf.d/', ['presto.conf'])], + + classifiers=['License :: OSI Approved :: GNU General Public License (GPL)', + 'Operating System :: Unix', + 'Programming Language :: Python', + ], +) -- cgit