Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing simplescreenrecorder breaks "appman list" #914

Closed
joedefen opened this issue Sep 1, 2024 · 7 comments · Fixed by #915
Closed

installing simplescreenrecorder breaks "appman list" #914

joedefen opened this issue Sep 1, 2024 · 7 comments · Fixed by #915

Comments

@joedefen
Copy link

joedefen commented Sep 1, 2024

If I appman install simplescreenrecorder, then appman files --byname shows (just the relevant line):

◆  simplescreenrecorder  |  0.4.4%2B1.ppa1.trusty1  |  appimage        |  46    MiB

Then appman list is broken showing no uninstalled apps and just (in my case):

YOU HAVE INSTALLED 12 APPLICATIONS OUT OF 2146 AVAILABLE

 ◆ bitwarden 2022.5.1
 ◆ firefox 129.0.2
 ◆ freefilesync 13.7
 ◆ inkscape 1.3.2
 ◆ krita 5.2.3
 ◆ libreoffice 7.6.7.2
 ◆ nvim 0.10.1
 ◆ obs-studio 30.2.1
/home/joe/.appman/appman/modules/database.am: line 350: printf: `B': invalid format character
 ◆ simplescreenrecorder 0.4.4
(END)

Apparently, the "%2B" in the simplescreenrecorder version field breaks appman list.

@ivan-hc ivan-hc closed this as completed in 37ecb8a Sep 1, 2024
@ivan-hc
Copy link
Owner

ivan-hc commented Sep 1, 2024

thanks for this report, update and retry

@ivan-hc
Copy link
Owner

ivan-hc commented Sep 1, 2024

if you face other issues, I have rewrote the patch a67a9da

@joedefen
Copy link
Author

joedefen commented Sep 1, 2024

Thanks. Looks fine now.

BTW, recent updates to "appman list" format (i.e., adding ascii escape sequences around the app names) broke "vappman". I fixed that by stripping all escape sequences out of the output of "appman list" before parsing.

Think about reducing its assumptions, I guess vappman could run "appman list", ignore the output, then suck up ~/.local/share/AM/x86_64-apps which appears relatively clean ... but am I trading one set of bad assumptions for another (like architecture?). Any suggestions?

@ivan-hc
Copy link
Owner

ivan-hc commented Sep 1, 2024

Think about reducing its assumptions, I guess vappman could run "appman list", ignore the output, then suck up ~/.local/share/AM/x86_64-apps which appears relatively clean ... but am I trading one set of bad assumptions for another (like architecture?). Any suggestions?

sorry, I've not understand this last part, what kind of suggestion you need?

@joedefen
Copy link
Author

joedefen commented Sep 1, 2024

The question is what is the "best" way for an "outside" (python) program to get the list of installed and uninstalled apps per appman? I need the app name, short description, and whether installed for each app.

Currently, I'm using "appman list" and "appman files --byname" which has been broken once so far by changes in the formatting of "appman list" to include colors. So, is there a better way that likely would have fewer breakages?

@ivan-hc
Copy link
Owner

ivan-hc commented Sep 1, 2024

I'm not good at all with python, but functions for the lists are really simple, maybe you can convert them to made them work with the hosted lists directly instead of using the inbuilt -l option of AppMan.

Anyway, colors in lists are managed by function "_colors"

_colors() {
	awk '{
		printf "%s \033[32m%s\033[0m", $1, $2
		{$1 = ""; $2 = ""; print $0;}
	}'
}

and it is referenced two times, in the above functions "_pretty_list" and "_pretty_list_compat", in the database.am module, the first three functions under this line

# LIST/QUERY

maybe you should find a way to disable the _colors function

@Samueru-sama
Copy link
Contributor

The question is what is the "best" way for an "outside" (python) program to get the list of installed and uninstalled apps per appman? I need the app name, short description, and whether installed for each app.

Currently, I'm using "appman list" and "appman files --byname" which has been broken once so far by changes in the formatting of "appman list" to include colors. So, is there a better way that likely would have fewer breakages?

There is very likely a way to tell python to ignore ansi escape codes. WIth fzf it was simply passing the --ansi flag.

ivan-hc added a commit that referenced this issue Sep 1, 2024
...fixing the database.am module, re-fixes #914
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants