etalab / transport-site

Rendre disponible, valoriser et améliorer les données transports
https://transport.data.gouv.fr
184 stars 28 forks source link

`restore_db.sh` - plantage sur MacOS #3962

Closed thbar closed 1 month ago

thbar commented 1 month ago

Régression introduite dans les récentes améliorations (https://github.com/etalab/transport-site/commits/master/restore_db.sh), non testées sur MacOS:

❯ ./restore_db.sh ../backups/postgresql_4a305f24-8a31-4815-b2bb-23f4711303ee-20240530030909.dump
getopt: illegal option -- l
getopt: illegal option -- g
getopt: illegal option -- e
getopt: illegal option -- l
getopt: illegal option -- ,
getopt: illegal option -- k
getopt: illegal option -- e
getopt: illegal option -- x
getopt: illegal option -- e
getopt: illegal option -- ,
getopt: illegal option -- r
getopt: illegal option -- e
getopt: illegal option -- e
getopt: illegal option -- r
getopt: illegal option -- v
getopt: illegal option -- e
getopt: illegal option -- b
getopt: illegal option -- a
getopt: illegal option -- j
getopt: illegal option -- b
getopt: illegal option -- a
getopt: illegal option -- m
getopt: illegal option -- e

Rien d'urgent je vais commenter en local ou utiliser la version précédente, le fonctionnement de getopt n'est pas homogène selon la plateforme.

ptitfred commented 1 month ago

En effet ; je vais m'y pencher et te proposer un patch

thbar commented 1 month ago

En effet ; je vais m'y pencher et te proposer un patch

Merci ! J'ai pu restaurer le backup en commentant, donc je te confirme ne pas être bloqué.

ptitfred commented 1 month ago

En effet ; je vais m'y pencher et te proposer un patch

Merci ! J'ai pu restaurer le backup en commentant, donc je te confirme ne pas être bloqué.

TL;DR: pas de support des long options dans la version Mac (BSD?) de getopt.

Je vais adapter en conséquence, mais c'est tristou.

Sinon je peux le faire à l'ancienne itérant sur les arguments. Quelle tristesse.