Bonjour,
Je vous propose un nouvel élément à utiliser : script d'install qcad
vous le lancez avec la commande installqcad.
au bout d'une heure 30 à peu près, il demandera votre mot de passe pour installer Qcad dans votre système
Qu'en pensez-vous ?
Version imprimable
Bonjour,
Je vous propose un nouvel élément à utiliser : script d'install qcad
vous le lancez avec la commande installqcad.
au bout d'une heure 30 à peu près, il demandera votre mot de passe pour installer Qcad dans votre système
Qu'en pensez-vous ?
Bonjour,
- cut | sed est maladroit.
- supprimer un répertoire sans demande de confirmation, c'est violent. Pourquoi ne pas le déplacer en le datant ?
- tu fais un install sans faire d'update avant ? 8O
- ce script ne fonctionnera donc d'ailleurs que sur les distributions basées sur Debian. Il faut le vérifier avant.
- pourquoi installDir n'est-il pas sous /tmp, s'il n'a pas à être conservé ?
- les noms de variables tout en majuscules sont par convention réservés aux variables d'environnement système (HOME, PWD...)
- un script d'installation doit être exécutable par root :- pourquoi passer par temporaire pour finalement le copier, puis le supprimer ?Code:((UID)) && { >&2 echo "must be root"; exit 1;}
merci pour la réponse
Citation:
- cut | sed est maladroit.
que me propose-tu pour récupérer la version de Qt?Code:
1
2
3 $ qmake --version QMake version 3.1 Using Qt version 5.15.8 in /usr/lib/x86_64-linux-gnu
oui c'est vraiCitation:
- supprimer un répertoire sans demande de confirmation, c'est violent. Pourquoi ne pas le déplacer en le datant ?
correction:
Code:
1
2
3
4
5 dirinstall=/tmp/qcad aujourdhui="$(date|cut -d\ -f2,3,4)" if [ -d $dirinstall ];then mv $dirinstall $dirinstall-"$aujourdhu"i fi
ca marche dans un terminal, mais dans le script ça me donne:Citation:
((UID)) && { >&2 echo "must be root"; exit 1;}
Code:./installqcad: 19: UID: not found
comment le vérifie-t-on?Citation:
- ce script ne fonctionnera donc d'ailleurs que sur les distributions basées sur Debian. Il faut le vérifier avant
correction:Citation:
- pourquoi installDir n'est-il pas sous /tmp, s'il n'a pas à être conservé ?
quand j'éxécute ce script comme ceci:Code:dirinstall=/tmp/qcad
ça me donneCode:sudo ./installqcad
une idée?Code:
1
2
3
4 git@github.com: Permission denied (publickey). fatal*: Impossible de lire le dépôt distant. Veuillez vérifier que vous avez les droits d'accès
ouCode:qmake --version | tail -1 | cut -d ' ' -f4
je préfère la première. :)Code:qmake --version | sed -n '$s/.* \([0-9]\+\.[^ ]*\).*/\1/p'
pour l'UID, c'est une variable non connu de /bin/sh (/bin/sh n'est pas toujours un lien vers /bin/bash, mais vers un shell plus POSIX qui permet moins de souplesse) :pour identifier la distribution sur laquelle tourne le script, il me semble que toutes les distributions ont un fichier /etc/os-release...Code:if test ${UID:-$(id -u)} -gt 0; then echo "must be root"; fi
le script est maintenant:Code:
1
2
3
4
5
6 Clonage dans '/tmp/qcad'... git@github.com: Permission denied (publickey). fatal*: Impossible de lire le dépôt distant. Veuillez vérifier que vous avez les droits d'accès et que le dépôt existe.
comment utiliser /etc/os-release?Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 #!/bin/sh # installqcad, installeur de qcad # Copyright (C) 2023 Mathieu SERPA # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. if test ${UID:-$(id -u)} -gt 0; then echo "must be root"; exit 1; fi apt update apt install qtbase5-dev #pour qmake version="$(qmake --version | tail -1 | cut -d ' ' -f4)" dirinstall=/tmp/qcad aujourdhui="$(date|cut -d\ -f2,3,4)" apt install gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev qt5-qmake libqt5svg5-dev libqt5script5 libqt5help5 libqt5designer5 libqt5scripttools5 qtscript5-dev qtxmlpatterns5-dev-tools libqt5xmlpatterns5 libqt5xmlpatterns5-dev libqt5designer5 python3-pyside2.qtuitools libqscintilla2-qt5-designer libqt5designer5 qttools5-dev qt5-image-formats-plugins qtwayland5 qtwayland5-dev-tools libqt5waylandclient5 qtscript5-dev qttools5-dev libqt5xmlpatterns5-dev if [ -d $dirinstall ];then mv $dirinstall $dirinstall-"$aujourdhui" fi mkdir -p $dirinstall git clone git@github.com:qcad/qcad.git $dirinstall if [ ! -d $dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-"$version" ] ;then mkdir -p $dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-"$version" cd $dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-"$version" cat > qt-labs-qtscriptgenerator-"$version".pro <<FIN include( ../../../shared.pri ) SUBDIRS = ../qt-labs-qtscriptgenerator-5.5.0/qtbindings TEMPLATE = subdirs FIN fi cd $dirinstall qmake -r CONFIG+=ractivated make release cp -r $dirinstall /opt cat > /usr/local/bin/qcad <<FIN XDG_SESSION_TYPE=x11 LD_LIBRARY_PATH=/opt/qcad/release /opt/qcad/release/qcad-bin FIN chmod 755 /usr/local/bin/qcad cp /opt/qcad/qcad.desktop /usr/share/applications if [ ! -d /usr/local/share/icons/hicolor/256x256/apps ];then mkdir -p /usr/local/share/icons/hicolor/256x256/apps fi cp /opt/qcad/scripts/qcad_icon.png /usr/local/share/icons/hicolor/256x256/apps rm -rf $dirinstall mv $dirinstall$-$aujourdhui $dirinstall
une idée?
il faut faire:
Code:git clone https://github.com/qcad/qcad.git $dirinstall
je reviens dans 2 heures vous dire si ça a marchéCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 #!/bin/sh # installqcad, installeur de qcad # Copyright (C) 2023 Mathieu SERPA # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. if test ${UID:-$(id -u)} -gt 0; then echo "must be root"; exit 1; fi apt update apt install qtbase5-dev #pour qmake version="$(qmake --version | tail -1 | cut -d ' ' -f4)" dirinstall=/tmp/qcad aujourdhui="$(date|cut -d\ -f2,3,4)" apt install gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev qt5-qmake libqt5svg5-dev libqt5script5 libqt5help5 libqt5designer5 libqt5scripttools5 qtscript5-dev qtxmlpatterns5-dev-tools libqt5xmlpatterns5 libqt5xmlpatterns5-dev libqt5designer5 python3-pyside2.qtuitools libqscintilla2-qt5-designer libqt5designer5 qttools5-dev qt5-image-formats-plugins qtwayland5 qtwayland5-dev-tools libqt5waylandclient5 qtscript5-dev qttools5-dev libqt5xmlpatterns5-dev if [ -d $dirinstall ];then mv $dirinstall $dirinstall-"$aujourdhui" fi mkdir -p $dirinstall git clone https://github.com/qcad/qcad.git $dirinstall if [ ! -d $dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-"$version" ] ;then mkdir -p $dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-"$version" cd $dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-"$version" cat > qt-labs-qtscriptgenerator-"$version".pro <<FIN include( ../../../shared.pri ) SUBDIRS = ../qt-labs-qtscriptgenerator-5.5.0/qtbindings TEMPLATE = subdirs FIN fi cd $dirinstall qmake -r CONFIG+=ractivated make release cp -r $dirinstall /opt cat > /usr/local/bin/qcad <<FIN XDG_SESSION_TYPE=x11 LD_LIBRARY_PATH=/opt/qcad/release /opt/qcad/release/qcad-bin FIN chmod 755 /usr/local/bin/qcad cp /opt/qcad/qcad.desktop /usr/share/applications if [ ! -d /usr/local/share/icons/hicolor/256x256/apps ];then mkdir -p /usr/local/share/icons/hicolor/256x256/apps fi cp /opt/qcad/scripts/qcad_icon.png /usr/local/share/icons/hicolor/256x256/apps rm -rf $dirinstall mv $dirinstall$-$aujourdhui $dirinstall
sinon, comment utiliser /etc/os-release?
tu sais que qcad propose déjà un installeur ?
oui mais pour la version trial payante
github demande une vérification de clés, ça pourrait ne pas fonctionner dans un processus automatisé (un script)
en passant par HTTPS (git clone https://github.com/qcad/qcad.git qcad), rien n'est demandé.
ce n'est pas ce que j'ai indiqué au post #6?
oops! je n'avais pas vu. :ccool:
et si je rajoutais:
Code:if test "$(grep Debian /etc/os-release)" == "" && test "$(grep Ubuntu /etc/os-release)" == "" && test "$(grep Mint /etc/os-release)" == "";then echo "se scritp fonctionne avec Debian,Ubuntu ou Mint"; exit 2; fi
bof
grep accepte les regex :roll: et, il suffit de tester si la commande est en erreur ou non (et pas la sortie) ;)
ps: existe 3600 dérivées de debian/ubuntu, je n'aucune idée de ce que l'on peut tester ou non (puisque je ne les connais pas toutes)Code:grep -Ei 'NAME.*(xxx|yyy)' /etc/os-release -c
Sans doute , il est préférable de tester si la commande apt existe ???
comme ceci?
ou bien :Code:if test "$(grep -Ei 'NAME.*(Debian|Ubuntu|Mint)' /etc/os-release -c)"==2;then echo "La distribution n'est pas Debian, Ubuntu ou Mint"; fi
Code:if test "$(find /usr/bin -name apt)" != "/usr/bin/apt"; then echo "La distribution n'est pas dérivée Debian";fi
voici le script:
comment fait-on pour l'uploader à la place de l'ancien?Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64 #!/bin/sh # installqcad, installeur de qcad # Copyright (C) 2023 Mathieu SERPA # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. if test "$(find /usr/bin -name apt)" != "/usr/bin/apt"; then echo "La distribution n'est pas dérivée Debian"; exit 1; fi if test ${UID:-$(id -u)} -gt 0; then echo "script exécutable en droits root uniquement"; exit 2; fi apt update apt install qtbase5-dev #pour qmake version="$(qmake --version | tail -1 | cut -d ' ' -f4)" dirinstall=/tmp/qcad dossierorigine=$PWD apt install gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev qt5-qmake libqt5svg5-dev libqt5script5 libqt5help5 libqt5designer5 libqt5scripttools5 qtscript5-dev qtxmlpatterns5-dev-tools libqt5xmlpatterns5 libqt5xmlpatterns5-dev libqt5designer5 python3-pyside2.qtuitools libqscintilla2-qt5-designer libqt5designer5 qttools5-dev qt5-image-formats-plugins qtwayland5 qtwayland5-dev-tools libqt5waylandclient5 qtscript5-dev qttools5-dev libqt5xmlpatterns5-dev if [ -d $dirinstall ];then echo "le dossier /tmp/qcad existe déja"; exit 3 fi mkdir -p $dirinstall git clone https://github.com/qcad/qcad.git $dirinstall if [ ! -d $dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-"$version" ] ;then mkdir -p $dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-"$version" cd $dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-"$version" cat > qt-labs-qtscriptgenerator-"$version".pro <<FIN include( ../../../shared.pri ) SUBDIRS = ../qt-labs-qtscriptgenerator-5.5.0/qtbindings TEMPLATE = subdirs FIN fi cd $dirinstall qmake -r CONFIG+=ractivated make release cp -r $dirinstall /opt cat > /usr/local/bin/qcad <<FIN XDG_SESSION_TYPE=x11 LD_LIBRARY_PATH=/opt/qcad/release /opt/qcad/release/qcad-bin FIN chmod 755 /usr/local/bin/qcad cp /opt/qcad/qcad.desktop /usr/share/applications if [ ! -d /usr/local/share/icons/hicolor/256x256/apps ];then mkdir -p /usr/local/share/icons/hicolor/256x256/apps fi cp /opt/qcad/scripts/qcad_icon.png /usr/local/share/icons/hicolor/256x256/apps cd $dossierorigine
je ne sais pas.
de toute façon, c'est pas fini. :)
tu dois mettre toutes les variables entre guillemets : "$dirinstall", "$dirinstal/src/.../$version"...
tu dois indiquer le chemin absolu de "qt-labs-qtscriptgenerator-$version.pro".
je n'utilise pas cd dans mes scripts. il faudrait vraiment que je n'ai pas le choix
je ne fais pas beaucoup de compilation automatisée non plus, mais je vois dans le man make une option --directory...le cd final est très facultatif : l'environnement défini dans un script ne persiste pas dans l'environnement courant.Citation:
Change to directory dir before reading the makefiles or doing anything else.
à quoi sert l'option -r de qmake ?
ça ira comme cela?:
pour le make et le qmake, c'est pas moi qui les ai inventés, c'est indiqué sur le site de qcad. Je préfère ne pas modifier ça.Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58 #!/bin/sh # installqcad, installeur de qcad # Copyright (C) 2023 Mathieu SERPA # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. if test ${UID:-$(id -u)} -gt 0; then echo "droit root requis"; exit 1; fi apt update apt install qtbase5-dev #pour qmake version="$(qmake --version | tail -1 | cut -d ' ' -f4)" dirinstall=/tmp/qcad apt install gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev qt5-qmake libqt5svg5-dev libqt5script5 libqt5help5 libqt5designer5 libqt5scripttools5 qtscript5-dev qtxmlpatterns5-dev-tools libqt5xmlpatterns5 libqt5xmlpatterns5-dev libqt5designer5 python3-pyside2.qtuitools libqscintilla2-qt5-designer libqt5designer5 qttools5-dev qt5-image-formats-plugins qtwayland5 qtwayland5-dev-tools libqt5waylandclient5 qtscript5-dev qttools5-dev libqt5xmlpatterns5-dev if [ -d "$dirinstall" ];then echo "$dirinstall" existe déja exit 2 fi mkdir -p "$dirinstall" git clone https://github.com/qcad/qcad.git "$dirinstall" if [ ! -d "$dirinstall"/src/3rdparty/qt-labs-qtscriptgenerator-"$version" ] ;then mkdir -p "$dirinstall"/src/3rdparty/qt-labs-qtscriptgenerator-"$version" cat > "$dirinstall"/src/3rdparty/qt-labs-qtscriptgenerator-"$version"/qt-labs-qtscriptgenerator-"$version".pro <<FIN include( ../../../shared.pri ) SUBDIRS = ../qt-labs-qtscriptgenerator-5.5.0/qtbindings TEMPLATE = subdirs FIN fi "$dirinstall"/qmake -r CONFIG+=ractivated "$dirinstall"/make release cp -r "$dirinstall" /opt cat > /usr/local/bin/qcad <<FIN XDG_SESSION_TYPE=x11 LD_LIBRARY_PATH=/opt/qcad/release /opt/qcad/release/qcad-bin FIN chmod 755 /usr/local/bin/qcad cp /opt/qcad/qcad.desktop /usr/share/applications if [ ! -d /usr/local/share/icons/hicolor/256x256/apps ];then mkdir -p /usr/local/share/icons/hicolor/256x256/apps fi cp /opt/qcad/scripts/qcad_icon.png /usr/local/share/icons/hicolor/256x256/apps
https://www.qcad.org/en/component/co...n-from-sources
je crois que je suis obligé d'utiliser cdCode:
1
2 ./installqcad: 46: /tmp/qcad/qmake: not found ./installqcad: 47: /tmp/qcad/make: not found
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58 #!/bin/sh # installqcad, installeur de qcad # Copyright (C) 2023 Mathieu SERPA # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. if test ${UID:-$(id -u)} -gt 0; then echo "droit root requis"; exit 1; fi apt update apt install qtbase5-dev #pour qmake version="$(qmake --version | tail -1 | cut -d ' ' -f4)" dirinstall=/tmp/qcad apt install gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev qt5-qmake libqt5svg5-dev libqt5script5 libqt5help5 libqt5designer5 libqt5scripttools5 qtscript5-dev qtxmlpatterns5-dev-tools libqt5xmlpatterns5 libqt5xmlpatterns5-dev libqt5designer5 python3-pyside2.qtuitools libqscintilla2-qt5-designer libqt5designer5 qttools5-dev qt5-image-formats-plugins qtwayland5 qtwayland5-dev-tools libqt5waylandclient5 qtscript5-dev qttools5-dev libqt5xmlpatterns5-dev if [ -d "$dirinstall" ];then echo "$dirinstall" existe déja exit 2 fi mkdir -p "$dirinstall" git clone https://github.com/qcad/qcad.git "$dirinstall" if [ ! -d "$dirinstall"/src/3rdparty/qt-labs-qtscriptgenerator-"$version" ] ;then mkdir -p "$dirinstall"/src/3rdparty/qt-labs-qtscriptgenerator-"$version" cat > "$dirinstall"/src/3rdparty/qt-labs-qtscriptgenerator-"$version"/qt-labs-qtscriptgenerator-"$version".pro <<FIN include( ../../../shared.pri ) SUBDIRS = ../qt-labs-qtscriptgenerator-5.5.0/qtbindings TEMPLATE = subdirs FIN fi cd "$dirinstall" qmake -r CONFIG+=ractivated make release cp -r "$dirinstall" /opt cat > /usr/local/bin/qcad <<FIN XDG_SESSION_TYPE=x11 LD_LIBRARY_PATH=/opt/qcad/release /opt/qcad/release/qcad-bin FIN chmod 755 /usr/local/bin/qcad cp /opt/qcad/qcad.desktop /usr/share/applications if [ ! -d /usr/local/share/icons/hicolor/256x256/apps ];then mkdir -p /usr/local/share/icons/hicolor/256x256/apps fi cp /opt/qcad/scripts/qcad_icon.png /usr/local/share/icons/hicolor/256x256/apps
ça n'a pas de sens, forcément /tmp/qcad/make, ça ne va pas marcher.Code:"$dirinstall"/make release
concernant maken je suggérais make --directory="$dirinstall" release, mais si on ne peut pas faire la même chose pour qmake ce n'est pas très intéressant.
pour qmake, le --help ne m'aide pas vraiment.
et je ne vois pas -r, c'est pour ça que je demande.
ne suis-je donc pas obligé d'utiliser cd?
pour make a priori non, mais si c'est indispensable pour qmake, autant le laisser, et ne pas utiliser --directory=.
mais pas le dernier, pour retourner au répertoire de départ, je t'ai expliqué que ça ne sert à rien.
je l'ai bien enlevé (post #18)Citation:
mais pas le dernier, pour retourner au répertoire de départ, je t'ai expliqué que ça ne sert à rien.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58 #!/bin/sh # installqcad, installeur de qcad # Copyright (C) 2023 Mathieu SERPA # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. if test ${UID:-$(id -u)} -gt 0; then echo "droit root requis"; exit 1; fi apt update apt install qtbase5-dev #pour qmake version="$(qmake --version | tail -1 | cut -d ' ' -f4)" dirinstall=/tmp/qcad apt install gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev qt5-qmake libqt5svg5-dev libqt5script5 libqt5help5 libqt5designer5 libqt5scripttools5 qtscript5-dev qtxmlpatterns5-dev-tools libqt5xmlpatterns5 libqt5xmlpatterns5-dev libqt5designer5 python3-pyside2.qtuitools libqscintilla2-qt5-designer libqt5designer5 qttools5-dev qt5-image-formats-plugins qtwayland5 qtwayland5-dev-tools libqt5waylandclient5 qtscript5-dev qttools5-dev libqt5xmlpatterns5-dev if [ -d "$dirinstall" ];then echo "$dirinstall" existe déja exit 2 fi mkdir -p "$dirinstall" git clone https://github.com/qcad/qcad.git "$dirinstall" if [ ! -d "$dirinstall"/src/3rdparty/qt-labs-qtscriptgenerator-"$version" ] ;then mkdir -p "$dirinstall"/src/3rdparty/qt-labs-qtscriptgenerator-"$version" cat > "$dirinstall"/src/3rdparty/qt-labs-qtscriptgenerator-"$version"/qt-labs-qtscriptgenerator-"$version".pro <<FIN include( ../../../shared.pri ) SUBDIRS = ../qt-labs-qtscriptgenerator-5.5.0/qtbindings TEMPLATE = subdirs FIN fi cd "$dirinstall" qmake -r CONFIG+=ractivated make release cp -r "$dirinstall" /opt cat > /usr/local/bin/qcad <<FIN XDG_SESSION_TYPE=x11 LD_LIBRARY_PATH=/opt/qcad/release /opt/qcad/release/qcad-bin FIN chmod 755 /usr/local/bin/qcad cp /opt/qcad/qcad.desktop /usr/share/applications if [ ! -d /usr/local/share/icons/hicolor/256x256/apps ];then mkdir -p /usr/local/share/icons/hicolor/256x256/apps fi cp /opt/qcad/scripts/qcad_icon.png /usr/local/share/icons/hicolor/256x256/apps
je ne sortirais pas du script si le dirinstall existe déjà.
je le renommerais avec un horodatage, avec un simple avertissement.
et, c'est toute la chaîne qu'il faut mettre entre guillemets, pas uniquement les variables.Code:[ ! -d "$dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-$version" ]
ça vaut pour toutes les chaînes dans lesquelles il y a une/des variable(s).
comme cela: ?
voir d'ici deux heures si ça marcheCode:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 #!/bin/sh # installqcad, installeur de qcad # Copyright (C) 2023 Mathieu SERPA # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. if test ${UID:-$(id -u)} -gt 0; then echo "droit root requis"; exit 1; fi apt update apt install qtbase5-dev #pour qmake version="$(qmake --version | tail -1 | cut -d ' ' -f4)" dirinstall=/tmp/qcad maintenant="$(date|cut -d ' ' -f2,3,4,5)" apt install gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev qt5-qmake libqt5svg5-dev libqt5script5 libqt5help5 libqt5designer5 libqt5scripttools5 qtscript5-dev qtxmlpatterns5-dev-tools libqt5xmlpatterns5 libqt5xmlpatterns5-dev libqt5designer5 python3-pyside2.qtuitools libqscintilla2-qt5-designer libqt5designer5 qttools5-dev qt5-image-formats-plugins qtwayland5 qtwayland5-dev-tools libqt5waylandclient5 qtscript5-dev qttools5-dev libqt5xmlpatterns5-dev if [ -d "$dirinstall" ];then echo "$dirinstall" renommé en "$dirinstall-$maintenant" mv "$dirinstall" "$dirinstall-$maintenant" fi mkdir -p "$dirinstall" git clone https://github.com/qcad/qcad.git "$dirinstall" if [ ! -d "$dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-$version" ] ;then mkdir -p "$dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-$version" cat > "$dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-$version/qt-labs-qtscriptgenerator-$version.pro" <<FIN include( ../../../shared.pri ) SUBDIRS = ../qt-labs-qtscriptgenerator-5.5.0/qtbindings TEMPLATE = subdirs FIN fi cd "$dirinstall" qmake -r CONFIG+=ractivated make release cp -r "$dirinstall" /opt cat > /usr/local/bin/qcad <<FIN XDG_SESSION_TYPE=x11 LD_LIBRARY_PATH=/opt/qcad/release /opt/qcad/release/qcad-bin FIN chmod 755 /usr/local/bin/qcad cp /opt/qcad/qcad.desktop /usr/share/applications if [ ! -d /usr/local/share/icons/hicolor/256x256/apps ];then mkdir -p /usr/local/share/icons/hicolor/256x256/apps fi cp /opt/qcad/scripts/qcad_icon.png /usr/local/share/icons/hicolor/256x256/apps
si on exécute ce script plusieurs fois, ça marche mais ça veut aller lus loin, il veut recommencer avec l'ancienne session
je propose:Code:
1
2
3
4
5
6 make[3]*: on quitte le répertoire «*/tmp/qcad/src/run*» make[2]*: on quitte le répertoire «*/tmp/qcad/src/run*» make[1]*: on quitte le répertoire «*/tmp/qcad/src*» cd ../qcad-26/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /tmp/qcad-26/qcad-26.pro CONFIG+=ractivated ) && make -f Makefile release Cannot find file: /tmp/qcad-26/qcad-26.pro. make: *** [Makefile:455 : sub----qcad-26-release_ordered] Erreur 2
au lieu de :
faire plutôtCode:mv "$dirinstall" "$dirinstall-$maintenant"
je vais essayer ça et je reviens pour vous dire si ça marcheCode:mv "$dirinstall" "$maintenant-$dirinstall"
non pas comme ça car:
je crois qu'il faut faire:Code:
1
2
3 /tmp/qcad renommé en 26 juin 2023 11:44:21-/tmp/qcad mv: impossible de déplacer '/tmp/qcad' vers '26 juin 2023 11:44:21-/tmp/qcad': Aucun fichier ou dossier de ce type fatal*: le chemin de destination '/tmp/qcad' existe déjà et n'est pas un répertoire vide.
et je reviens dans deux heures pour vous en dire des nouvellesCode:
1
2 echo "$dirinstall" renommé en "/tmp/$maintenant-qcad" mv "$dirinstall" "/tmp/$maintenant-qcad"
et voilà, ça fonctionne
le dossier /tmp/qcad a été renommé en "26 juin 2023 11:51:40-qcad"
il n'est pas allé plus loin comme tout à l'heure
qu'en pensez-vous?Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 #!/bin/sh # installqcad, installeur de qcad # Copyright (C) 2023 Mathieu SERPA # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. if test ${UID:-$(id -u)} -gt 0; then echo "droit root requis"; exit 1; fi apt update apt install qtbase5-dev #pour qmake version="$(qmake --version | tail -1 | cut -d ' ' -f4)" dirinstall=/tmp/qcad maintenant="$(date|cut -d ' ' -f2,3,4,5)" apt install gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev qt5-qmake libqt5svg5-dev libqt5script5 libqt5help5 libqt5designer5 libqt5scripttools5 qtscript5-dev qtxmlpatterns5-dev-tools libqt5xmlpatterns5 libqt5xmlpatterns5-dev libqt5designer5 python3-pyside2.qtuitools libqscintilla2-qt5-designer libqt5designer5 qttools5-dev qt5-image-formats-plugins qtwayland5 qtwayland5-dev-tools libqt5waylandclient5 qtscript5-dev qttools5-dev libqt5xmlpatterns5-dev if [ -d "$dirinstall" ];then echo "$dirinstall" renommé en "/tmp/$maintenant-qcad" mv "$dirinstall" "/tmp/$maintenant-qcad" fi mkdir -p "$dirinstall" git clone https://github.com/qcad/qcad.git "$dirinstall" if [ ! -d "$dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-$version" ] ;then mkdir -p "$dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-$version" cat > "$dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-$version/qt-labs-qtscriptgenerator-$version.pro" <<FIN include( ../../../shared.pri ) SUBDIRS = ../qt-labs-qtscriptgenerator-5.5.0/qtbindings TEMPLATE = subdirs FIN fi cd "$dirinstall" qmake -r CONFIG+=ractivated make release cp -r "$dirinstall" /opt cat > /usr/local/bin/qcad <<FIN XDG_SESSION_TYPE=x11 LD_LIBRARY_PATH=/opt/qcad/release /opt/qcad/release/qcad-bin FIN chmod 755 /usr/local/bin/qcad cp /opt/qcad/qcad.desktop /usr/share/applications if [ ! -d /usr/local/share/icons/hicolor/256x256/apps ];then mkdir -p /usr/local/share/icons/hicolor/256x256/apps fi cp /opt/qcad/scripts/qcad_icon.png /usr/local/share/icons/hicolor/256x256/apps
les modérateurs m'autoriseront-ils à poster une nouvelle discussion pour savoir comment on upload un code-source pour remplacer une ancienne version?
il suffit d'aller sur a page du code source et cliquer sur "éditer"
et hop! une commande externe de plus en moins :DCode:
1
2
3
4
5
6
7
8 versionPro="$dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-$version/qt-labs-qtscriptgenerator-$version.pro" #... >"$versionPro" echo "include( ../../../shared.pri ) SUBDIRS = ../qt-labs-qtscriptgenerator-5.5.0/qtbindings TEMPLATE = subdirs" #... >/usr/local/bin/qcad echo "XDG_SESSION_TYPE=x11 LD_LIBRARY_PATH=/opt/qcad/release /opt/qcad/release/qcad-bin"
tu veux dire comme cela?
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 #!/bin/sh # installqcad, installeur de qcad # Copyright (C) 2023 Mathieu SERPA # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. if test ${UID:-$(id -u)} -gt 0; then echo "droit root requis"; exit 1; fi apt update apt install qtbase5-dev #pour qmake version="$(qmake --version | tail -1 | cut -d ' ' -f4)" dirinstall=/tmp/qcad maintenant="$(date|cut -d ' ' -f2,3,4,5)" versionPro="$dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-$version/qt-labs-qtscriptgenerator-$version.pro" #... apt install gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev gcc make libx11-dev libxext-dev libxrender-dev libglu1-mesa-dev libfreetype6-dev libfontconfig1-dev libssl-dev libdbus-1-dev libsm-dev qt5-qmake libqt5svg5-dev libqt5script5 libqt5help5 libqt5designer5 libqt5scripttools5 qtscript5-dev qtxmlpatterns5-dev-tools libqt5xmlpatterns5 libqt5xmlpatterns5-dev libqt5designer5 python3-pyside2.qtuitools libqscintilla2-qt5-designer libqt5designer5 qttools5-dev qt5-image-formats-plugins qtwayland5 qtwayland5-dev-tools libqt5waylandclient5 qtscript5-dev qttools5-dev libqt5xmlpatterns5-dev if [ -d "$dirinstall" ];then echo "$dirinstall" renommé en "/tmp/$maintenant-qcad" mv "$dirinstall" "/tmp/$maintenant-qcad" fi mkdir -p "$dirinstall" git clone https://github.com/qcad/qcad.git "$dirinstall" if [ ! -d "$dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-$version" ] ;then mkdir -p "$dirinstall/src/3rdparty/qt-labs-qtscriptgenerator-$version" >"$versionPro" echo "include( ../../../shared.pri ) SUBDIRS = ../qt-labs-qtscriptgenerator-5.5.0/qtbindings TEMPLATE = subdirs" fi cd "$dirinstall" qmake -r CONFIG+=ractivated make release cp -r "$dirinstall" /opt >/usr/local/bin/qcad echo "XDG_SESSION_TYPE=x11 LD_LIBRARY_PATH=/opt/qcad/release /opt/qcad/release/qcad-bin" chmod 755 /usr/local/bin/qcad cp /opt/qcad/qcad.desktop /usr/share/applications if [ ! -d /usr/local/share/icons/hicolor/256x256/apps ];then mkdir -p /usr/local/share/icons/hicolor/256x256/apps fi cp /opt/qcad/scripts/qcad_icon.png /usr/local/share/icons/hicolor/256x256/apps
effectivement, ça fonctionne
Merci à toi.
Bonjour :coucou:
Mais quelle horreur.Citation:
date|cut -d ' ' -f2,3,4,5
Code:date +"%d %b %Y %T"
oui ça marche aussi, merci pour ta contribution