diff --git a/bin/le_publish.sh b/bin/le_publish.sh new file mode 100755 index 0000000000000000000000000000000000000000..ee2c35c2eb205daf41286b1d4e3db4540a70d044 --- /dev/null +++ b/bin/le_publish.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# Copyright (C) 2004-2010 Centro de Computacao Cientifica e Software Livre +# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR +# +# This file is part of Linux Educacional project +# +# Linux Educacional 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 2 +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. + +# This script is used to updated on mirror based on another. +# It will look for packages on <from> mirror and check whether they can be +# updated on <to> mirror. It always asks if you want to update before doing +# it. + +if (( $# < 2 )) || [[ "$1" == "--help" ]]; then + printf "Uso: le-publica repositorio arquivo1 [arquivo2 ... arquivoN]\n" + printf " repositorio = le-unstable | le-testing | le-stable | le-educ | le-rc\n" + exit 1 +fi + +REPOSITORIO=$1 +shift 1 +ARQUIVOS=$* + +if ! egrep -q "(le-testing|le-unstable|le-stable|le-educ|le-rc)" <<< $REPOSITORIO; then + printf "\"$REPOSITORIO\": Nao conhecido" + printf ", rode $0 --help para saber mais\n" + exit 1 +fi + +for pkg in $ARQUIVOS; do + if ! test -e "$pkg"; then + echo "ERROR: file doesn't exist: $pkg" + exit 1 + fi +done + +printf "Enviando arquivos:\n" +scp $ARQUIVOS $REPOSITORIO@windu.c3sl.ufpr.br:incoming + +exit $?