Fix "autoupdate" target when no new packages are available.
--HG-- extra : convert_revision : xtraeme%40gmail.com-20091017041820-tj61sfbw5nz50ioh
This commit is contained in:
parent
22c40a2f91
commit
ba1c8971a5
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user