[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 797c980: Neater HTML table of old package versions (bug#35
From: |
Mattias Engdegård |
Subject: |
[elpa] master 797c980: Neater HTML table of old package versions (bug#35331) |
Date: |
Wed, 26 Jun 2019 13:10:42 -0400 (EDT) |
branch: master
commit 797c9800cca713e310ee3894822f3fa6c45755e0
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Neater HTML table of old package versions (bug#35331)
* admin/archive-contents.el (archive--html-bytes-format): Use IEC prefixes.
(archive--html-make-pkg): Sort old versions in newest-to-oldest order.
---
admin/archive-contents.el | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/admin/archive-contents.el b/admin/archive-contents.el
index de444e3..c4c2e5a 100644
--- a/admin/archive-contents.el
+++ b/admin/archive-contents.el
@@ -387,16 +387,14 @@ Rename DIR/ to PKG-VERS/, and return the descriptor."
(defun archive--html-bytes-format (bytes) ;Aka memory-usage-format.
(setq bytes (/ bytes 1024.0))
- (let ((units '(;; "B"
- "kB" "MB" "GB" "TB")))
+ (let ((units '("KiB" "MiB" "GiB" "TiB")))
(while (>= bytes 1024)
(setq bytes (/ bytes 1024.0))
(setq units (cdr units)))
(cond
- ;; ((integerp bytes) (format "%4d%s" bytes (car units)))
- ((>= bytes 100) (format "%4.0f%s" bytes (car units)))
- ((>= bytes 10) (format "%4.1f%s" bytes (car units)))
- (t (format "%4.2f%s" bytes (car units))))))
+ ((>= bytes 100) (format "%4.0f %s" bytes (car units)))
+ ((>= bytes 10) (format "%4.1f %s" bytes (car units)))
+ (t (format "%4.2f %s" bytes (car units))))))
(defun archive--get-prop (prop name srcdir mainsrcfile)
(let ((kprop (intern (format ":%s" (downcase prop)))))
@@ -536,7 +534,8 @@ Rename DIR/ to PKG-VERS/, and return the descriptor."
"\n</pre>\n")))
(unless (< (length files) (if (zerop (length latest)) 1 2))
(insert (format "<h2>Old versions</h2><table>\n"))
- (dolist (file files)
+ (dolist (file
+ (sort files (lambda (f1 f2) (version< (car f2) (car f1)))))
(unless (equal (pop file) latest)
(let ((attrs (file-attributes file)))
(insert (format "<tr><td><a
href=%S>%s</a></td><td>%s</td><td>%s</td>\n"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] master 797c980: Neater HTML table of old package versions (bug#35331),
Mattias Engdegård <=