summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2008-02-14 16:25:16 -0500
committerJeremy Katz <katzj@redhat.com>2008-02-14 17:19:19 -0500
commit6efaba499c713f12041b87c2bfe8a30067ddd697 (patch)
tree712e8152bbbce2998566a9cb24cd1411433ce19a /scripts
parentee12bdfeef8d84ebbc3cf4237f10428024f57116 (diff)
downloadanaconda-6efaba499c713f12041b87c2bfe8a30067ddd697.tar.gz
anaconda-6efaba499c713f12041b87c2bfe8a30067ddd697.tar.xz
anaconda-6efaba499c713f12041b87c2bfe8a30067ddd697.zip
remove yumcache
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile1
-rwxr-xr-xscripts/yumcache103
2 files changed, 0 insertions, 104 deletions
diff --git a/scripts/Makefile b/scripts/Makefile
index 652ab7dd2..c1894b7b4 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -35,7 +35,6 @@ install:
install -m 755 getkeymaps $(DESTDIR)/$(RUNTIMEDIR)
install -m 755 makestamp.py $(DESTDIR)/$(RUNTIMEDIR)
install -m 755 maketreeinfo.py $(DESTDIR)/$(RUNTIMEDIR)
- install -m 755 yumcache $(DESTDIR)/$(RUNTIMEDIR)
install -m 755 pyrc.py $(DESTDIR)/$(RUNTIMEDIR)
install -m 755 upd-updates $(DESTDIR)/$(RUNTIMEDIR)
diff --git a/scripts/yumcache b/scripts/yumcache
deleted file mode 100755
index b441249c5..000000000
--- a/scripts/yumcache
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/usr/bin/python
-#
-# yumcache
-#
-# Copyright (C) 2007 Red Hat, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-
-from optparse import OptionParser
-
-import os
-import glob
-import shutil
-import sys
-import tempfile
-import yum
-
-class CacheConf:
- """Dynamic yum configuration"""
-
- def __init__( self, repopath):
- if os.environ.has_key('TMPDIR'):
- self.fd, self.name = tempfile.mkstemp(".conf", "yum-", os.environ['TMPDIR'])
- self.cachedir = tempfile.mkdtemp("", "yum-cache-", os.environ['TMPDIR'])
- else:
- self.fd, self.name = tempfile.mkstemp(".conf", "yum-", "/tmp")
- self.cachedir = tempfile.mkdtemp("", "yum-cache-", "/tmp")
-
- self.repopath = repopath
-
- self.yumconfstr = """
-[main]
-distroverpkg=redhat-release
-cachedir=%s
-gpgcheck=0
-
-[cache]
-baseurl=file://%s
-enabled=1
-""" % (self.cachedir, self.repopath)
-
- os.write(self.fd, self.yumconfstr)
- os.close(self.fd)
-
-class YumCacheGenerator(yum.YumBase):
- def __init__(self, repopath):
- yum.YumBase.__init__(self)
- self.repopath = repopath
- self.config = CacheConf(repopath)
- self.doConfigSetup(self.config.name)
- os.unlink(self.config.name)
-
- def log(self, level, msg):
- pass
-
- def errorlog(self, level, msg):
- pass
-
- def filelog(self, level, msg):
- pass
-
- def write(self):
- self.repos.disableRepo('*')
- self.repos.enableRepo('cache')
- self.doRepoSetup()
- self.repos.populateSack(with='metadata', pickleonly=1)
- self.repos.populateSack(with='filelists', pickleonly=1)
- for cache in glob.glob("%s/cache/*.sqlite" %( self.config.cachedir,)):
- shutil.move(cache, "%s/repodata" % (self.config.repopath))
-
- shutil.rmtree(self.config.cachedir)
-
-
-def usage():
- print "yumcache <toppath>"
-
-if __name__ == "__main__":
- parser = OptionParser()
- (options, args) = parser.parse_args()
-
- if len(args) != 1:
- usage()
- sys.exit(1)
- repopath = args[0]
-
- if not os.path.exists("%s/repodata/repomd.xml" % (repopath)):
- sys.stderr.write("No metadata found in %s" % (repopath,))
- sys.exit(2)
-
- y = YumCacheGenerator(repopath)
- y.write()