[10:55:35]
<m606> hello, any recommendation to parse one HTML file from an install script (i.e. read href param in <link> elements) ?
1. [Helper ynh_read_var_in_file](https://yunohost.org/en/packaging_apps_helpers_v2.1#ynh-read-var-in-file) does not seem to suit this purpose, would I have missed one more adequate?
2. should I use grep + REGEX?
3. should I use an HTML parser (though I can't see one already installed on my test instance - that may be overkill to install one just for that)?
[10:59:48]
<Aleks (he/him/il/lui)> depends on how complex the actual HTML is and how robust your want it to be
[10:59:51]
<Aleks (he/him/il/lui)> assuming the HMTL is simple enough, i would just go with grep+sed
[11:40:49]
<m606> yes HTML is [simple](https://github.com/robbalian/pinkarrows/blob/main/index.html).
Although I would like to make it robust enough to reduce maintenance work over upgrades. I want to parse link elem (e.g. `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css">`) and get their rel and href params to run something like: IF rel == "stylesheet" AND href includes "http" DO something. Would it remind you of something already implemented for some app package ? If not I guess I'll do a custom helper using grep in common.sh to be used for install & update scripts.
[12:03:00]
<m606> a simpler alternative would be to make a config file with template variables out of this HTML file, but I would have to make sure it has not changed at each upgrade, which somehow looks heavier to me
[12:04:01]
<Aleks (he/him/il/lui)> ... what are you trying to achieve exactly ...
[12:05:22]
<m606> > set up install script so that it download CDN file to a folder and links to the local files instead ?
[12:11:58]
<Aleks (he/him/il/lui)> then "just" use `grep cdn.jsdelivr.net` and `grep cdnjs.cloudflare.com` to scrap the assets that are on external CDN, download them locally, and use `sed` to replace the external URLs with local URLs ?
[12:33:00]
<m606> Hmm yes. That would make my life easier indeed, but I wonder whether I will see it in case the dev changes of CDN at some point ?
I guess package linter would warn about some newly added remote content though.
[12:33:04]
<m606> Thanks I will figure out what to do
[12:42:42]
<Aleks (he/him/il/lui)> hmf there's also this weird "posthog" thing
[13:00:12]
<m606> yes I will remove it
[13:00:15]
<m606> seems like analytics
[13:03:42]
<m606> using `perl` regex instead of `sed` is OK?
[13:05:23]
<Salamandar> well just don't forget readability™
[13:37:30]
<m606> finally I used a (complex but documented) `sed` command!
Last issue I guess, linter says I should not use `rm -rf` to remove old versions (e.g. `rm -rf libs/bootstrap@*`) but `ynh_secure_remove` instead.
1. ynh_secure_remove is not in 2.1 helpers documentation. Is it OK to use it even if I used only 2.1 helpers so far?
2. would wildcard work with ynh_secure_remove ? I wonder in particular whether this in the helper's code could eval as true with a wildcard - `[[ ! -e $file ]]` ?
[13:38:21]
<Aleks (he/him/il/lui)> you're looking for ynh_safe_rm in helpers 2.1 iirc
[13:42:19]
<m606> i have tested ynh_safe_rm, but as I feared, it won't take in a wildcard.
`ynh_safe_rm "libs/bootstrap@*"` returns `'libs/bootstrap@*' wasn't deleted because it doesn't exist.`
What would be best approach to delete all folders in `libs/`: `bootstrap@2.4.5, bootstrap@2.4.6, bootstrap.2.4.7` as `rm -rf libs/boostrap@*` would ?
[13:42:22]
<m606> (I mean best approach not to trigger linter warning)
[13:42:24]
<Aleks (he/him/il/lui)> i would say `for dir in $(lslibs/bootstrap@*); do ynh_safe_rm $dir; done`, but the tricky part is that bash by default doesn't interpret wildcards in scripts
[13:42:24]
<Aleks (he/him/il/lui)> maybe `compgen` can be used apparently ?
[13:42:26]
<Aleks (he/him/il/lui)> `for dir in $(compgen -G "libs/bootstrap@*" || true); do ynh_safe_rm $dir; done`
[13:42:53]
<Aleks (he/him/il/lui)> ah no the `find` sounds more straightforward / less exotic
[13:42:54]
<m606> ok, yes easier for me to get
[13:42:56]
<Émy - OniriCorpe> > <@m606:matrix.org> i have tested ynh_safe_rm, but as I feared, it won't take in a wildcard.
> `ynh_safe_rm "libs/bootstrap@*"` returns `'libs/bootstrap@*' wasn't deleted because it doesn't exist.`
> What would be best approach to delete all folders in `libs/`: `bootstrap@2.4.5, bootstrap@2.4.6, bootstrap.2.4.7` as `rm -rf libs/boostrap@*` would ?
It’s because the * is inside the quotes
[13:43:04]
<m606> > <@oniricorpe:im.emelyne.eu> It’s because the * is inside the quotes
oh, you mean `ynh_safe_rm "libs/bootstrap@"*` would work ?
[13:43:12]
<Émy - OniriCorpe> > <@m606:matrix.org> oh, you mean `ynh_safe_rm "libs/bootstrap@"*` would work ?
I think so
[13:43:14]
<Émy - OniriCorpe> You can delete the quotes tbh, they are useless without variables
[13:43:17]
<m606> > <@oniricorpe:im.emelyne.eu> You can delete the quotes tbh, they are useless without variables
i simplified here, but by actual command is `ynh_safe_rm "$(echo $filepath | cut -d'/' -f-3 | cut -d'@' -f1)@*"`
[13:43:18]
<Aleks (he/him/il/lui)> (bash doesn't expand globs in script by default)
[13:43:19]
<Aleks (he/him/il/lui)> (and ynh_safe_rm takes a single arg by design to prevent issues with, idk, spaces in file names resulting in `rm -rf /var/www/$app /` or something like this
[13:43:29]
<m606> I don't know compgen and don't really measure the tricky part you mention - would you favor this over `find "$install_dir/libs" -name "bootstrap@*" -type d -exec ynh_safe_rm {} +` ?
[13:43:54]
<Émy - OniriCorpe> Okay
[13:44:56]
<m606> so I gave it try, FYI putting the wildcard outside of the quote brings the same behavior - I guess what Aleks said.
alternative using `find` seems to be working though.
[13:45:20]
<m606> Almost done... but got a last warning in the CI
```
2880 WARNING realpath: /var/cache/yunohost/app_tmp_work_dirs/app_0at6am4k/app_folder/patches/main: No such file or directory
```
[13:45:24]
<Aleks (he/him/il/lui)> yeah that's unrelated, i think it got fixed in bookworm but not in dex maybe?
[13:45:25]
<Émy - OniriCorpe> > <@m606:matrix.org> Almost done... but got a last warning in the CI
> ```
> 2880 WARNING realpath: /var/cache/yunohost/app_tmp_work_dirs/app_0at6am4k/app_folder/patches/main: No such file or directory
> ```
Hadn’t I fixed this shit??
[13:45:56]
<m606> OK thanks for your help!
[13:52:59]
<Yunohost Git/Infra notifications> App redirect goes down from level 8 to 1 in job [#30437](https://ci-apps.yunohost.org/ci/job/30437)
[13:53:02]
<Yunohost Git/Infra notifications> Autoupdater just ran, here are the results:
- 34 pending update PRs
- 8 new apps PRs
- 8 failed apps updates: anarchism, epicyon, fluffychat, mlmmj, mobilizon, onlyoffice, pleroma, sharkey
See the full log here: http://paste.yunohost.org/raw/ecunotirih
[13:53:58]
<Yunohost Git/Infra notifications> App ttrss failed all tests in job [#30441](https://ci-apps.yunohost.org/ci/job/30441) :(
[13:54:22]
<Yunohost Git/Infra notifications> App moodle goes down from level 8 to 1 in job [#30443](https://ci-apps.yunohost.org/ci/job/30443)
[14:04:49]
<Yunohost Git/Infra notifications> App moodle goes down from level 8 to 1 in job [#30443](https://ci-apps.yunohost.org/ci/job/30443)
[14:05:06]
<Yunohost Git/Infra notifications> App wireguard failed all tests in job [#30167](https://ci-apps.yunohost.org/ci/job/30167) :(
[14:07:23]
<Yunohost Git/Infra notifications> [apps] Salamandar pushed 9 commits to tools_apps_arg ([aaa81f20d73f...242ea33f4374](https://github.com/YunoHost/apps/compare/aaa81f20d73f...242ea33f4374))
[14:07:23]
<Yunohost Git/Infra notifications> [apps/tools_apps_arg] readme_generator: use get_apps_repo - Félix Piédallu
[14:10:37]
<Yunohost Git/Infra notifications> [apps/tools_apps_arg] readme_generator: use get_apps_repo - Félix Piédallu
[14:10:38]
<Yunohost Git/Infra notifications> [apps] Salamandar edited [pull request #2510](https://github.com/YunoHost/apps/pull/2510): tools: add get_apps_repo.py, a lib that allows to pass --apps-repo or --apps-dir to tools
[14:10:38]
<Yunohost Git/Infra notifications> [apps] Salamandar edited [pull request #2510](https://github.com/YunoHost/apps/pull/2510): tools: add get_apps_repo.py, a lib that allows to pass --apps-repo or --apps-dir to tools
[14:10:38]
<Yunohost Git/Infra notifications> [apps] Salamandar edited [pull request #2510](https://github.com/YunoHost/apps/pull/2510): tools: add get_apps_repo.py, a lib that allows to pass --apps-repo or --apps-dir to tools
[14:10:38]
<Yunohost Git/Infra notifications> [apps] Salamandar pushed 8 commits to tools_apps_arg ([242ea33f4374...5ca35f1f0ec6](https://github.com/YunoHost/apps/compare/242ea33f4374...5ca35f1f0ec6))
[14:11:11]
<Yunohost Git/Infra notifications> [apps] Salamandar pushed 8 commits to tools_apps_arg ([5ca35f1f0ec6...5c195fe20701](https://github.com/YunoHost/apps/compare/5ca35f1f0ec6...5c195fe20701))
[14:11:12]
<Yunohost Git/Infra notifications> [apps/tools_apps_arg] readme_generator: use get_apps_repo - Félix Piédallu
[14:12:32]
<Yunohost Git/Infra notifications> [apps] Salamandar pushed 8 commits to tools_apps_arg ([5c195fe20701...069a0796bbfe](https://github.com/YunoHost/apps/compare/5c195fe20701...069a0796bbfe))
[14:12:33]
<Yunohost Git/Infra notifications> [apps/tools_apps_arg] readme_generator: use get_apps_repo - Félix Piédallu
[14:12:38]
<Yunohost Git/Infra notifications> [apps] Salamandar pushed 5 commits to tools_apps_arg ([069a0796bbfe...1684b3ee214d](https://github.com/YunoHost/apps/compare/069a0796bbfe...1684b3ee214d))
[14:12:38]
<Yunohost Git/Infra notifications> [apps/tools_apps_arg] readme_generator: use get_apps_repo - Félix Piédallu
[14:12:38]
<Yunohost Git/Infra notifications> [apps] Salamandar edited [pull request #2510](https://github.com/YunoHost/apps/pull/2510): tools: add get_apps_repo.py, a lib that allows to pass --apps-repo or --apps-dir to tools
[14:13:36]
<rodinux> hello, I try see how resolve some issue on paheko with the autopatch for helpers 2.1, but I don't know how do that... adding a branch helpers_2.1 in the project ?
[14:13:38]
<rodinux> well the bot do one yet, I mean can I edit this branch ?
[14:13:39]
<Aleks (he/him/il/lui)> Yes probably, but you need to add an extra remote in git in addition to origin
[14:13:43]
<rodinux> I can first create a branch helpers-2.1 from auto-helpers-2.1 ?
[14:13:45]
<rodinux> It's strange this repository `yunohost-bot`
[14:13:47]
<rodinux> Ok, so you mean I can locally `git clone https://github.com/yunohost-bot/paheko_ynh` and add a remote to the project `https://github.com/YunoHost-Apps/paheko_ynh` ?
[14:13:50]
<rodinux> or just remote the project yet init with `https://github.com/yunohost-bot/paheko_ynh`.... then add and push the new branch `auto-helpers-2.1`...
[14:14:07]
<rodinux> well so I have add a git remote `git remote add bot git@github.com:yunohost-bot/paheko_ynh.git`, now can I edit the files in the branch `auto-helpers-2.1` or I have to create another branch in the origin ??
[14:14:09]
<Yunohost Git/Infra notifications> [apps] Salamandar edited [pull request #2510](https://github.com/YunoHost/apps/pull/2510): tools: add get_apps_repo.py, a lib that allows to pass --apps-repo or --apps-dir to tools
[14:14:09]
<Yunohost Git/Infra notifications> [apps] github-actions[bot] pushed 1 commit to actions/toml: list_builder: use ge_apps_repo ([dd6402c6](https://github.com/YunoHost/apps/commit/dd6402c6665721ea5e098bd7394b3518ea725aab))
[14:14:10]
<Yunohost Git/Infra notifications> [apps] Salamandar pushed 1 commit to tools_apps_arg: list_builder: use ge_apps_repo ([dd6402c6](https://github.com/YunoHost/apps/commit/dd6402c6665721ea5e098bd7394b3518ea725aab))
[14:15:02]
<Yunohost Git/Infra notifications> [apps] Salamandar pushed 9 commits to tools_apps_arg ([dd6402c66657...bc29abd2aec6](https://github.com/YunoHost/apps/compare/dd6402c66657...bc29abd2aec6))
[14:15:04]
<Yunohost Git/Infra notifications> [apps] Salamandar pushed 9 commits to tools_apps_arg ([bc29abd2aec6...e4c46d0723c9](https://github.com/YunoHost/apps/compare/bc29abd2aec6...e4c46d0723c9))
[14:15:04]
<Yunohost Git/Infra notifications> [apps/tools_apps_arg] app_caches: use get_apps_repo - Félix Piédallu
[22:05:32]
<Yunohost Git/Infra notifications> [apps] yunohost-bot created new branch add-to-wishlist-librephotos
[22:10:49]
<Yunohost Git/Infra notifications> [apps] mjeammet [commented](https://github.com/YunoHost/apps/pull/2578#issuecomment-2344789969) on [issue #2578](https://github.com/YunoHost/apps/pull/2578) Add LibrePhotos to wishlist: Check failed by stating app is already in wishlist while a quick lookup on the wishlist did not return any results. Id...
[22:11:01]
<Yunohost Git/Infra notifications> [apps] mjeammet [commented](https://github.com/YunoHost/apps/pull/2578#issuecomment-2344789969) on [issue #2578](https://github.com/YunoHost/apps/pull/2578) Add LibrePhotos to wishlist: Check failed stating app is already in wishlist while a quick lookup on the wishlist did not return any results 🤔 Id ...
[22:11:01]
<Yunohost Git/Infra notifications> [apps] mjeammet [commented](https://github.com/YunoHost/apps/pull/2578#issuecomment-2344789969) on [issue #2578](https://github.com/YunoHost/apps/pull/2578) Add LibrePhotos to wishlist: Check failed stating app is already in wishlist while a quick lookup on the wishlist did not return any results 🤔 Id ...
[22:22:33]
<Yunohost Git/Infra notifications> [apps] OniriCorpe [commented](https://github.com/YunoHost/apps/pull/2578#issuecomment-2344806196) on [issue #2578](https://github.com/YunoHost/apps/pull/2578) Add LibrePhotos to wishlist: It’s not on wishlist but in catalog here’s the wip package: https://github.com/YunoHost-Apps/librephotos_ynh
[22:22:34]
<Yunohost Git/Infra notifications> [apps] OniriCorpe closed [pull request #2578](https://github.com/YunoHost/apps/pull/2578): Add LibrePhotos to wishlist
[22:22:34]
<Yunohost Git/Infra notifications> [apps] OniriCorpe deleted branch add-to-wishlist-librephotos
[22:22:34]
<Yunohost Git/Infra notifications> [apps] OniriCorpe [commented](https://github.com/YunoHost/apps/pull/2578#issuecomment-2344806196) on [issue #2578](https://github.com/YunoHost/apps/pull/2578) Add LibrePhotos to wishlist: It’s not in wishlist but in catalog here’s the wip package: https://github.com/YunoHost-Apps/librephotos_ynh
[22:23:21]
<Yunohost Git/Infra notifications> [apps] OniriCorpe [commented](https://github.com/YunoHost/apps/pull/2578#issuecomment-2344806196) on [issue #2578](https://github.com/YunoHost/apps/pull/2578) Add LibrePhotos to wishlist: It’s not in wishlist but in catalog here’s the wip package: https://github.com/YunoHost-Apps/librephotos_ynh feel free...
[22:23:57]
<Yunohost Git/Infra notifications> [apps] OniriCorpe [commented](https://github.com/YunoHost/apps/pull/2578#issuecomment-2344806196) on [issue #2578](https://github.com/YunoHost/apps/pull/2578) Add LibrePhotos to wishlist: It’s not in wishlist but in catalog here’s the wip package: https://github.com/YunoHost-Apps/librephotos_ynh feel free...
[22:36:34]
<Yunohost Git/Infra notifications> [apps] OniriCorpe opened [pull request #2579](https://github.com/YunoHost/apps/pull/2579): wishlist: specify that we prefer description in English
[22:36:35]
<Yunohost Git/Infra notifications> [apps] yunohost-bot created new branch wishlist-description-english
[22:36:35]
<Yunohost Git/Infra notifications> [apps] yunohost-bot pushed 1 commit to wishlist-description-english: wishlist: specify that we prefer description in English ([8ec62f23](https://github.com/YunoHost/apps/commit/8ec62f23fae0884585ba41d47bb9f3714c55bda7))
[22:36:56]
<Yunohost Git/Infra notifications> [apps] OniriCorpe deleted branch wishlist-description-english
[22:36:57]
<Yunohost Git/Infra notifications> [apps] OniriCorpe pushed 1 commit to master: wishlist: specify that we prefer description in English ([26567568](https://github.com/YunoHost/apps/commit/26567568d349c3fe4f2712ba97f880ebca84c17a))
[22:36:57]
<Yunohost Git/Infra notifications> [apps] OniriCorpe merged [pull request #2579](https://github.com/YunoHost/apps/pull/2579): wishlist: specify that we prefer description in English
[22:37:12]
<Yunohost Git/Infra notifications> [apps] yunohost-bot opened [pull request #2580](https://github.com/YunoHost/apps/pull/2580): Translations update from Weblate for appstore
[22:48:44]
<Yunohost Git/Infra notifications> [apps] OniriCorpe approved [pull request #2580](https://github.com/YunoHost/apps/pull/2580#pullrequestreview-2298871257) Translations update from Weblate for appstore
[22:49:43]
<Yunohost Git/Infra notifications> [apps] OniriCorpe pushed 3 commits to master ([26567568d349...dcd3f720bad9](https://github.com/YunoHost/apps/compare/26567568d349...dcd3f720bad9))
[22:49:43]
<Yunohost Git/Infra notifications> [apps] OniriCorpe merged [pull request #2580](https://github.com/YunoHost/apps/pull/2580): Translations update from Weblate for appstore
[22:49:52]
<Yunohost Git/Infra notifications> [apps] github-actions[bot] pushed 3 commits to actions/toml ([26567568d349...dcd3f720bad9](https://github.com/YunoHost/apps/compare/26567568d349...dcd3f720bad9))
[22:49:59]
<Yunohost Git/Infra notifications> [apps/actions/toml] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: YunoHost/s... - Weblate