-;;; FIXME: see comment at end of `pui-bootstrap'
-
-;;;###autoload
-(defun pui-bootstrap ()
- "Bootstrap the SXEmacs Package Tools.
-
-The Package Tools, under normal circumstances, cannot work until a
-couple of packages are pre-installed by hand. This function eliminates
-the need to do that. It uses FFI and libcurl to download and install
-the lastest package index file, the EFS and xemacs-base packages.
-
-Obviously you can't use this if you didn't enable FFI support in your
-SXEmacs or if you don't have libffi on your system.
-
-This isn't designed to replace the existing Package Tools so after
-you have run `pui-bootstrap' once you should then use the normal PUI
-tools, `pui-list-packages' etc."
- (interactive)
- ;; A little sanity checking never hurt anybody
- (when (featurep '(and efs-autoloads xemacs-base-autoloads))
- (error 'invalid-operation "PUI doesn't need bootstrapping"))
- (when (and (fboundp 'ffi-defun)
- (not (featurep '(and ffi ffi-curl))))
- (require 'ffi-curl))
- (unless (featurep 'ffi)
- (error 'unimplemented "FFI"))
- ;; One last check... has `package-get-remote' been set?
- (if (not (cdr package-get-remote))
- (when (y-or-n-p "You haven't set a download site, do you need help ")
- (declare-fboundp (Info-goto-node "(sxemacs)Bootstrapping PUI")))
- ;; We should be good to go
- (let* ((site (car package-get-remote))
- (dir (cadr package-get-remote))
- (url (concat "ftp://" site "/" dir "/"))
- (dldir (temp-directory))
- (index (expand-file-name package-get-base-filename
- package-get-package-index-file-location))
- xemacs-base-pkg
- efs-pkg
- ;status)
- )
- ;; Grab the index
- (message "Retrieving index, please be patient")
- (declare-fboundp (curl:download (concat url package-get-base-filename) index))
- (message "Retrieving index, done!")
- ;; Update the db
- (set-buffer (find-file-noselect index))
- (package-get-update-base-from-buffer)
- (kill-buffer (current-buffer))
- ;; Get xemacs-base, EFS
- (setq xemacs-base-pkg (package-get-info 'xemacs-base 'filename))
- (setq efs-pkg (package-get-info 'efs 'filename))
- (message "Retrieving %s, please be patient" xemacs-base-pkg)
- (declare-fboundp (curl:download (concat url xemacs-base-pkg)
- (expand-file-name xemacs-base-pkg dldir)))
- (message "Retrieving %s, please be patient" efs-pkg)
- (declare-fboundp (curl:download (concat url efs-pkg)
- (expand-file-name efs-pkg dldir)))
- (message "Download complete.")
- ;; Install xemacs-base
- (if (equal (package-get-info 'xemacs-base 'md5sum)
- (with-temp-buffer
- (insert-file-contents-literally
- (expand-file-name xemacs-base-pkg dldir))
- (md5 (current-buffer))))
- (progn
- (package-admin-add-binary-package
- (expand-file-name xemacs-base-pkg dldir)
- (package-admin-get-install-dir 'xemacs-base))
- (push (file-name-as-directory
- (expand-file-name "lisp/xemacs-base"
- (package-admin-get-install-dir 'xemacs-base)))
- load-path)
- (load-file (expand-file-name "lisp/xemacs-base/_pkg.el"
- (package-admin-get-install-dir 'xemacs-base)))
- (load-file (expand-file-name "lisp/xemacs-base/auto-autoloads.el"
- (package-admin-get-install-dir 'xemacs-base)))
- (message "xemacs-base package installed"))
- (delete-file (expand-file-name xemacs-base-pkg dldir))
- (error "MD5 mismatch, %s deleted" (expand-file-name xemacs-base-pkg dldir)))
- ;; Install EFS
- (if (equal (package-get-info 'efs 'md5sum)
- (with-temp-buffer
- (insert-file-contents-literally
- (expand-file-name efs-pkg dldir))
- (md5 (current-buffer))))
- (progn
- (package-admin-add-binary-package
- (expand-file-name efs-pkg dldir)
- (package-admin-get-install-dir 'efs))
- (push (file-name-as-directory
- (expand-file-name "lisp/efs"
- (package-admin-get-install-dir 'efs)))
- load-path)
- (load-file (expand-file-name "lisp/efs/_pkg.el"
- (package-admin-get-install-dir 'efs)))
- (load-file (expand-file-name "lisp/efs/auto-autoloads.el"
- (package-admin-get-install-dir 'efs)))
- (message "efs package installed"))
- (delete-file (expand-file-name efs-pkg dldir))
- (error "MD5 mismatch, %s deleted" (expand-file-name efs-pkg dldir)))
- (when (y-or-n-p "Install more packages? ")
- (declare-fboundp (pui-list-packages))))))
+;; This is obsolete now that #'package-get can use #'curl:download
+;;(defun pui-bootstrap ()
+;; "Bootstrap the SXEmacs Package Tools.
+
+;;The Package Tools, under normal circumstances, cannot work until a
+;;couple of packages are pre-installed by hand. This function eliminates
+;;the need to do that. It uses FFI and libcurl to download and install
+;;the lastest package index file, the EFS and xemacs-base packages.
+
+;;Obviously you can't use this if you didn't enable FFI support in your
+;;SXEmacs or if you don't have libffi on your system.
+
+;;This isn't designed to replace the existing Package Tools so after
+;;you have run `pui-bootstrap' once you should then use the normal PUI
+;;tools, `pui-list-packages' etc."
+;; (interactive)
+;; ;; A little sanity checking never hurt anybody
+;; (when (featurep '(and efs-autoloads xemacs-base-autoloads))
+;; (error 'invalid-operation "PUI doesn't need bootstrapping"))
+;; (when (and (fboundp 'ffi-defun)
+;; (not (featurep '(and ffi ffi-curl))))
+;; (require 'ffi-curl))
+;; (unless (featurep 'ffi)
+;; (error 'unimplemented "FFI"))
+;; ;; One last check... has `package-get-remote' been set?
+;; (if (not (cdr package-get-remote))
+;; (when (y-or-n-p "You haven't set a download site, do you need help ")
+;; (declare-fboundp (Info-goto-node "(sxemacs)Bootstrapping PUI")))
+;; ;; We should be good to go
+;; (let* ((site (car package-get-remote))
+;; (dir (cadr package-get-remote))
+;; (scheme (third package-get-remote))
+;; (url (concat scheme "://" site "/" dir "/"))
+;; (dldir (temp-directory))
+;; (index (expand-file-name package-get-base-filename
+;; package-get-package-index-file-location))
+;; xemacs-base-pkg
+;; efs-pkg
+;; ;status)
+;; )
+;; ;; Grab the index
+;; (message "Retrieving index, please be patient")
+;; (declare-fboundp (curl:download (concat url package-get-base-filename) index))
+;; (message "Retrieving index, done!")
+;; ;; Update the db
+;; (set-buffer (find-file-noselect index))
+;; (package-get-update-base-from-buffer)
+;; (kill-buffer (current-buffer))
+;; ;; Get xemacs-base, EFS
+;; (setq xemacs-base-pkg (package-get-info 'xemacs-base 'filename))
+;; (setq efs-pkg (package-get-info 'efs 'filename))
+;; (message "Retrieving %s, please be patient" xemacs-base-pkg)
+;; (declare-fboundp (curl:download (concat url xemacs-base-pkg)
+;; (expand-file-name xemacs-base-pkg dldir)))
+;; (message "Retrieving %s, please be patient" efs-pkg)
+;; (declare-fboundp (curl:download (concat url efs-pkg)
+;; (expand-file-name efs-pkg dldir)))
+;; (message "Download complete.")
+;; ;; Install xemacs-base
+;; (if (equal (package-get-info 'xemacs-base 'md5sum)
+;; (with-temp-buffer
+;; (insert-file-contents-literally
+;; (expand-file-name xemacs-base-pkg dldir))
+;; (md5 (current-buffer))))
+;; (progn
+;; (package-admin-add-binary-package
+;; (expand-file-name xemacs-base-pkg dldir)
+;; (package-admin-get-install-dir 'xemacs-base))
+;; (push (file-name-as-directory
+;; (expand-file-name "lisp/xemacs-base"
+;; (package-admin-get-install-dir 'xemacs-base)))
+;; load-path)
+;; (load-file (expand-file-name "lisp/xemacs-base/_pkg.el"
+;; (package-admin-get-install-dir 'xemacs-base)))
+;; (load-file (expand-file-name "lisp/xemacs-base/auto-autoloads.el"
+;; (package-admin-get-install-dir 'xemacs-base)))
+;; (message "xemacs-base package installed"))
+;; (delete-file (expand-file-name xemacs-base-pkg dldir))
+;; (error "MD5 mismatch, %s deleted" (expand-file-name xemacs-base-pkg dldir)))
+;; ;; Install EFS
+;; (if (equal (package-get-info 'efs 'md5sum)
+;; (with-temp-buffer
+;; (insert-file-contents-literally
+;; (expand-file-name efs-pkg dldir))
+;; (md5 (current-buffer))))
+;; (progn
+;; (package-admin-add-binary-package
+;; (expand-file-name efs-pkg dldir)
+;; (package-admin-get-install-dir 'efs))
+;; (push (file-name-as-directory
+;; (expand-file-name "lisp/efs"
+;; (package-admin-get-install-dir 'efs)))
+;; load-path)
+;; (load-file (expand-file-name "lisp/efs/_pkg.el"
+;; (package-admin-get-install-dir 'efs)))
+;; (load-file (expand-file-name "lisp/efs/auto-autoloads.el"
+;; (package-admin-get-install-dir 'efs)))
+;; (message "efs package installed"))
+;; (delete-file (expand-file-name efs-pkg dldir))
+;; (error "MD5 mismatch, %s deleted" (expand-file-name efs-pkg dldir)))
+;; (when (y-or-n-p "Install more packages? ")
+;; (declare-fboundp (pui-list-packages))))))