From 6b91f6f774dcae6f9233328901fba93f989da13e Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Thu, 5 Dec 2019 14:15:47 -0800 Subject: [PATCH 1/7] llvm.ffi: adding macOS location (when using homebrew). --- extra/llvm/ffi/ffi.factor | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extra/llvm/ffi/ffi.factor b/extra/llvm/ffi/ffi.factor index 5e11cc1d4b..9709dc21c6 100644 --- a/extra/llvm/ffi/ffi.factor +++ b/extra/llvm/ffi/ffi.factor @@ -5,9 +5,10 @@ kernel ldcache system ; IN: llvm.ffi << "llvm" { - { [ os linux? ] [ "LLVM-3.9" find-so [ cdecl add-library ] [ drop ] if* ] } + { [ os linux? ] [ "LLVM-3.9" find-so ] } + { [ os macosx? ] [ "/usr/local/opt/llvm/lib/libLLVM.dylib" ] } [ drop ] -} cond +} cond [ cdecl add-library ] when* >> LIBRARY: llvm From d58ce0fb5b8a4cd3baf9867c84aa8f98da2d64be Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 7 Dec 2019 09:48:03 -0800 Subject: [PATCH 2/7] webapps.pastebin: Email a list on every paste. --- extra/webapps/pastebin/pastebin.factor | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/extra/webapps/pastebin/pastebin.factor b/extra/webapps/pastebin/pastebin.factor index b51fc17b87..e1326ee015 100644 --- a/extra/webapps/pastebin/pastebin.factor +++ b/extra/webapps/pastebin/pastebin.factor @@ -4,13 +4,15 @@ USING: accessors calendar db db.tuples db.types furnace.actions furnace.auth furnace.boilerplate furnace.recaptcha furnace.redirection furnace.syndication html.forms http.server.dispatchers http.server.responses kernel math.parser -sequences sorting urls validators xmode.catalog ; +namespaces sequences smtp sorting urls validators xmode.catalog ; IN: webapps.pastebin TUPLE: pastebin < dispatcher ; SYMBOL: can-delete-pastes? +SYMBOL: pastebin-email-list + can-delete-pastes? define-capability ! ! ! @@ -150,6 +152,17 @@ M: annotation entity-url now >>date { "summary" "author" "mode" "contents" } to-object ; +: email-on-paste ( url -- ) + pastebin-email-list get-global [ + drop + ] [ + swap >>to + swap >>body + "factor-builds2@gmail.com" >>from + "New paste" >>subject + send-email + ] if-empty ; + : ( -- action ) [ @@ -168,7 +181,7 @@ M: annotation entity-url f [ deposit-entity-slots ] [ insert-tuple ] - [ id>> paste-url ] + [ id>> paste-url [ email-on-paste ] [ ] bi ] tri ] >>submit ; From 6bbdb5c12eb82741b77ec623cd0d92bc34efdd11 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 7 Dec 2019 09:58:01 -0800 Subject: [PATCH 3/7] websites.concatenative: endpoint for syncing github to factorcode --- extra/websites/concatenative/concatenative.factor | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extra/websites/concatenative/concatenative.factor b/extra/websites/concatenative/concatenative.factor index 5d93e23e7f..e9c2abbf55 100644 --- a/extra/websites/concatenative/concatenative.factor +++ b/extra/websites/concatenative/concatenative.factor @@ -95,7 +95,8 @@ SYMBOLS: key-password key-file dh-file ; : ( path -- responder ) swap enable-cgi >>default - URL" /gitweb.cgi" "" add-responder ; + URL" /gitweb.cgi" "" add-responder + URL" /github-sync.cgi" "github-sync" add-responder ; : init-production ( -- ) common-configuration From 1cb00c6f61ef014f6ad5b7f974426cea690a3a72 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 7 Dec 2019 10:29:07 -0800 Subject: [PATCH 4/7] webapps.pastebin: Fix the url --- extra/webapps/pastebin/pastebin.factor | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/extra/webapps/pastebin/pastebin.factor b/extra/webapps/pastebin/pastebin.factor index e1326ee015..5bee59895e 100644 --- a/extra/webapps/pastebin/pastebin.factor +++ b/extra/webapps/pastebin/pastebin.factor @@ -4,7 +4,8 @@ USING: accessors calendar db db.tuples db.types furnace.actions furnace.auth furnace.boilerplate furnace.recaptcha furnace.redirection furnace.syndication html.forms http.server.dispatchers http.server.responses kernel math.parser -namespaces sequences smtp sorting urls validators xmode.catalog ; +namespaces present sequences smtp sorting urls validators +xmode.catalog ; IN: webapps.pastebin TUPLE: pastebin < dispatcher ; @@ -156,6 +157,11 @@ M: annotation entity-url pastebin-email-list get-global [ drop ] [ + clone + "https" >>protocol + "paste.factorcode.org" >>host + [ "$pastebin" ?head drop ] change-path + present swap >>to swap >>body "factor-builds2@gmail.com" >>from From 03e7f918aed7282311b83522fcc1474dd7bbb438 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 7 Dec 2019 10:38:49 -0800 Subject: [PATCH 5/7] webapps.pastebin: fix using. oops. --- extra/webapps/pastebin/pastebin.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/webapps/pastebin/pastebin.factor b/extra/webapps/pastebin/pastebin.factor index 5bee59895e..6b07131285 100644 --- a/extra/webapps/pastebin/pastebin.factor +++ b/extra/webapps/pastebin/pastebin.factor @@ -4,7 +4,7 @@ USING: accessors calendar db db.tuples db.types furnace.actions furnace.auth furnace.boilerplate furnace.recaptcha furnace.redirection furnace.syndication html.forms http.server.dispatchers http.server.responses kernel math.parser -namespaces present sequences smtp sorting urls validators +namespaces present sequences smtp splitting sorting urls validators xmode.catalog ; IN: webapps.pastebin From e05eecf26bde2b6d26d229c5e35b7a052f11709a Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 7 Dec 2019 10:40:35 -0800 Subject: [PATCH 6/7] webapps.pastebin: fix --- extra/webapps/pastebin/pastebin.factor | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/extra/webapps/pastebin/pastebin.factor b/extra/webapps/pastebin/pastebin.factor index 6b07131285..c456ccf3d5 100644 --- a/extra/webapps/pastebin/pastebin.factor +++ b/extra/webapps/pastebin/pastebin.factor @@ -157,13 +157,12 @@ M: annotation entity-url pastebin-email-list get-global [ drop ] [ - clone + swap >>to + swap clone "https" >>protocol "paste.factorcode.org" >>host [ "$pastebin" ?head drop ] change-path - present - swap >>to - swap >>body + present >>body "factor-builds2@gmail.com" >>from "New paste" >>subject send-email From c71b92eba9851a684a4ae1345e4f72df805d6297 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 7 Dec 2019 15:54:57 -0800 Subject: [PATCH 7/7] webapps.pastebin: Cleaner url derivation, better variable names --- extra/webapps/pastebin/pastebin.factor | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/extra/webapps/pastebin/pastebin.factor b/extra/webapps/pastebin/pastebin.factor index c456ccf3d5..fd987c71c8 100644 --- a/extra/webapps/pastebin/pastebin.factor +++ b/extra/webapps/pastebin/pastebin.factor @@ -2,17 +2,18 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors calendar db db.tuples db.types furnace.actions furnace.auth furnace.boilerplate furnace.recaptcha -furnace.redirection furnace.syndication html.forms -http.server.dispatchers http.server.responses kernel math.parser -namespaces present sequences smtp splitting sorting urls validators -xmode.catalog ; +furnace.redirection furnace.syndication furnace.utilities +html.forms http.server.dispatchers http.server.responses kernel +math.parser namespaces present sequences smtp sorting splitting +urls validators xmode.catalog ; IN: webapps.pastebin TUPLE: pastebin < dispatcher ; SYMBOL: can-delete-pastes? -SYMBOL: pastebin-email-list +SYMBOL: pastebin-email-from +SYMBOL: pastebin-email-to can-delete-pastes? define-capability @@ -154,17 +155,14 @@ M: annotation entity-url { "summary" "author" "mode" "contents" } to-object ; : email-on-paste ( url -- ) - pastebin-email-list get-global [ + pastebin-email-to get-global [ drop ] [ - swap >>to - swap clone - "https" >>protocol - "paste.factorcode.org" >>host - [ "$pastebin" ?head drop ] change-path - present >>body - "factor-builds2@gmail.com" >>from - "New paste" >>subject + + swap >>to + swap adjust-url present >>body + pastebin-email-from get-global >>from + "New paste!" >>subject send-email ] if-empty ;