Skip to content

Commit 5dcda90

Browse files
committed
depext: fix Debian/apt lookup for installed packages
dpkg-query output have the information in the first column, but only the second character needed to be looked up.
1 parent a4d9695 commit 5dcda90

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

master_changes.md

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ users)
6666
## External dependencies
6767
* Always pass --no-version-check and --no-write-registry to Cygwin setup [#6046 @dra27]
6868
* Use --quiet-mode noinput for the internal Cygwin installation (which is definitely a fully-specified command line) and --quiet-mode unattended for external Cygwin installations (in case the user does need to select something, e.g. a mirror) [#6046 @dra27]
69+
* [BUG] Fix apt/debian lookup for installed packages [#6054 @rjbou]
6970

7071
## Format upgrade
7172

src/state/opamSysInteract.ml

+14-2
Original file line numberDiff line numberDiff line change
@@ -774,12 +774,24 @@ let packages_status ?(env=OpamVariable.Map.empty) config packages =
774774
let get_installed str_pkgs =
775775
(* ouput:
776776
>ii uim-gtk3 1:1.8.8-6.1 amd64 Universal ...
777-
>ii uim-gtk3-immodule:amd64 1:1.8.8-6.1 amd64 Universal ...
777+
>ri uim-gtk3-immodule:amd64 1:1.8.8-6.1 amd64 Universal ...
778+
779+
First column is <desired action><package status>
780+
* Desired action:
781+
u = Unknown h = Hold p = Purge
782+
i = Install r = Remove
783+
* Package status:
784+
n = Not-installed U = Unpacked t = Triggers-pending
785+
c = Config-files F = Half-configured i = Installed
786+
H = Half-installed W = Triggers-awaiting
787+
788+
We focus on the second element of the column
778789
*)
779790
let re_pkg =
780791
Re.(compile @@ seq
781792
[ bol;
782-
str "ii";
793+
alpha;
794+
char 'i';
783795
rep1 @@ space;
784796
group @@ rep1 @@ diff (alt [alnum; punct]) (char ':');
785797
(* pkg:arch convention *)

0 commit comments

Comments
 (0)