Giter VIP home page Giter VIP logo

el-get-lock's People

Contributors

tarao avatar yewton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

el-get-lock's Issues

el-get-bundle with initialization code for el-get-lock causes error

Hi,

If I initialize like the below:

(el-get-bundle tarao/el-get-lock (el-get-lock))

I get an error on the 2nd and subsequent loads of emacs:

error: El-get can not find a recipe for package "auth-source-xoauth2"

However if I change only this single line to the below keeping everything else identical:

(el-get-bundle tarao/el-get-lock) 
(el-get-lock)

This works fine.

I know the instructions recommend the later way - just wondering why the doing the initialization inside the el-get-bundle call doesn't work?

Also can you confirm if the order of el-get-lock-package-versions in the el-get.lock file is expected to make any difference when loading?

Thanks - and great package by the way :-)

el-get-bundle との組み合わせた場合の導入に関する問題

概要

el-get-bundleel-get-lock を組み合わせて導入すると、二回目移行の起動時に初期化が行われない場合があります。

詳細

el-get.lock が生成されていない状態で、 (el-get-lock) をした上で (el-get-bundle) を使ってパッケージのインストールを行うと、
el-get-status-file には :checksum が無く :afternil の状態で保存されます。

この状態で再起動すると、初期化の際に https://github.com/dimitri/el-get/blob/master/el-get.el#L381 が呼ばれ、これは el-get-status-file から読み込まれます。
直前の https://github.com/dimitri/el-get/blob/master/el-get.el#L377-L378 この部分で el-get-status-file が更新されていれば問題ないのですが、 el-get-bundle のスコープで定義された el-get-sources ( :after:checksum つき)と el-get-status-file の内容をマージするとき https://github.com/dimitri/el-get/blob/master/el-get-status.el#L364-L373 に、 :checksum の有無が異なるために更新が行われず、
結果として :after nil:checksum が無い source を元に初期化が行われてしまいます。

対応案

el-get-read-package-status-recipe:checksum をつけるようアドバイスする:

(defun el-get-lock-ad-read-package-status-recipe (orig-func &rest args)
  (let* ((recipe (apply orig-func args))
         (package (first args))
         (checksum (el-get-checksum package)))
    (if (plist-get recipe :checksum)
        recipe
      (plist-put recipe :checksum checksum))))
(advice-add #'el-get-read-package-status-recipe :around #'el-get-lock-ad-read-package-status-recipe)

もしくは、el-get-status-filechecksum も記録するように hook を仕込む:

(defun el-get-lock-save-installed-version-to-status (package)
  (let* ((name (if (stringp package) package (el-get-source-name package)))
         (checksum (ignore-errors (el-get-checksum name)))
         (version (and checksum (list :checksum checksum)))
         (recipe (el-get-package-def name)))
    (when (and version (not (plist-get recipe :checksum)))
      (el-get-save-package-status name "installed" (append version recipe)))))
(add-hook 'el-get-post-install-hooks #'el-get-lock-save-installed-version-to-status)

どちらかで対応できそうでした。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.