@@ -474,7 +474,8 @@ Arguments FNC and ARGS are used for advice `:around'."
474474 (url (format " https://raw.githubusercontent.com/emacs-eask/archives/master/%s / " name))
475475 (url-file (concat url file))
476476 (download-p)
477- (local-archive-p (string= name " local" )) ; exclude local elpa
477+ ; ; exclude local elpa
478+ (local-archive-p (string= name eask--local-archive-name))
478479 (fmt (eask--action-format (length package-archives))))
479480 (unless (file-exists-p local-file)
480481 (eask-with-verbosity-override 'log
@@ -1442,6 +1443,10 @@ argument COMMAND."
14421443(defun eask-f-source (name &optional location )
14431444 " Add archive NAME with LOCATION."
14441445 (when (symbolp name) (setq name (eask-2str name))) ; ensure to string, accept symbol
1446+ ; ; Handle local archive.
1447+ (when (equal name eask--local-archive-name)
1448+ (eask-error " Invalid archive name `%s' " name))
1449+ ; ; Handle multiple same archive name!
14451450 (when (assoc name package-archives)
14461451 (eask-error " Multiple definition of source `%s' " name))
14471452 (setq location (eask-source-url name location))
@@ -1456,18 +1461,28 @@ argument COMMAND."
14561461(defvar eask-depends-on-recipe-p nil
14571462 " Set to t if package depends on recipe." )
14581463
1464+ (defvar eask--local-archive-name " local"
1465+ " The local archive name." )
1466+
14591467(defun eask--setup-dependencies ()
14601468 " Setup dependencies list."
14611469 (setq eask-depends-on (reverse eask-depends-on)
14621470 eask-depends-on-dev (reverse eask-depends-on-dev))
14631471 (when eask-depends-on-recipe-p
14641472 (eask-with-progress
1465- " ✓ Checking local archives... "
1473+ (format " ✓ Checking local archives %s ... "
1474+ (ansi-magenta eask--local-archive-name))
14661475 (eask-with-verbosity 'debug
1467- (add-to-list 'package-archives `(" local" . , github-elpa-archive-dir ) t )
1468- ; ; If the local archives is added, we set the priority to a very
1469- ; ; high number so user we always use the specified dependencies!
1470- (add-to-list 'package-archive-priorities `(" local" . 90 ) t ))
1476+ ; ; Make sure can be customized by `source'
1477+ (unless (assoc eask--local-archive-name package-archives)
1478+ (add-to-list 'package-archives
1479+ `(, eask--local-archive-name . , github-elpa-archive-dir ) t ))
1480+ ; ; Make sure can be customized by `source-priority'
1481+ (unless (assoc eask--local-archive-name package-archive-priorities)
1482+ ; ; If the local archives is added, we set the priority to a very
1483+ ; ; high number so user we always use the specified dependencies!
1484+ (add-to-list 'package-archive-priorities
1485+ `(, eask--local-archive-name . 90 ) t )))
14711486 " done!" )))
14721487
14731488(add-hook 'eask-file-loaded-hook #'eask--setup-dependencies )
0 commit comments