|
26 | 26 |
|
27 | 27 | (eask-pkg-init) |
28 | 28 |
|
| 29 | +(require 'f) |
| 30 | + |
29 | 31 | (defconst make-outdate-version "20001122.1234" |
30 | 32 | "Outdate version.") |
31 | 33 |
|
32 | | -(defun mo--shell-execute (cmd &rest args) |
33 | | - "Return non-nil if CMD executed succesfully with ARGS." |
34 | | - (= 0 (shell-command (concat cmd " " |
35 | | - (mapconcat #'shell-quote-argument args " "))))) |
36 | | - |
37 | | -(defun mo--move-path (path dest) |
38 | | - "Move PATH to DEST." |
39 | | - (mo--shell-execute (if eask-is-windows "move" "mv") (expand-file-name path) (expand-file-name dest))) |
40 | | - |
41 | 34 | (defun make-outdate-package (name) |
42 | 35 | "Make package (NAME) outdate." |
43 | 36 | (let* ((dir (file-name-directory (locate-library name))) |
44 | | - (pkg (concat dir name "-pkg.el")) |
45 | | - (main (concat dir name ".el"))) |
| 37 | + (pkg (concat dir name "-pkg.el"))) |
46 | 38 | (with-current-buffer (find-file pkg) |
47 | 39 | (goto-char (point-min)) |
48 | 40 | (when (re-search-forward "\"[0-9.]*\"" nil t) |
|
56 | 48 | (let ((dest (expand-file-name (concat name "-" make-outdate-version "/") package-user-dir))) |
57 | 49 | (eask-info "Moving %s" dir) |
58 | 50 | (eask-info " to %s" dest) |
59 | | - (mo--move-path dir dest)) |
60 | | - (with-current-buffer (find-file main) |
61 | | - (when (re-search-forward "Package-Version: [0-9.]*" nil t) |
62 | | - (save-excursion |
63 | | - (let ((end (point))) |
64 | | - (backward-sexp) |
65 | | - (delete-region (point) end) |
66 | | - (insert (format "%s" make-outdate-version))))) |
67 | | - (save-buffer) |
68 | | - (kill-this-buffer)))) |
| 51 | + (ignore-errors (make-directory dest t)) |
| 52 | + (f-copy-contents dir dest) |
| 53 | + (ignore-errors (delete-directory dir t))))) |
69 | 54 |
|
70 | 55 | (make-outdate-package "dash") |
71 | 56 | (make-outdate-package "f") |
|
0 commit comments