[Yum-devel] [PATCH] Resurrect diskspacecheck=0 functionality

Panu Matilainen pmatilai at laiskiainen.org
Thu Apr 25 16:32:26 UTC 2013


On 04/25/2013 06:02 PM, James Antill wrote:
> On Thu, 2013-04-25 at 09:09 +0300, Panu Matilainen wrote:
>> Something in commit fc395ef14b135b3591488816ec902057fd8d03f4 makes
>> diskspacecheck=0 not disable the disk space check at all. Moving
>> the thing to initActionTs() where other similar initialization
>> is done makes it work again. In addition, enable filtering of
>> inode problems also to behave the same as rpm's --ignorespace.
>
>   Should change the documentation in yum.conf to explain that this does
> inodes too now. Apart from that ACK.

Ok, I can add a blurb about that. Another alternative could be adding a 
separate option to skip inode check, at least the special case that 
"inspired" me to look at this would actually benefit from having them 
separated (weird filesystem which supposedly has no inode limit but 
apparently advertises this with 0 for total inodes...)

>
>> The related bits in _doTestTransaction() and TransactionWrapper.test()
>> dont seem to do anything at least in yum context, but adding the
>> inode filtering there as well just in case.
>
>   As in, you can't see how that code is triggered? Or if you trigger the
> code adding the flags does nothing?

As in, the code (see below) doesn't seem to affect behavior whether its 
triggered or not.

>
>>   OTOH unless there's
>> something that actually relies on the seemingly no-op code, perhaps
>> it could just be removed?
>
>   rpmUtils/* is also an external API, so we can't just remove a function.

Oh, I wasn't talking about removing functions, just the apparently dead 
code. Basically:

--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -6181,16 +6181,12 @@ much more problems).
                                           % self.conf.bugtracker_url)
              raise Errors.YumRPMCheckError,retmsgs

-        tsConf = {}
-        for feature in ['diskspacecheck']: # more to come, I'm sure
-            tsConf[feature] = getattr( self.conf, feature )
-        #
          testcb = RPMTransaction(self, test=True)
          # overwrite the default display class
          if display:
              testcb.display = display

-        tserrors = self.ts.test( testcb, conf=tsConf )
+        tserrors = self.ts.test( testcb )
          del testcb

          if len( tserrors ) > 0:

...and perhaps also:

--- a/rpmUtils/transaction.py
+++ b/rpmUtils/transaction.py
@@ -111,10 +111,6 @@ class TransactionWrapper:

          origflags = self.getTsFlags()
          self.addTsFlag(rpm.RPMTRANS_FLAG_TEST)
-        # FIXME GARBAGE - remove once this is reimplemented elsehwere
-        # KEEPING FOR API COMPLIANCE ONLY
-        if conf.get('diskspacecheck') == 0:
-            self.ts.setProbFilter(rpm.RPMPROB_FILTER_DISKSPACE)
          tserrors = self.ts.run(cb.callback, '')
          self.ts.setFlags(origflags)


Neither of these affects diskspacecheck functionality wrt yum itself, 
but I guess it is entirely possible that these do make a difference to 
some caller, as the api compliance comment notes.

	- Panu -


More information about the Yum-devel mailing list