Get rid of pkg state half-unpacked; not-installed state is good enough.

This commit is contained in:
Juan RP 2012-11-11 09:42:30 +01:00
parent d6735d5685
commit df0d5d7330
5 changed files with 3 additions and 20 deletions

View File

@ -56,7 +56,7 @@
*/
#define XBPS_PKGINDEX_VERSION "1.5"
#define XBPS_API_VERSION "20121107-1"
#define XBPS_API_VERSION "20121111"
#ifndef XBPS_VERSION
#define XBPS_VERSION "UNSET"
@ -1732,8 +1732,6 @@ int xbps_repository_sync_pkg_index(struct xbps_handle *xhp,
* Integer representing a state on which a package may be. Possible
* values for this are:
*
* - XBPS_PKG_STATE_HALF_UNPACKED: Package was being unpacked
* but didn't finish properly.
* - XBPS_PKG_STATE_UNPACKED: Package has been unpacked correctly
* but has not been configured due to unknown reasons.
* - XBPS_PKG_STATE_INSTALLED: Package has been installed successfully.
@ -1750,7 +1748,6 @@ typedef enum pkg_state {
XBPS_PKG_STATE_BROKEN,
XBPS_PKG_STATE_HALF_REMOVED,
XBPS_PKG_STATE_NOT_INSTALLED,
XBPS_PKG_STATE_HALF_UNPACKED
} pkg_state_t;
/**

View File

@ -49,7 +49,7 @@
* will be executed.
* -# Its requiredby objects will be removed from the installed packages
* database.
* -# Its state will be changed to XBPS_PKG_STATE_HALF_UNPACKED.
* -# Its state will be changed to XBPS_PKG_STATE_HALF_REMOVED.
* -# Its <b>purge-remove</b> target specified in the REMOVE script
* will be executed.
* -# Its package metadata directory will be removed.

View File

@ -42,7 +42,6 @@ static const struct state states[] = {
{ "broken", XBPS_PKG_STATE_BROKEN },
{ "half-removed", XBPS_PKG_STATE_HALF_REMOVED },
{ "not-installed", XBPS_PKG_STATE_NOT_INSTALLED },
{ "half-unpacked", XBPS_PKG_STATE_HALF_UNPACKED },
{ NULL, 0 }
};

View File

@ -710,18 +710,6 @@ xbps_unpack_binary_pkg(struct xbps_handle *xhp, prop_dictionary_t pkg_repod)
return rv;
}
free(bpkg);
/*
* Set package state to half-unpacked.
*/
if ((rv = xbps_set_pkg_state_installed(xhp, pkgname, version,
XBPS_PKG_STATE_HALF_UNPACKED)) != 0) {
xbps_set_cb_state(xhp, XBPS_STATE_UNPACK_FAIL,
rv, pkgname, version,
"%s: [unpack] failed to set state to half-unpacked: %s",
pkgver, strerror(rv));
goto out;
}
/*
* Extract archive files.
*/

View File

@ -174,8 +174,7 @@ transaction_find_pkg(struct xbps_handle *xhp,
if (state == XBPS_PKG_STATE_UNPACKED)
reason = "configure";
else if (state == XBPS_PKG_STATE_NOT_INSTALLED ||
state == XBPS_PKG_STATE_HALF_UNPACKED)
else if (state == XBPS_PKG_STATE_NOT_INSTALLED)
reason = "install";
/*