#17 Check NeedsCompilation for arch dependence if available.
Opened 11 months ago by qulogic. Modified 11 months ago
qulogic/r2spec needs-compilation  into  master

file modified
+12 -4

@@ -84,11 +84,19 @@ 

      def determine_arch(self):

          """ Determine if the package is arch or noarch by looking at the

          sources.

-         Set arch to True if the package is arch dependant.

+         Set arch to True if the package is arch dependent.

          Set arch to False if the package is noarch.

          Let arch to None if could not determine.

          """

-         self.log.info('Determining if the package is arch dependant or not')

+         self.log.info('Determining if the package is arch dependent or not')

+         try:

+             self.arch = self.description['NeedsCompilation'].lower() != 'no'

+         except KeyError:

+             pass

+         else:

+             self.log.info('Package is %sarch dependent',

+                           '' if self.arch else 'not ')

+             return

          extensions = ['c', 'C', 'cp', 'cpp', 'h', 'H',]

          if os.path.exists(self.name):

              for root, dirs, files in os.walk(self.name):

@@ -99,10 +107,10 @@ 

                                  or 'f' in extension \

                                  or 'F' in extension:

                              self.arch = True

-                             self.log.info('Package is arch dependant')

+                             self.log.info('Package is arch dependent')

                              return

              self.arch = False

-             self.log.info('Package is not arch dependant')

+             self.log.info('Package is not arch dependent')

              return

          else:

              self.log.info(

no initial comment
Metadata