storeman-developers / harbour-storeman-installer

Storeman Installer for SailfishOS
https://openrepos.net/content/olf/storeman-installer
GNU Lesser General Public License v2.1
5 stars 2 forks source link

Escape backticks #304

Closed nephros closed 8 months ago

nephros commented 8 months ago

The commands between them are actually evaluated, leading to lots of confusing help output in the log file.

nephros commented 8 months ago

Note that the behaviour is different depending on whether backticks appear between single or double quotes.

L75 is fine, log snippet:

2024-03-28T18:52:04+01:00 [Debug] "storeman" entries from `ssu lr`:

L146 and friends are not, they are expanded to pkcon help output:

2024-03-28T18:52:13+01:00 [Warning] Failed to refresh harbour-storeman-obs repository, because error-code 7 was returned by: pkcon -pv repo-set-data harbour-storeman-obs refresh-now true
2024-03-28T18:52:13+01:00 [Notice] Trying to terminate (i.e., sending SIGTERM to) all processes named (ID) Usage:
  pkcon [OPTION?] PackageKit Console Program

PackageKit Console Interface

Subcommands:
  backend-details
  get-roles
  get-groups
  get-filters
  get-transactions
  get-time
  search [name|details|group|file] [data]
  install [packages]
  install-local [files]
  download [directory] [packages]
[...]
Olf0 commented 8 months ago

Note that the behaviour is different depending on whether backticks appear between single or double quotes.

Yes, sure, that is what the "modern" syntax ($()) makes obvious so nicely, because most have the simplified rule in mind: Nothing is evaluated between double-quotes, except for $ followed by something, but in fact a sequence of two backticks also are. With single quotes really nothing is evaluated between them.

Olf0 commented 8 months ago

Also applied to sailfishos-chum-gui-installer, see https://github.com/sailfishos-chum/sailfishos-chum-gui-installer/pull/36