/usr/bin/ae-sccs-put is in aegis 4.24.3-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | #!/bin/sh
#
# aegis - project change supervisor
# Copyright (C) 2001, 2006, 2008 Peter Miller
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
#
comment=
gfile=
sfile=
adminflags=-n
deltaflags=-n
getflags=
#
# Some systems have an `sccs' program which launches the other bits,
# and some don't. Pick the appropritae one of the next two lines.
#
sccs=sccs
#sccs=
#
# work through the arguments
#
while test $# -gt 0
do
case "$1" in
-a*)
# admin, add users
# get, stuff for testing
echo "$0: option $1 ambiguous" 1>&2
exit 1
;;
-b)
# admin, binary file
# get, branch
echo "$0: option $1 ambiguous" 1>&2
exit 1
;;
-c*)
# get, cutoff date
getflags="$getflags $1"
;;
-d*)
# admin, flags to clear
adminflags="$adminflags $1"
;;
-D)
# get, debug
getflags="$getflags $1"
;;
-e*)
# admin, delete users
# get, for edit
echo "$0: option $1 ambiguous" 1>&2
exit 1
;;
-f*)
# admin, flags to set
adminflags="$adminflags $1"
;;
-g*)
# delta, it's parsed, but not acted on
# get, no output (prints RID on stdout)
echo "$0: option $1 ambiguous" 1>&2
exit 1
;;
-G-)
echo "$0: can't read input from stdin" 1>&2
exit 1
;;
-G*)
# get, the file used by humans
gfile="`echo $1 | sed 's|^..||'`"
;;
-h)
# admin, check checksum
adminflags="$adminflags $1"
;;
-i*)
# admin, the file used by humans
# get, list of SIDs
echo "$0: option $1 ambiguous" 1>&2
exit 1
;;
-k)
# get, suppress keywords
getflags="$getflags $1"
;;
-m*)
# admin, list of MRs
# delta, list of MRs
# get, show sid
echo "$0: option $1 ambiguous" 1>&2
exit 1
;;
-M)
# delta, list of MRs to suppress
deltaflags="$deltaflags $1"
;;
-n)
# admin, new file
# delta, keep g-file (we do this anyway)
# get, show module
echo "$0: option $1 ambiguous" 1>&2
exit 1
;;
-p)
# delta, display diff output
# get, send to stdout
echo "$0: option $1 ambiguous" 1>&2
exit 1
;;
-r*)
# admin, initial version
# delta, specific version
# get, specific version
adminflags="$adminflags $1"
deltaflags="$deltaflags $1"
;;
-s)
# delta, operate silently
# get, operate silently
deltaflags="$deltaflags $1"
getflags="$getflags $1"
;;
-t*)
# admin, title
# get, include branches
echo "$0: option $1 ambiguous" 1>&2
exit 1
;;
-V)
# admin, print version
# delta, print version
# get, print version
# (ignore this one)
;;
-w*)
# get, wstring (keh?)
getflags="$getflags $1"
;;
-x*)
# get, SIDs to exclude
getflags="$getflags $1"
;;
-y* | -Y)
# admin, comments
# delta, comments
comment="$1"
;;
-z)
# admin, reset checksum
adminflags="$adminflags $1"
;;
-*)
echo "$0: unknown $1 option" 1>&2
exit 1
;;
*)
sfile="$1"
;;
esac
shift
done
here=`pwd`
status=$?
test $status -ne 0 && exit $status
#
# Make sure they gave the input file (the "s-file" or "sccs file").
#
case "$sfile" in
"")
echo "$0: no s-file specified" 1>&2
exit 1
;;
/*)
;;
*)
sfile="$here/$sfile"
;;
esac
#
# Make sure they gave the input file (the "g-file" or "get file").
#
case "$gfile" in
"")
echo "$0: no g-file specified" 1>&2
exit 1
;;
/*)
;;
*)
gfile="$here/$gfile"
;;
esac
#
# The sccs delta command doesn't take a -G argument, so make
# sure the basenames match, otherwise we can't do this.
#
if test `basename $sfile` != s.`basename $gfile`
then
# What can I say? SCCS is completely stupid.
echo "$0: basename of g-file and p-file must match" 1>&2
exit 1
fi
#
# Make sure comment is specified.
#
if test -z "$comment"
then
echo "$0: no comment specified"
exit 1
fi
#
# You can only create new files with sccs admin.
# You can only update files with sccs delta.
# Neither can do both.
#
if test -f "$sfile"
then
#
# We don't have a lock, so we need to get one. (There is no sccs
# delta option which allows us to check-in without one. Sheesh.)
# Throw the output away.
#
$sccs get -e $getflags -p $sfile > /dev/null
status=$?
test $status -ne 0 && exit $status
#
# Now we have a lock, check-in the file. The sccs delta command
# doesn't take a -G argument, so we have to make sure that the
# current directory is the one with the g-file in it. (Now you
# know why CSSC stands for "compatibly stupid source control".)
#
# Use the -n flag to hang on to the g-file.
# This is symmetric with the admin -n option.
#
gdir=`dirname $gfile`
gfile=`basename $gfile`
cd $gdir
$sccs delta $deltaflags "$comment" $sfile
status=$?
test $status -ne 0 && exit $status
else
#
# Create the new file.
#
$sccs admin $adminflags -i$gfile "$comment" $sfile
status=$?
test $status -ne 0 && exit $status
fi
exit 0
|