"Fossies" - the Fresh Open Source Software Archive

Member "ec2-api-9.0.0/tools/update-from-global-requirements.sh" (16 Oct 2019, 1241 Bytes) of package /linux/misc/openstack/ec2-api-9.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 # Copyright (c) 2016 OpenStack Foundation
    3 # All Rights Reserved.
    4 #
    5 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    6 #    not use this file except in compliance with the License. You may obtain
    7 #    a copy of the License at
    8 #
    9 #         http://www.apache.org/licenses/LICENSE-2.0
   10 #
   11 #    Unless required by applicable law or agreed to in writing, software
   12 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   13 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   14 #    License for the specific language governing permissions and limitations
   15 #    under the License.
   16 
   17 GLOBAL_REQS_PATH=${1:-$HOME/openstack/requirements/global-requirements.txt}
   18 
   19 function update() {
   20   rm -f temp-requirements.txt
   21   touch temp-requirements.txt
   22   while read line ; do
   23     local module=`echo $line | sed 's/\([.A-Za-z0-9\-]*\)[ ><!=\t]*.*/\1/'`
   24     local newm=`grep -e "^$module[ ><!=\t]" $GLOBAL_REQS_PATH`
   25     if ! grep "$newm" temp-requirements.txt >/dev/null ; then
   26       echo "$newm" >> temp-requirements.txt
   27     fi
   28   done < $1
   29   mv temp-requirements.txt $1
   30 }
   31 
   32 echo "Update requirements"
   33 update requirements.txt
   34 echo "Update test-requirements"
   35 update test-requirements.txt