Skip to content

Commit 4a8f84e

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 ca32ab3 commit 4a8f84e

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
@@ -59,6 +59,7 @@ users)
5959
## Opamfile
6060

6161
## External dependencies
62+
* [BUG] Fix apt/debian lookup for installed packages [#6054 @rjbou]
6263

6364
## Format upgrade
6465

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)