diff --git a/Makefile b/Makefile index 1508db4..5f82287 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,10 @@ LDFLAGS := -L./$(BUILDDIR)/fmt -L./$(BUILDDIR)/cpr $(LDFLAGS) is_cpr_installed = $(shell ldconfig -p | grep libcpr > /dev/null && echo -n yes) -all: cpr fmt toml taur +all: mkbuilddir cpr fmt toml taur + +mkbuilddir: $(BUILDDIR) + mkdir -p $(BUILDDIR) cpr: ifneq ($(is_cpr_installed), yes) @@ -57,7 +60,6 @@ locale: scripts/make_mo.sh locale/ taur: cpr fmt toml $(OBJ) - mkdir -p $(BUILDDIR) $(CXX) $(OBJ) $(BUILDDIR)/toml++/toml.o -o $(BUILDDIR)/taur $(LDFLAGS) clean: diff --git a/src/main.cpp b/src/main.cpp index f05581f..cfa6fb0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -138,11 +138,12 @@ int installPkg(alpm_list_t *pkgNames) { pkgNamesVec.push_back((const char *)(pkgNames->data)); if (pkgNamesVec.empty()) { - if (op.op_s_search) + if (op.op_s_search) { log_println(WARN, _("Please specify a target")); - return false; + return false; + } } - + if (op.op_s_search) { for (size_t i = 0; i < pkgNamesVec.size(); i++) { vector pkgs = backend->search(pkgNamesVec[i], useGit, !op.op_s_search); @@ -205,23 +206,20 @@ int installPkg(alpm_list_t *pkgNames) { return false; } } + + if (op.op_s_upgrade) { + if (!config->aurOnly) { + log_println(INFO, _("Upgrading system packages!")); + string op_s = "-S"; - // install first system packages then the AUR ones - // but first check if url is not empty - // because it will then start installing system packages each loop - if (!pacmanPkgs.empty()) { - string op_s = "-S"; + if (op.op_s_sync) + op_s += 'y'; - if (op.op_s_sync) - op_s += 'y'; - if (op.op_s_upgrade) op_s += 'u'; - pacman_exec(op_s, pacmanPkgs); - } - - if (op.op_s_upgrade) { - log_println(DEBUG, _("Upgrading AUR packages!")); + pacman_exec(op_s, pacmanPkgs); + } + log_println(INFO, _("Upgrading AUR packages!")); backend->update_all_aur_pkgs(cacheDir, useGit); }