cpack_repository/commit

Order clone information.

authorJan Wielemaker
Fri Dec 3 14:30:04 2010 +0100
committerJan Wielemaker
Fri Dec 3 14:30:04 2010 +0100
commit54e886c8db3198374939f9b87f84aaba597923c5
treea9e0f971dd1152b6f7cb4c29cc959f6e451e9642
parent482e2246091db023f14630ca588c836a2d892109
Diff style: patch stat
diff --git a/api/cpack.pl b/api/cpack.pl
index 642f8d8..c0bd6c0 100644
--- a/api/cpack.pl
+++ b/api/cpack.pl
@@ -207,10 +207,16 @@ file_option(URI, size(Bytes)) :-
 %
 %	Provide data necessary to clone a repository. Currently, we only
 %	clone the repositories. The user that  performs the clone is the
-%	submitter of the cloned data.
+%	submitter of the cloned data. We  try to order the dependencies,
+%	but on failure  we  provided  the   unsorted  package  to  allow
+%	debugging on the clone.
 
 cpack_clone_data(_Request) :-
-	findall(Pack, rdfs_individual_of(Pack, cpack:'Package'), Packs),
+	findall(Pack, rdfs_individual_of(Pack, cpack:'Package'), Packs0),
+	(   catch(cpack_list(Packs0, Packs), error(domain_error(_,_),_), fail)
+	->  true
+	;   Packs = Packs0
+	),
 	maplist(pack_info(clone), Packs, Data),
 	format('Content-type: application/x-prolog~n~n'),
 	format('% Server clone data~n~n', []),