[yum-cvs] /yum-utils/plugins/downloadonly downloadonly.py,1.2,1.3
Tim Lauridsen
timlau at linux.duke.edu
Wed Feb 14 10:01:34 UTC 2007
Update of /home/groups/yum/cvs//yum-utils/plugins/downloadonly
In directory login1.linux.duke.edu:/tmp/cvs-serv10018/plugins/downloadonly
Modified Files:
downloadonly.py
Log Message:
Added '--downloaddir' option to downloadonly plugin. the option make it posible to change the directory where packages are downloaded.
Thanks to Dmitry Butskoy (rhbz #213623)
Index: downloadonly.py
===================================================================
RCS file: /home/groups/yum/cvs//yum-utils/plugins/downloadonly/downloadonly.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- downloadonly.py 5 Oct 2006 13:33:23 -0000 1.2
+++ downloadonly.py 14 Feb 2007 10:01:32 -0000 1.3
@@ -1,33 +1,44 @@
#!/usr/bin/python
-# 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 Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# by Menno Smits
+# 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 Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# by Menno Smits
from yum.plugins import PluginYumExit, TYPE_INTERACTIVE
-requires_api_version = '2.0'
+requires_api_version = '2.1'
plugin_type = (TYPE_INTERACTIVE,)
def config_hook(conduit):
- parser = conduit.getOptParser()
- parser.add_option('', '--downloadonly', dest='dlonly', action='store_true',
+ parser = conduit.getOptParser()
+ parser.add_option('', '--downloadonly', dest='dlonly', action='store_true',
default=False, help="don't update, just download")
+ parser.add_option('', '--downloaddir', dest='dldir',
+ action='store', default=None,
+ help="specifies an alternate directory to store packages")
-def postdownload_hook(conduit):
- opts, commands = conduit.getCmdLine()
- if opts.dlonly:
- raise PluginYumExit('exiting because --downloadonly specified ')
+def postreposetup_hook(conduit):
+ opts, commands = conduit.getCmdLine()
+ if opts.dldir:
+ repos = conduit.getRepos();
+ list = repos.listEnabled();
+ for repo in list:
+ repo.set('pkgdir',opts.dldir)
+
+def postdownload_hook(conduit):
+ opts, commands = conduit.getCmdLine()
+ if opts.dlonly:
+ raise PluginYumExit('exiting because --downloadonly specified ')
More information about the Yum-cvs-commits
mailing list