Exemple #1
0
END_TEST


START_TEST (test_network)
{
  char *cwd                   = get_current_dir_name();
  slapt_rc_config *rc         = slapt_read_rc_config("./data/rc1");
  rc->progress_cb             = _progress_cb; /* silence */

  /* must chdir to working dir */
  fail_unless (chdir(rc->working_dir) == 0);

  /* write pkg data to disk
  void slapt_write_pkg_data(const char *source_url,FILE *d_file,
                            slapt_pkg_list_t *pkgs);
  */

  /* download the PACKAGES.TXT and CHECKSUMS.md5 files
  slapt_pkg_list_t *slapt_get_pkg_source_packages (const slapt_rc_config *global_config,
                                                        const char *url);
  slapt_pkg_list_t *slapt_get_pkg_source_patches (const slapt_rc_config *global_config,
                                                       const char *url);
  FILE *slapt_get_pkg_source_checksums (const slapt_rc_config *global_config,
                                        const char *url);
  int slapt_get_pkg_source_changelog (const slapt_rc_config *global_config,
                                        const char *url);
  */

  fail_unless (slapt_update_pkg_cache(rc) == 0);

  fail_unless (chdir(cwd) == 0);
  slapt_free_rc_config(rc);
  free(cwd);
}
/**
 * backend_refresh_cache:
 */
static void
backend_refresh_cache (PkBackend *backend, gboolean force)
{
	pk_backend_set_allow_cancel (backend, TRUE);
	pk_backend_set_status (backend, PK_STATUS_ENUM_REFRESH_CACHE);
	slapt_update_pkg_cache(_config);
	pk_backend_finished (backend);
}