Esempio n. 1
0
/* unsigned int alpm_trans_get_flags(); */
int lalpm_trans_get_flags(lua_State *L)
{
    pmtransflag_t x = alpm_trans_get_flags();
    if (x == (pmtransflag_t)-1) {
        raise_last_pm_error(L);
    }

    return push_transflags_table(L, x);
}
Esempio n. 2
0
static PyObject *pyalpm_trans_get_remove(PyObject *self, void *closure)
{
  alpm_handle_t *handle = ALPM_HANDLE(self);
  alpm_list_t *to_remove;
  /* sanity check */
  int flags = alpm_trans_get_flags(handle);
  if (flags == -1) RET_ERR("no transaction defined", alpm_errno(handle), NULL);

  to_remove = alpm_trans_get_remove(handle);
  return alpmlist_to_pylist(to_remove, pyalpm_package_from_pmpkg);
}
Esempio n. 3
0
static PyObject *pyalpm_trans_get_flags(PyObject *self, void *closure)
{
  PyObject *result;
  alpm_handle_t *handle = ALPM_HANDLE(self);
  int flags = alpm_trans_get_flags(handle);
  int i;
  if (flags == -1) RET_ERR("no transaction defined", alpm_errno(handle), NULL);
  result = PyDict_New();
  for (i = 0; i < 18; i++) {
    if(flagnames[i])
      PyDict_SetItemString(result, flagnames[i], flags & (1 << i) ? Py_True : Py_False);
  }
  return result;
}
Esempio n. 4
0
void
pk_backend_destroy (PkBackend *backend)
{
	PkBackendAlpmPrivate *priv = pk_backend_get_user_data (backend);
	pk_alpm_groups_destroy (backend);
	pk_alpm_destroy_databases (backend);

	if (priv->alpm != NULL) {
		if (alpm_trans_get_flags (priv->alpm) < 0)
			alpm_trans_release (priv->alpm);
		alpm_release (priv->alpm);
	}

	FREELIST (priv->syncfirsts);
	FREELIST (priv->holdpkgs);
	g_free (priv);
}
Esempio n. 5
0
static void
pk_backend_destroy_alpm (PkBackend *self)
{
	g_return_if_fail (self != NULL);

	if (alpm != NULL) {
		if (alpm_trans_get_flags (alpm) < 0) {
			alpm_trans_release (alpm);
		}
		alpm_release (alpm);

		alpm = NULL;
		backend = NULL;
	}

	FREELIST (syncfirsts);
	FREELIST (holdpkgs);
	g_free (xfercmd);
	xfercmd = NULL;
}
Esempio n. 6
0
File: deps.c Progetto: mineo/pacman
static int no_dep_version(pmhandle_t *handle)
{
	int flags = alpm_trans_get_flags(handle);
	return flags != -1 && (flags & PM_TRANS_FLAG_NODEPVERSION);
}
/**
 * pacman_transaction_get_flags:
 * @transaction: A #PacmanTransaction.
 *
 * Gets the flags that were used to configure @transaction.
 *
 * Returns: A set of #PacmanTransactionFlags.
 */
guint32 pacman_transaction_get_flags (PacmanTransaction *transaction) {
	g_return_val_if_fail (transaction != NULL, PACMAN_TRANSACTION_FLAGS_NONE);
	
	/* PacmanTransactionFlags is set up so that this works */
	return (guint32) alpm_trans_get_flags ();
}