def uptodate_index(quiet=True, max_age=86400):
 from fabtools.require import file as require_file
 require_file('/etc/apt/apt.conf.d/15fabtools-update-stamp', contents='APT::Update::Post-Invoke-Success {"touch /var/lib/apt/periodic/fabtools-update-success-stamp 2>/dev/null || true";};\n', use_sudo=True)
 if ((system.time() - last_update_time()) > _to_seconds(max_age)):
  update_index(quiet=quiet)

def uptodate_index ( quiet = True , max_age = 86400 ) : from fabtools . require import file as require_file require_file ( '/etc/apt/apt.conf.d/15fabtools-update-stamp' , contents = 'APT::Update::Post-Invoke-Success {"touch /var/lib/apt/periodic/fabtools-update-success-stamp 2>/dev/null || true";};\n' , use_sudo = True ) if ( ( system . time ( ) - last_update_time ( ) ) > _to_seconds ( max_age ) ) : update_index ( quiet = quiet )
require an up-to-date package index .