1: #!/usr/bin/env bash
2:
3: #
4: # $Id: fmd-commit,v 1.4 2025/04/06 03:38:05 snw Exp $
5: # Commit to 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-commit,v $
28: # Revision 1.4 2025/04/06 03:38:05 snw
29: # Prepare for adding packaging functionality to fmd
30: #
31: # Revision 1.3 2025/04/04 18:19:13 snw
32: # Fix fmd-commit call to fmd log
33: #
34: # Revision 1.2 2025/04/04 18:14:56 snw
35: # Fix log and commit scripts
36: #
37: # Revision 1.1 2025/04/04 18:00:01 snw
38: # *** empty log message ***
39: #
40: #
41: # SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC
42: # SPDX-License-Identifier: AGPL-3.0-or-later
43: #
44:
45: function usage() {
46: echo
47: echo "Commits your changes to the FreeM CVS repository"
48: echo
49: echo "usage:"
50: echo
51: echo " fmd commit \"<commit-message>\""
52: echo
53: echo " <commit-message> should describe what this change does."
54: echo
55: echo "NOTE: the commit message will be added to the ChangeLog"
56: echo " prior to committing the repository."
57: echo
58: exit 0
59: }
60:
61: if [[ $1 == "help" ]]
62: then
63: usage
64: fi
65:
66:
67: if [[ $# == 0 ]]
68: then
69: echo "commit: must be run from 'fmd commit'"
70: exit 1
71: fi
72:
73: if [[ ! -f sem.ver ]]
74: then
75: echo "Not in the root of the FreeM repository."
76: exit 1
77: fi
78:
79: if [[ $# != 2 ]]
80: then
81: usage
82: fi
83:
84: FMD="$1"
85: COMMIT_MESSAGE="$2"
86:
87: OLD_CVS_RSH="${CVS_RSH}"
88: OLD_CVSROOT="${CVSROOT}"
89:
90: export CVSROOT=":ext:${_fmd_cvsuser}@cvs.coherent-logic.com:/home/cvsroot"
91: export CVS_RSH="$(which ssh)"
92:
93: ${FMD} log "${COMMIT_MESSAGE}"
94: cvs ci -m "${COMMIT_MESSAGE}"
95:
96: export CVSROOT="${OLD_CVSROOT}"
97: export CVS_RSH="${OLD_CVS_RSH}"
98:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>