MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / epoch

Method epoch

src/packagedcode/pyrpm.py:509–524  ·  view source on GitHub ↗

Return an epoch or None for the epoch 0 and if no epoch is defined.

(self)

Source from the content-addressed store, hash-verified

507
508 @property
509 def epoch(self):
510 """
511 Return an epoch or None for the epoch 0 and if no epoch is defined.
512 """
513 epoch = self.get_entry_value(RPMTAG_EPOCH)
514 if not epoch:
515 return
516 if isinstance(epoch, (tuple, list)):
517 epoch = epoch[0]
518 if not isinstance(epoch, str):
519 epoch = str(epoch)
520 if not epoch or epoch == '0':
521 return
522 if epoch.lower() == 'none':
523 return
524 return epoch
525
526 @property
527 def version(self):

Callers

nothing calls this directly

Calls 1

get_entry_valueMethod · 0.95

Tested by

no test coverage detected