1: #!/usr/bin/env bash
2:
3: #
4: # $Id: fmd-log,v 1.2 2025/04/06 03:38:05 snw Exp $
5: # Log work in FreeM repository
6: #
7: #
8: # Author: Serena Willis <snw@coherent-logic.com>
9: # Copyright (C) 2025 Coherent Logic Development LLC
10: #
11: #
12: # This file is part of FreeM.
13: #
14: # FreeM is free software: you can redistribute it and/or modify
15: # it under the terms of the GNU Affero Public License as published by
16: # the Free Software Foundation, either version 3 of the License, or
17: # (at your option) any later version.
18: #
19: # FreeM is distributed in the hope that it will be useful,
20: # but WITHOUT ANY WARRANTY; without even the implied warranty of
21: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22: # GNU Affero Public License for more details.
23: #
24: # You should have received a copy of the GNU Affero Public License
25: # along with FreeM. If not, see <https://www.gnu.org/licenses/>.
26: #
27: # $Log: fmd-log,v $
28: # Revision 1.2 2025/04/06 03:38:05 snw
29: # Prepare for adding packaging functionality to fmd
30: #
31: # Revision 1.1 2025/04/04 18:00:01 snw
32: # *** empty log message ***
33: #
34: #
35: # SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC
36: # SPDX-License-Identifier: AGPL-3.0-or-later
37: #
38:
39: function usage() {
40: echo
41: echo "Adds an entry to the FreeM ChangeLog"
42: echo
43: echo "usage:"
44: echo
45: echo " fmd log \"<log-message>\""
46: echo
47: echo " <log-message> should contain the entry you want."
48: echo
49: exit 0
50: }
51:
52: if [[ $1 == "help" ]]
53: then
54: usage
55: fi
56:
57: if [[ $# == 0 ]]
58: then
59: echo "log: must be run from 'fmd log'"
60: exit 1
61: fi
62:
63: if [[ ! -f sem.ver ]]
64: then
65: echo "Not in the root of the FreeM repository."
66: exit 1
67: fi
68:
69: if [[ $# != 2 ]]
70: then
71: usage
72: fi
73:
74: FMD="$1"
75: MSG="$2"
76: LOGDATE="$(date +"%D %T")"
77: LOGMSG="${MSG} [$(whoami)@$(hostname) ${LOGDATE}]"
78:
79: echo " * ${LOGMSG}" >> ChangeLog
80:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>