;; Author: Steve Youngs <steve@sxemacs.org>
;; Maintainer: Steve Youngs <steve@sxemacs.org>
;; Created: <2007-07-13>
-;; Time-stamp: <Monday Mar 17, 2014 22:33:38 steve>
+;; Time-stamp: <Friday Feb 12, 2021 16:19:09 steve>
;; Homepage: N/A
;; Keywords: utils package-management
(defun pkgusr-all-pkgs ()
"Return a list of all installed packages."
- (let ((lst (with-temp-buffer
- (insert-file-contents "/etc/group")
- (re-search-forward "^install:x:9999:" nil t)
- (narrow-to-region (point) (point-at-eol))
- (split-string-by-char (buffer-string) ?,))))
- lst))
+ (let ((pkgs ""))
+ (with-temp-buffer
+ (insert-file-contents "/etc/group")
+ (catch 'done
+ (while t
+ (if (re-search-forward "^install:x:9999:" nil t)
+ (setq pkgs (concat pkgs
+ (buffer-substring (point)
+ (point-at-eol))
+ ","))
+ (throw 'done nil))))
+ (split-string-by-char (substring pkgs 0 -1) ?,))))
(defvar pkgusr-all-pkgs (pkgusr-all-pkgs)
"A list of all installed packages.")