git.fiddlerwoaroof.com
Browse code

Split out package definitions, optimize

Add some code to setting the current link more reliable

fiddlerwoaroof authored on 12/04/2017 21:11:47
Showing 5 changed files
... ...
@@ -12,7 +12,8 @@
12 12
 	       #:uiop
13 13
 	       #:yason)
14 14
   :serial t
15
-  :components ((:file "tools")
15
+  :components ((:file "package")
16
+	       (:file "tools")
16 17
 	       (:file "yason-encoders")
17 18
 	       (:file "encoders")
18 19
 	       (:file "feed-index-utils")
... ...
@@ -1,9 +1,3 @@
1
-(defpackage :alimenta.feed-archive.encoders
2
-  (:use :cl :alexandria :serapeum :fw.lu :alimenta.feed-archive.tools)
3
-  (:shadowing-import-from :alimenta.feed-archive.tools :->)
4
-  (:export :skip-item :the-condition :the-feed :feed-error
5
-	   :unwrap-feed-errors))
6
-
7 1
 (in-package :alimenta.feed-archive.encoders)
8 2
 
9 3
 (defun fix-path (path)
... ...
@@ -1,11 +1,5 @@
1
-(defpackage :alimenta.feed-archive
2
-  (:use :cl :alexandria :serapeum :fw.lu :alimenta.feed-archive.tools)
3
-  (:shadowing-import-from :alimenta.feed-archive.tools :->)
4
-  (:export #:init-feeds #:archive-feeds #:command-line-main))
5
-
6 1
 (in-package :alimenta.feed-archive)
7 2
 
8
-
9 3
 (defvar *feeds*)
10 4
 (defvar *feed-base*)
11 5
 
... ...
@@ -112,7 +106,8 @@
112 106
 	 (references (pull-and-store-feeds *feeds* pull-directory))
113 107
 	 (index-path (merge-pathnames "index.json" pull-directory)))
114 108
     (with-open-file (index index-path :direction :output)
115
-      (feed-index index pull-time references))))
109
+      (feed-index index pull-time references))
110
+    (format t "~&!! pull-directory ~a~%" (uiop:enough-pathname pull-directory *feed-base*))))
116 111
 
117 112
 ;; This is an ungodly mess, we need to avoid funneling everything through fix-pathname-or-skip
118 113
 (defun command-line-main (&optional (feed-list-initializer #'init-feeds))
119 114
new file mode 100644
... ...
@@ -0,0 +1,18 @@
1
+(defpackage :alimenta.feed-archive.tools
2
+  (:use :cl :alexandria :serapeum :fw.lu)
3
+  (:shadow :->)
4
+  (:export :fix-pathname :sha256-string :get-id :older-than-a-week :-> :get-feed-store-name
5
+	   :store :get-item-store-name :restart-once :coerce-feed-link :with-retry
6
+	   :older-than-a-month))
7
+
8
+(defpackage :alimenta.feed-archive.encoders
9
+  (:use :cl :alexandria :serapeum :fw.lu :alimenta.feed-archive.tools)
10
+  (:shadowing-import-from :alimenta.feed-archive.tools :->)
11
+  (:export :skip-item :the-condition :the-feed :feed-error
12
+	   :unwrap-feed-errors))
13
+
14
+(defpackage :alimenta.feed-archive
15
+  (:use :cl :alexandria :serapeum :fw.lu :alimenta.feed-archive.tools)
16
+  (:shadowing-import-from :alimenta.feed-archive.tools :->)
17
+  (:export #:init-feeds #:archive-feeds #:command-line-main))
18
+
... ...
@@ -1,10 +1,3 @@
1
-(defpackage :alimenta.feed-archive.tools
2
-  (:use :cl :alexandria :serapeum :fw.lu)
3
-  (:shadow :->)
4
-  (:export :fix-pathname :sha256-string :get-id :older-than-a-week :-> :get-feed-store-name
5
-	   :store :get-item-store-name :restart-once :coerce-feed-link :with-retry
6
-	   :older-than-a-month))
7
-
8 1
 (in-package :alimenta.feed-archive.tools)
9 2
 
10 3
 (defgeneric store (item directory)