+(defgroup pcmpl-rpm nil
+ "Options for rpm completion."
+ :group 'pcomplete
+ :prefix "pcmpl-rpm-")
+
+;; rpm -qa can be slow. Adding --nodigest --nosignature is MUCH faster.
+(defcustom pcmpl-rpm-query-options
+ (let (opts)
+ (with-temp-buffer
+ (when (ignore-errors (call-process "rpm" nil t nil "--help"))
+ (if (search-backward "--nodigest " nil 'move)
+ (setq opts '("--nodigest")))
+ (goto-char (point-min))
+ (if (search-forward "--nosignature " nil t)
+ (push "--nosignature" opts))))
+ opts)
+ "String, or list of strings, with extra options for an rpm query command."
+ :version "24.3"
+ :type '(choice (const :tag "No options" nil)
+ (string :tag "Single option")
+ (repeat :tag "List of options" string))
+ :group 'pcmpl-rpm)
+
+(defcustom pcmpl-rpm-cache t
+ "Whether to cache the list of installed packages."
+ :version "24.3"
+ :type 'boolean
+ :group 'pcmpl-rpm)
+
+(defconst pcmpl-rpm-cache-stamp-file "/var/lib/rpm/Packages"
+ "File used to check that the list of installed packages is up-to-date.")
+
+(defvar pcmpl-rpm-cache-time nil
+ "Time at which the list of installed packages was updated.")
+
+(defvar pcmpl-rpm-packages nil
+ "List of installed packages.")
+