Giter VIP home page Giter VIP logo

Comments (2)

tarao avatar tarao commented on June 3, 2024 1

el-get-lock-unlockで明示的にバージョン固定対象から外していた場合の考慮が漏れていたので、以下のようにした方がよいですね。(あと:checkoutを潰す方法が上のはちょっと雑だったので直してます。)

(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)))
         (recipe (el-get-package-def name))
         (unlocked (memq (intern name) el-get-lock-unlocked-packages)))
    (when (and checksum (not (plist-get recipe :checksum)) (not unlocked))
      (setq recipe (plist-put recipe :checksum checksum)
            recipe
            (loop for (k v) on recipe by #'cddr
                  unless (eq k :checkout)
                  collect k and collect v))
      (el-get-save-package-status name "installed" recipe))))
(add-hook 'el-get-post-install-hooks #'el-get-lock-save-installed-version-to-status)
(add-hook 'el-get-post-update-hooks #'el-get-lock-save-installed-version-to-status)

from el-get-lock.

tarao avatar tarao commented on June 3, 2024

ご報告および調査ありがとうございます。

el-get-updateの際にも同様の問題があり、元々はel-get本体側の変更でうまくいかなくなっていたという認識でしたが、いろいろ精査したところ、仰る通りel-get-status-fileの状態に:checksumが正しく反映されないのが原因とみてよさそうでした。el-get-updateの場合にも適用されるようにel-get-post-update-hooksにも登録する、el-get-updateの際にはel-get-lockが:checkoutを強制的に置き換えることでアップデートするのでそれがel-get-status-fileに入ってしまうのを防ぐ、という点を加えれば、@yewtonさんの提案ほぼそのままでうまくいきそうでした。以下のような具合です。

(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)))
         (recipe (el-get-package-def name)))
    (when (and checksum (not (plist-get recipe :checksum)))
      (let* ((recipe (plist-put recipe :checksum checksum))
             (recipe (plist-put recipe :checkout nil)))
        (el-get-save-package-status name "installed" recipe)))))
(add-hook 'el-get-post-install-hooks #'el-get-lock-save-installed-version-to-status)
(add-hook 'el-get-post-update-hooks #'el-get-lock-save-installed-version-to-status)

つきましては、上記コードを加えるpull requestをしていただけないでしょうか? (せっかく修正案まで作っていただいたので、@yewtonさんをauthorとして取り込みたいとおもいます。)

from el-get-lock.

Related Issues (2)

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.