diff -ru yum-1.0.3/config.py yum-1.0.3.with-r/config.py --- yum-1.0.3/config.py Tue Sep 9 05:13:37 2003 +++ yum-1.0.3.with-r/config.py Tue Sep 23 01:10:40 2003 @@ -83,6 +83,7 @@ self.exactarch = 0 self.diskspacecheck = 1 self.tolerant = 0 + self.replacefiles = 0 self.distroverpkg = 'redhat-release' self.yumvar = self._getEnvVar() self.distroverpkg = 'redhat-release' @@ -111,6 +112,8 @@ self.diskspacecheck=self.cfg.getboolean('main','diskspacecheck') if self._getoption('main','tolerant') != None: self.tolerant = self.cfg.getboolean('main', 'tolerant') + if self._getoption('main','replacefiles') != None: + self.replacefiles=self.cfg.getboolean('main','replacefiles') if self._getoption('main', 'distroverpkg') != None: self.distroverpkg = self._getoption('main','distroverpkg') if self._getoption('main','exactarch') != None: diff -ru yum-1.0.3/docs/yum.8 yum-1.0.3.with-r/docs/yum.8 --- yum-1.0.3/docs/yum.8 Tue Sep 9 05:13:38 2003 +++ yum-1.0.3.with-r/docs/yum.8 Tue Sep 23 01:06:32 2003 @@ -93,6 +93,10 @@ Assume yes; assume that the answer to answer to any question which would be asked is yes\&. Configuration Item: \fBassume\-yes\fP +.IP "\fB\-r\fP" +Replace conflicting files (equivalent to the RPM option of '--replacefiles --force'). +Attention, this has a high 'shoot your own foot' possibility\&. +Configuration Item: \fBreplacefiles\fP .IP "\fB\-c [config file]\fP" Specifies the config file location\&. .IP "\fB\-d [number]\fP" diff -ru yum-1.0.3/docs/yum.conf.5 yum-1.0.3.with-r/docs/yum.conf.5 --- yum-1.0.3/docs/yum.conf.5 Tue Sep 9 05:13:38 2003 +++ yum-1.0.3.with-r/docs/yum.conf.5 Tue Sep 23 01:06:32 2003 @@ -50,7 +50,11 @@ .IP \fBassumeyes\fR 1 or 0 - tells yum whether or not to prompt you for confirmation of actions. -Same as -y on the command line. Default to 0. +Same as -y on the command line. Defaults to 0. + +.IP \fBreplacefiles\fR +1 or 0 - tells yum wether or not to replace conflicting files. +Same as -r on the command line. Defaults to 0. .IP \fBpkgpolicy=\fI[newest|last]\fR Default: \fInewest\fR. Package sorting order. When a package is available from diff -ru yum-1.0.3/etc/yum.conf yum-1.0.3.with-r/etc/yum.conf --- yum-1.0.3/etc/yum.conf Tue Sep 9 05:13:37 2003 +++ yum-1.0.3.with-r/etc/yum.conf Tue Sep 23 01:14:16 2003 @@ -3,6 +3,8 @@ debuglevel=2 logfile=/var/log/yum.log pkgpolicy=newest +#replacefiles=1 +#tolerant=1 [base] name=Red Hat Linux $releasever base Only in yum-1.0.3.with-r/: patch diff -ru yum-1.0.3/yummain.py yum-1.0.3.with-r/yummain.py --- yum-1.0.3/yummain.py Tue Sep 9 05:13:37 2003 +++ yum-1.0.3.with-r/yummain.py Tue Sep 23 01:12:56 2003 @@ -33,13 +33,16 @@ # setup our errorlog object errorlog=Logger(threshold=10, file_object=sys.stderr) + # problemsetfilter definition + problemsetfilter= 0; + # our default config file location yumconffile=None if os.access("/etc/yum.conf", os.R_OK): yumconffile="/etc/yum.conf" try: - gopts, cmds = getopt.getopt(args, 'tCc:hR:e:d:y', ['help']) + gopts, cmds = getopt.getopt(args, 'tCc:hR:e:d:y:r', ['help']) except getopt.error, e: errorlog(0, 'Options Error: %s' % e) usage() @@ -80,6 +83,8 @@ conf.errorlevel=int(a) if o =='-y': conf.assumeyes=1 + if o =='-r': + conf.replacefiles=1 if o in ('-h', '--help'): usage() if o =='-C': @@ -117,7 +122,16 @@ conf.cache=1 if process == 'clean': conf.cache=1 - + + # set problemsetfilter + if conf.replacefiles: + problemsetfilter= rpm.RPMPROB_FILTER_REPLACEOLDFILES | rpm.RPMPROB_FILTER_REPLACENEWFILES + else: + problemsetfilter= 0 + + if conf.diskspacecheck == 0: + problemsetfilter= problemsetfilter | rpm.RPMPROB_FILTER_DISKSPACE + # push the logs into the other namespaces pkgaction.log=log clientStuff.log=log @@ -230,11 +244,7 @@ if conf.uid == 0: # sigh - the magical "order" command - nice of this not to really be documented anywhere. tsfin.order() - # conf check as to which options to pass to tsfin - 0 or one disabling the - if conf.diskspacecheck: - errors = tsfin.run(0, 0, callback.install_callback, '') - else: - errors = tsfin.run(0, rpm.RPMPROB_FILTER_DISKSPACE, callback.install_callback, '') + errors = tsfin.run(0, problemsetfilter, callback.install_callback, '') if errors: errorlog(0, 'Errors installing:') @@ -271,6 +281,7 @@ -d [debug level] - set the debugging level -y answer yes to all questions -t be tolerant about errors in package commands + -r replace conflicting files -R [time in minutes] - set the max amount of time to randonly run in. -C run from cache only - do not update the cache -h, --help this screen