install.sh (1524B)
1 #!/bin/sh 2 3 # Copyright (C) 2018-2019, 2022-2025 Centre National de la Recherche Scientifique 4 # Copyright (C) 2020-2022 Institut Mines Télécom Albi-Carmaux 5 # Copyright (C) 2022-2025 Institut Pierre-Simon Laplace 6 # Copyright (C) 2022-2025 Institut de Physique du Globe de Paris 7 # Copyright (C) 2018-2025 |Méso|Star> (contact@meso-star.com) 8 # Copyright (C) 2022-2025 Observatoire de Paris 9 # Copyright (C) 2022-2025 Université de Reims Champagne-Ardenne 10 # Copyright (C) 2022-2025 Université de Versaille Saint-Quentin 11 # Copyright (C) 2018-2019, 2022-2025 Université Paul Sabatier 12 # 13 # This program is free software: you can redistribute it and/or modify 14 # it under the terms of the GNU General Public License as published by 15 # the Free Software Foundation, either version 3 of the License, or 16 # (at your option) any later version. 17 # 18 # This program is distributed in the hope that it will be useful, 19 # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 # GNU General Public License for more details. 22 # 23 # You should have received a copy of the GNU General Public License 24 # along with this program. If not, see <http://www.gnu.org/licenses/>. 25 26 set -e 27 28 mode=$1 29 prefix=$2 30 shift 2 31 32 mkdir -p "${prefix}" 33 34 for i in "$@"; do 35 dst="${prefix}/${i##*/}" 36 37 if cmp -s "${i}" "${dst}"; then 38 printf 'Up to date %s\n' "${dst}" 39 else 40 printf 'Installing %s\n' "${dst}" 41 cp "${i}" "${prefix}" 42 chmod "${mode}" "${prefix}/$(basename "${i}")" 43 fi 44 done