File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -233,8 +233,11 @@ main(int argc, char **argv)
233
233
234
234
/* Sync remote repository data and import keys from remote repos */
235
235
if (syncf && !drun ) {
236
- if ((rv = xbps_rpool_sync (& xh )) != 0 )
237
- exit (rv );
236
+ if ((rv = xbps_rpool_sync (& xh )) < 0 ) {
237
+ fprintf (stderr , "Failed to sync repository pool: %s\n" ,
238
+ strerror (- rv ));
239
+ exit (- rv );
240
+ }
238
241
rv = xbps_rpool_foreach (& xh , repo_import_key_cb , NULL );
239
242
if (rv != 0 )
240
243
exit (rv );
Original file line number Diff line number Diff line change @@ -1462,8 +1462,9 @@ void xbps_rpool_release(struct xbps_handle *xhp);
1462
1462
*
1463
1463
* @param[in] xhp Pointer to the xbps_handle struct.
1464
1464
*
1465
- * @return 0 on success, ENOTSUP if no repositories were found in
1465
+ * @return 0 on success or a negative errno otherwise.
1466
1466
* the configuration file.
1467
+ * @retval -ENOENT There are no repositories to sync.
1467
1468
*/
1468
1469
int xbps_rpool_sync (struct xbps_handle * xhp );
1469
1470
Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ xbps_rpool_sync(struct xbps_handle *xhp)
62
62
{
63
63
const char * repouri = NULL ;
64
64
65
+ if (xbps_array_count (xhp -> repositories ) == 0 )
66
+ return - ENOENT ;
67
+
65
68
for (unsigned int i = 0 ; i < xbps_array_count (xhp -> repositories ); i ++ ) {
66
69
xbps_array_get_cstring_nocopy (xhp -> repositories , i , & repouri );
67
70
if (xbps_repo_sync (xhp , repouri ) == -1 ) {
You can’t perform that action at this time.
0 commit comments