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)
233233
234234 /* Sync remote repository data and import keys from remote repos */
235235 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+ }
238241 rv = xbps_rpool_foreach (& xh , repo_import_key_cb , NULL );
239242 if (rv != 0 )
240243 exit (rv );
Original file line number Diff line number Diff line change @@ -1462,8 +1462,9 @@ void xbps_rpool_release(struct xbps_handle *xhp);
14621462 *
14631463 * @param[in] xhp Pointer to the xbps_handle struct.
14641464 *
1465- * @return 0 on success, ENOTSUP if no repositories were found in
1465+ * @return 0 on success or a negative errno otherwise.
14661466 * the configuration file.
1467+ * @retval -ENOENT There are no repositories to sync.
14671468 */
14681469int xbps_rpool_sync (struct xbps_handle * xhp );
14691470
Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ xbps_rpool_sync(struct xbps_handle *xhp)
6262{
6363 const char * repouri = NULL ;
6464
65+ if (xbps_array_count (xhp -> repositories ) == 0 )
66+ return - ENOENT ;
67+
6568 for (unsigned int i = 0 ; i < xbps_array_count (xhp -> repositories ); i ++ ) {
6669 xbps_array_get_cstring_nocopy (xhp -> repositories , i , & repouri );
6770 if (xbps_repo_sync (xhp , repouri ) == -1 ) {
You can’t perform that action at this time.
0 commit comments