File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -238,8 +238,11 @@ main(int argc, char **argv)
238238
239239 /* Sync remote repository data and import keys from remote repos */
240240 if (syncf && !drun ) {
241- if ((rv = xbps_rpool_sync (& xh )) != 0 )
242- exit (rv );
241+ if ((rv = xbps_rpool_sync (& xh )) < 0 ) {
242+ fprintf (stderr , "Failed to sync repository pool: %s\n" ,
243+ strerror (- rv ));
244+ exit (- rv );
245+ }
243246 rv = xbps_rpool_foreach (& xh , repo_import_key_cb , NULL );
244247 if (rv != 0 )
245248 exit (rv );
Original file line number Diff line number Diff line change @@ -1486,8 +1486,8 @@ void xbps_rpool_release(struct xbps_handle *xhp);
14861486 *
14871487 * @param[in] xhp Pointer to the xbps_handle struct.
14881488 *
1489- * @return 0 on success, ENOTSUP if no repositories were found in
1490- * the configuration file .
1489+ * @return 0 on success or a negative errno otherwise.
1490+ * @retval -ENOENT There are no repositories to sync .
14911491 */
14921492int xbps_rpool_sync (struct xbps_handle * xhp );
14931493
Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ xbps_rpool_sync(struct xbps_handle *xhp)
6363{
6464 const char * repouri = NULL ;
6565
66+ if (xbps_array_count (xhp -> repositories ) == 0 )
67+ return - ENOENT ;
68+
6669 for (unsigned int i = 0 ; i < xbps_array_count (xhp -> repositories ); i ++ ) {
6770 xbps_array_get_cstring_nocopy (xhp -> repositories , i , & repouri );
6871 if (xbps_repo_sync (xhp , repouri ) == -1 ) {
You can’t perform that action at this time.
0 commit comments