Mercurial > hg > xemacs-beta
comparison lisp/package-get.el @ 410:de805c49cfc1 r21-2-35
Import from CVS: tag r21-2-35
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:19:21 +0200 |
parents | 2f8bb876ab1d |
children | 697ef44129c6 |
comparison
equal
deleted
inserted
replaced
409:301b9ebbdf3b | 410:de805c49cfc1 |
---|---|
371 (insert-file-contents-literally location) | 371 (insert-file-contents-literally location) |
372 (md5 (current-buffer))))) | 372 (md5 (current-buffer))))) |
373 (unless (and location (file-writable-p location)) | 373 (unless (and location (file-writable-p location)) |
374 (setq location package-get-user-index-filename)) | 374 (setq location package-get-user-index-filename)) |
375 (when (y-or-n-p (concat "Update package index in " location "? ")) | 375 (when (y-or-n-p (concat "Update package index in " location "? ")) |
376 (write-file location)))))) | 376 (let ((coding-system-for-write 'binary)) |
377 (write-file location))))))) | |
377 | 378 |
378 | 379 |
379 ;;;###autoload | 380 ;;;###autoload |
380 (defun package-get-update-base (&optional db-file force-current) | 381 (defun package-get-update-base (&optional db-file force-current) |
381 "Update the package-get database file with entries from DB-FILE. | 382 "Update the package-get database file with entries from DB-FILE. |
397 (let ((buf (get-buffer-create "*package database*"))) | 398 (let ((buf (get-buffer-create "*package database*"))) |
398 (unwind-protect | 399 (unwind-protect |
399 (save-excursion | 400 (save-excursion |
400 (set-buffer buf) | 401 (set-buffer buf) |
401 (erase-buffer buf) | 402 (erase-buffer buf) |
402 (insert-file-contents-internal db-file) | 403 (insert-file-contents-literally db-file) |
403 (package-get-update-base-from-buffer buf) | 404 (package-get-update-base-from-buffer buf) |
404 (if (file-remote-p db-file) | 405 (if (file-remote-p db-file) |
405 (package-get-maybe-save-index db-file))) | 406 (package-get-maybe-save-index db-file))) |
406 (kill-buffer buf)))) | 407 (kill-buffer buf)))) |
407 | 408 |
842 "No download sites or local package locations specified."))) | 843 "No download sites or local package locations specified."))) |
843 ;; Validate the md5 checksum | 844 ;; Validate the md5 checksum |
844 ;; Doing it with XEmacs removes the need for an external md5 program | 845 ;; Doing it with XEmacs removes the need for an external md5 program |
845 (message "Validating checksum for `%s'..." package) (sit-for 0) | 846 (message "Validating checksum for `%s'..." package) (sit-for 0) |
846 (with-temp-buffer | 847 (with-temp-buffer |
847 ;; What ever happened to i-f-c-literally | 848 (insert-file-contents-literally full-package-filename) |
848 (let (file-name-handler-alist) | |
849 (insert-file-contents-internal full-package-filename)) | |
850 (if (not (string= (md5 (current-buffer)) | 849 (if (not (string= (md5 (current-buffer)) |
851 (package-get-info-prop this-package | 850 (package-get-info-prop this-package |
852 'md5sum))) | 851 'md5sum))) |
853 (error "Package %s does not match md5 checksum" base-filename))) | 852 (error "Package %s does not match md5 checksum" base-filename))) |
854 | 853 |