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) {
|
if (rv == ENOENT) {
|
||||||
printf("No packages currently registered.\n");
|
printf("No packages currently registered.\n");
|
||||||
cleanup(0);
|
cleanup(0);
|
||||||
|
} else if (rv == ENOPKG) {
|
||||||
|
printf("All packages are up-to-date.\n");
|
||||||
|
cleanup(0);
|
||||||
}
|
}
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -204,6 +204,7 @@ xbps_find_new_packages(void)
|
|||||||
prop_object_iterator_t iter;
|
prop_object_iterator_t iter;
|
||||||
const char *pkgname;
|
const char *pkgname;
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
|
bool newpkg_found = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prepare dictionary with all registered packages.
|
* Prepare dictionary with all registered packages.
|
||||||
@ -229,17 +230,22 @@ xbps_find_new_packages(void)
|
|||||||
while ((obj = prop_object_iterator_next(iter)) != NULL) {
|
while ((obj = prop_object_iterator_next(iter)) != NULL) {
|
||||||
prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname);
|
prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname);
|
||||||
rv = xbps_find_new_pkg(pkgname, obj);
|
rv = xbps_find_new_pkg(pkgname, obj);
|
||||||
if (rv == ENOENT || rv == EEXIST) {
|
if (rv == ENOENT)
|
||||||
|
continue;
|
||||||
|
else if (rv == EEXIST) {
|
||||||
rv = 0;
|
rv = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
} else if (rv != 0) {
|
||||||
else if (rv != 0) {
|
|
||||||
prop_object_iterator_release(iter);
|
prop_object_iterator_release(iter);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
newpkg_found = true;
|
||||||
}
|
}
|
||||||
prop_object_iterator_release(iter);
|
prop_object_iterator_release(iter);
|
||||||
|
|
||||||
|
if (rv != ENOENT && !newpkg_found)
|
||||||
|
rv = ENOPKG;
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user