File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ use WWW;
2
+ constant REPO = ' https://github.com/perl6/ecosystem/' ;
3
+ constant REPO-DIR = ' repo' . IO ;
4
+ constant META-FILE = REPO-DIR. add: ' META.list' ;
5
+
6
+ REPO-DIR. e or run <git clone >, REPO, REPO-DIR. absolute;
7
+ chdir REPO-DIR;
8
+
9
+ loop {
10
+ DateTime . now. say ;
11
+ run <git pull >;
12
+
13
+ my @ metas = META-FILE. lines ;
14
+ my $ changed = 0 ;
15
+ for @ metas {
16
+ next unless . ends-with : ' META.info' ;
17
+ my $ new = . substr (0 , * - chars ' /META.info' ) ~ ' /META6.json' ;
18
+ say " Trying to fetch $ new" ;
19
+ get ($ new ) and ++ $ changed and $ _ = $ new and say " \t $ new is good!" ;
20
+ }
21
+
22
+ if $ changed {
23
+ META-FILE. spurt : (| @ metas , ' ' ). join : " \n " ;
24
+ run <git commit >,
25
+ ' -m' , ' [automated commit] META.info→META6.json ('
26
+ ~ $ changed ~ ' URLs)' ,
27
+ META-FILE. absolute;
28
+
29
+ run <git pull --rebase >;
30
+ run <git push >;
31
+ }
32
+ else {
33
+ say " No dists changed" ;
34
+ }
35
+ say " Sleeping for half an hour" ;
36
+ sleep 60 * 30 ;
37
+ }
38
+
39
+ =finish
40
+
41
+ Checks the ecosystem dist URLs to META. info files to see whether
42
+ META6. json alternative is available. If yes, swaps to META6. json
43
+ and commits the change to the repo.
44
+
45
+ Creates directory `repo` in current directory and clones repo there.
46
+ Performs the check every 30 minutes. Requires cached github
47
+ credentials that have commit bit to ecosystem repo.
You can’t perform that action at this time.
0 commit comments