From 6c67f37d415f99e4f99bd6fc1a3767856d6b3687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 24 Oct 2015 11:33:31 +0200 Subject: [PATCH] install: don't allow installed apps --- cmd/fdroidcl/install.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/fdroidcl/install.go b/cmd/fdroidcl/install.go index 995b36d..e945d07 100644 --- a/cmd/fdroidcl/install.go +++ b/cmd/fdroidcl/install.go @@ -26,7 +26,16 @@ func runInstall(args []string) { } device := mustOneDevice() apps := findApps(args) + inst := mustInstalled(device) + for _, app := range apps { + if _, e := inst[app.ID]; e { + log.Fatalf("%s is already installed", app.ID) + } + } + downloadAndInstall(apps, device) +} +func downloadAndInstall(apps []*fdroidcl.App, device *adb.Device) { type downloaded struct { apk *fdroidcl.Apk path string