Add graphicoreBitmapFont0-Light.otf to grml-live.
[grml-live.git] / buildd / link_latest.sh
1 #!/bin/sh
2 # Filename:      /usr/share/grml-live/buildd/link_latest.sh
3 # Purpose:       create symlinks to the most recent snapshot ISOs
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2 or any later version.
7 ################################################################################
8
9 set -e
10
11 dir="$(dirname $0)"
12
13 if [ -r /etc/grml/grml-buildd.conf ] ; then
14   . /etc/grml/grml-buildd.conf
15 elif [ -r "${dir}/grml-buildd.conf" ] ; then
16   . "${dir}/grml-buildd.conf"
17 fi
18
19 # directory where daily ISOs are stored locally
20 if [ -z "$MIRROR_DIRECTORY" ] ; then
21   echo "Error: \$MIRROR_DIRECTORY is not set. Exiting." >&2
22   exit 1
23 fi
24
25 if [ -z "$FLAVOURS" ] ; then
26   echo "Error: \$FLAVOURS is not set. Exiting." >&2
27   exit 2
28 fi
29
30 if ! cd "$MIRROR_DIRECTORY" ; then
31   echo "Error: could not change directory to $MIRROR_DIRECTORY" >&2
32   exit 1
33 fi
34
35 echo "---------------------------" >> "$MIRROR_DIRECTORY"/.timestamp_link
36 for flavour in $FLAVOURS; do
37   ISO="$(ls -1 $flavour/*.iso | tail -1)"
38   if [ -n "$ISO" ] ; then
39      latest="$(basename ${ISO%%_[0-9]*})_latest.iso"
40      ln -sf $ISO ${latest}
41      # ln -sf ${ISO}.md5 ${latest}.md5
42      # http://bts.grml.org/grml/issue814
43      name=$(awk '{print $2}' "${ISO}".md5)
44      sed "s/$name/$latest/" "${ISO}".md5 > "${latest}".md5
45      name=$(awk '{print $2}' "${ISO}".sha1)
46      sed "s/$name/$latest/" "${ISO}".sha1 > "${latest}".sha1
47      echo "$ISO" >> "$MIRROR_DIRECTORY"/.timestamp_link
48   fi
49 done
50 echo "---------------------------" >> "$MIRROR_DIRECTORY"/.timestamp_link
51
52 ## END OF FILE #################################################################