When executing the INSTALL/REMOVE scripts, always pass the UPDATE

value to them.

Bump XBPS_RELVER to 20091209.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091209151435-1yy9f7k2880tswz7
This commit is contained in:
Juan RP
2009-12-09 16:14:35 +01:00
parent 026dc6dbd9
commit eb885bbcc2
5 changed files with 26 additions and 13 deletions

View File

@@ -67,7 +67,8 @@ xbps_configure_all_pkgs(void)
break;
if (state != XBPS_PKG_STATE_UNPACKED)
continue;
if ((rv = xbps_configure_pkg(pkgname, version, false)) != 0)
if ((rv = xbps_configure_pkg(pkgname, version,
false, false)) != 0)
break;
}
prop_object_iterator_release(iter);
@@ -83,7 +84,8 @@ out:
* to installed.
*/
int SYMEXPORT
xbps_configure_pkg(const char *pkgname, const char *version, bool check_state)
xbps_configure_pkg(const char *pkgname, const char *version, bool check_state,
bool update)
{
prop_dictionary_t pkgd;
const char *rootdir, *lver;
@@ -141,7 +143,7 @@ xbps_configure_pkg(const char *pkgname, const char *version, bool check_state)
if (access(buf, X_OK) == 0) {
if ((rv = xbps_file_chdir_exec(rootdir, buf, "post",
pkgname, lver, NULL)) != 0) {
pkgname, lver, update ? "yes" : "no", NULL)) != 0) {
free(buf);
printf("%s: post INSTALL action returned: %s\n",
pkgname, strerror(errno));

View File

@@ -124,13 +124,13 @@ unpack_archive_fini(struct archive *ar, prop_dictionary_t pkg)
const char *pkgname, *version, *rootdir, *entry_str;
char *buf, *buf2;
int rv = 0, flags, lflags;
bool essential, preserve, actgt, skip_entry;
bool essential, preserve, actgt, skip_entry, update;
bool props_plist_found, files_plist_found;
assert(ar != NULL);
assert(pkg != NULL);
essential = preserve = actgt = skip_entry = false;
essential = preserve = actgt = skip_entry = update = false;
props_plist_found = files_plist_found = false;
rootdir = xbps_get_rootdir();
flags = xbps_get_flags();
@@ -151,6 +151,9 @@ unpack_archive_fini(struct archive *ar, prop_dictionary_t pkg)
prop_dictionary_get_bool(pkg, "essential", &essential);
prop_dictionary_get_bool(pkg, "preserve", &preserve);
if (xbps_check_is_installed_pkgname(pkgname))
update = true;
while (archive_read_next_header(ar, &entry) == ARCHIVE_OK) {
if (entry_idx >= 5) {
/*
@@ -194,9 +197,10 @@ unpack_archive_fini(struct archive *ar, prop_dictionary_t pkg)
return rv;
}
}
if ((rv = xbps_file_chdir_exec(rootdir, buf, "pre",
pkgname, version, NULL)) != 0) {
pkgname, version, update ? "yes" : "no",
NULL)) != 0) {
free(buf);
printf("%s: preinst action target error %s\n",
pkgname, strerror(errno));