"Fossies" - the Fresh Open Source Software Archive

Member "gnuastro-0.8/genauthors" (12 Mar 2018, 3270 Bytes) of package /linux/privat/gnuastro-0.8.tar.lz:


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. See also the last Fossies "Diffs" side-by-side code changes report for "genauthors": 0.5_vs_0.6.

    1 #! /bin/sh
    2 #
    3 # Generate a list of authors from the git repository, it will only
    4 # actually do anything if a .git file exists. Run like this:
    5 #
    6 #    ./genauthors top/bin/dir
    7 #
    8 # Note that some authors might have changed their email addresses over
    9 # the course of their contributions to Gnuastro. Fortunately Git has a
   10 # great tool for that: the .mailmap file. It has already been included
   11 # in the source code and if any author changes their email address or
   12 # would want their name to be printed differently here, please use
   13 # that file. See the git-shortlog manpage for a complete explanation
   14 # of all the possible ways to do this.
   15 #
   16 # Original author:
   17 #     Mohammad Akhlaghi <mohammad@akhlaghi.org>
   18 # Contributing author(s):
   19 # Copyright (C) 2015-2018, Free Software Foundation, Inc.
   20 #
   21 # Gnuastro is free software: you can redistribute it and/or modify it
   22 # under the terms of the GNU General Public License as published by the
   23 # Free Software Foundation, either version 3 of the License, or (at your
   24 # option) any later version.
   25 #
   26 # Gnuastro is distributed in the hope that it will be useful, but
   27 # WITHOUT ANY WARRANTY; without even the implied warranty of
   28 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   29 # General Public License for more details.
   30 #
   31 # You should have received a copy of the GNU General Public License
   32 # along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
   33 
   34 
   35 
   36 
   37 
   38 # Initial settings:
   39 set -o nounset                  # Stop if a variable is not set.
   40 set -o errexit                  # Stop if a program returns false.
   41 
   42 
   43 
   44 
   45 
   46 # Only do the job if a .git directory exists (recall that this script
   47 # is also present in the tar-ball with no .git directory and might be
   48 # run from there)
   49 if [ ! -d "$1/.git" ]; then
   50     echo "There is no Git repository in the source directory."
   51     echo "AUTHORS cannot be generated."
   52     exit 0
   53 fi
   54 
   55 
   56 
   57 
   58 
   59 # Print a status report, since this will be run along with the large
   60 # number of bootstrap operations, it is best to tell the users since
   61 # it might take a few seconds.
   62 echo "Generating AUTHORS from the version controlled source..."
   63 
   64 
   65 
   66 
   67 
   68 # Make sure the .mailmap file is present in this directory, so Git can fix
   69 # the different email addresses and names of one person. Note that while
   70 # this is in the top source directory, it is possible for the source and
   71 # build directories to be different, and we have to be prepared for that.
   72 if [ ! -f .mailmap ]; then
   73     ln -s $1/.mailmap .mailmap
   74 fi
   75 
   76 
   77 
   78 
   79 
   80 # Set the version number. Note that this script is also run at the start of
   81 # the bootstrapping process. At that point we don't have the `.version'
   82 # file, so we will just rely on `.git describe'. Later during `make', this
   83 # scripot will be run again to set it using `git-version-gen'.
   84 if [ -f "$1/.version" ]; then
   85     gnuastroversion="Gnuastro "$(cat "$1/.version")
   86 else
   87     gnuastroversion=$(git --git-dir=$1/.git describe)
   88 fi
   89 
   90 
   91 
   92 
   93 
   94 # Print the top of the AUTHORS file.
   95 echo "GNU Astronomy Utilities (Gnuastro) authors
   96 ==========================================
   97 
   98 Generated for $gnuastroversion.
   99 Ordered by number of commits in the Git project history.
  100 " > $1/AUTHORS
  101 
  102 # Generate the aggregate list
  103 git --git-dir=$1/.git shortlog --summary --email --no-merges \
  104     --numbered >> $1/AUTHORS