Fix "autoupdate" target when no new packages are available.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091017041820-tj61sfbw5nz50ioh
This commit is contained in:
Juan RP 2009-10-17 06:18:20 +02:00
parent 22c40a2f91
commit ba1c8971a5
2 changed files with 13 additions and 4 deletions

View File

@ -226,6 +226,9 @@ xbps_exec_transaction(const char *pkgname, bool force, bool update)
if (rv == ENOENT) {
printf("No packages currently registered.\n");
cleanup(0);
} else if (rv == ENOPKG) {
printf("All packages are up-to-date.\n");
cleanup(0);
}
goto out;
}

View File

@ -204,6 +204,7 @@ xbps_find_new_packages(void)
prop_object_iterator_t iter;
const char *pkgname;
int rv = 0;
bool newpkg_found = false;
/*
* Prepare dictionary with all registered packages.
@ -229,17 +230,22 @@ xbps_find_new_packages(void)
while ((obj = prop_object_iterator_next(iter)) != NULL) {
prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname);
rv = xbps_find_new_pkg(pkgname, obj);
if (rv == ENOENT || rv == EEXIST) {
if (rv == ENOENT)
continue;
else if (rv == EEXIST) {
rv = 0;
continue;
}
else if (rv != 0) {
} else if (rv != 0) {
prop_object_iterator_release(iter);
return rv;
}
}
newpkg_found = true;
}
prop_object_iterator_release(iter);
if (rv != ENOENT && !newpkg_found)
rv = ENOPKG;
return rv;
}