def fix_checksum(self, package_name): """ Fix the checksum of a package $ sage --package fix-checksum pari Updating checksum of pari-2.8-2044-g89b0f1e.tar.gz """ log.debug('Correcting the checksum of %s', package_name) update = ChecksumUpdater(package_name) pkg = update.package if not pkg.tarball_filename: log.info('Ignoring {0} because it is not a normal package'.format( package_name)) return if not os.path.exists(pkg.tarball.upstream_fqn): log.info('Ignoring {0} because tarball is not cached'.format( package_name)) return if pkg.tarball.checksum_verifies(): log.info('Checksum of {0} (tarball {1}) unchanged'.format( package_name, pkg.tarball_filename)) else: log.info('Updating checksum of {0} (tarball {1})'.format( package_name, pkg.tarball_filename)) update.fix_checksum()
def create(self, package_name, version, tarball, pkg_type): log.debug('Creating %s: %s, %s, %s', package_name, version, tarball, pkg_type) creator = PackageCreator(package_name) if version: creator.set_version(version) if pkg_type: creator.set_type(pkg_type) if tarball: creator.set_tarball(tarball) update = ChecksumUpdater(package_name) update.fix_checksum()
def fix_checksum(self, package_name): """ Fix the checksum of a package $ sage --package fix-checksum pari Updating checksum of pari-2.8-2044-g89b0f1e.tar.gz """ log.debug('Correcting the checksum of %s', package_name) update = ChecksumUpdater(package_name) pkg = update.package if pkg.tarball.checksum_verifies(): print('Checksum of {0} unchanged'.format(pkg.tarball_filename)) else: print('Updating checksum of {0}'.format(pkg.tarball_filename)) update.fix_checksum()
def fix_all_checksums(self): """ Fix the checksum of a package $ sage --package fix-checksum """ for pkg in Package.all(): if not os.path.exists(pkg.tarball.upstream_fqn): log.debug('Ignoring {0} because tarball is not cached'.format(pkg.tarball_filename)) continue if pkg.tarball.checksum_verifies(): log.debug('Checksum of {0} unchanged'.format(pkg.tarball_filename)) continue update = ChecksumUpdater(pkg.name) print('Updating checksum of {0}'.format(pkg.tarball_filename)) update.fix_checksum()
def fix_all_checksums(self): """ Fix the checksum of a package $ sage --package fix-checksum """ for pkg in Package.all(): if not os.path.exists(pkg.tarball.upstream_fqn): log.debug('Ignoring {0} because tarball is not cached'.format(pkg.tarball_filename)) continue if pkg.tarball.checksum_verifies(): log.debug('Checksum of {0} (tarball {1}) unchanged'.format(pkg.name, pkg.tarball_filename)) continue update = ChecksumUpdater(pkg.name) print('Updating checksum of {0} (tarball {1})'.format(pkg.name, pkg.tarball_filename)) update.fix_checksum()