Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Print & exit if only installed pkgs #37

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

tarkah
Copy link
Contributor

@tarkah tarkah commented Apr 20, 2023

Resolves #29

Currently install doesn't check if final transaction state is comprised of only "installed" packages. This fixes the issue by only applying the transaction if there's >=1 package not currently installed.

If no new packages exist, the list of user provided packages already installed will be printed and exit.

As seen below, if user provides both installed & uninstalled packages, it'll only list new packages and carry on w/ the transaction. If user provides only installed packages, it'll print them and exit.

image

Comment on lines +20 to -30
import moss.client.cli : MossCLI;
import moss.client.cli : initialiseClient;
import moss.client.statedb;
import moss.client.ui;
import moss.deps.registry;
import std.stdio : writefln, writef, writeln;
import std.algorithm : map, filter;
import std.array : array;
import std.experimental.logger;
import std.file : exists;
import std.range : empty;
import std.stdio : writefln, writef, writeln;
import std.string : join, wrap, format, endsWith;
import std.algorithm : map, filter;
import moss.client.ui;
import moss.client.statedb;
import moss.client.cli : MossCLI;
import std.file : exists;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've sorted imports, but I can disregard in the future

Copy link
Member

@ermo ermo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for sorting imports.

LGTM, thanks!

@ermo ermo merged commit d79a642 into serpent-os:main Apr 20, 2023
@tarkah tarkah deleted the fix/empty-transaction branch April 20, 2023 14:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

moss creates an empty transaction if attempting to install an already installed package
2 participants