File indexing completed on 2024-05-12 04:17:32

0001 #!/bin/bash
0002 
0003 # Script to create a manifest text file with git revision.
0004 #
0005 # Arguments : $1 : download directory.
0006 #             $2 : component name
0007 #
0008 # SPDX-FileCopyrightText: 2015-2024 by Gilles Caulier  <caulier dot gilles at gmail dot com>
0009 #
0010 # SPDX-License-Identifier: BSD-3-Clause
0011 #
0012 
0013 set -e
0014 set -C
0015 
0016 if [ "$1" == "" ]; then
0017     DOWNLOAD_DIR=$PWD
0018 else
0019     DOWNLOAD_DIR=$1
0020 fi
0021 
0022 echo "Download directory: $DOWNLOAD_DIR"
0023 
0024 # --- List git revisions for all sub-modules
0025 
0026 GITREV_LST=$DOWNLOAD_DIR/$2_manifest.txt
0027 
0028 rm -f $GITREV_LST
0029 currentDate=`date +"%Y-%m-%d"`
0030 upperName=`echo $2 | awk '{print toupper($0)}'`
0031 
0032 echo "+$upperName Snapshoot $currentDate" > $GITREV_LST
0033 
0034 echo "$2:$(cd $PWD && git rev-parse HEAD)" >> $GITREV_LST
0035 
0036 cat $GITREV_LST