[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CVSROOT redirection
From: |
Mark D. Baushke |
Subject: |
Re: CVSROOT redirection |
Date: |
Mon, 05 May 2003 09:10:45 -0700 |
Dusan Juhas <address@hidden> writes:
> Hi folks,
> is it possible to override CVSROOT in commitlog?
> I have 2 repositories. Let's call them _local_ and _remote_.
> _local_ is a read-only mirror of _remote_.
> I'd like to run all read-only cvs commands on _local_ (esp. co).
> The rest of commands should be used with _remote_.
> I'd like to check in _remote_ without changing administrative
> files in the sand box (even without changing CVSROOT).
> Is it possible to arrange an commitlog action which
> skips checkin in _local_ and redirects all actions to _remote_?
> --
> Best regards,
> Dusan Juhas
When I need to do something like this, I typically have the commitinfo
run a script to do something like this:
ALL $CVSROOT/CVSROOT/commitcheck
where $CVSROOT/CVSROOT/commitcheck looks something like this:
------- start commitcheck -------
#!/bin/sh
case "`/bin/hostname | /usr/bin/tr A-Z a-z`" in
mycvsmaster.mydomain.com)
: # OK
;;
*)
echo "Please commit on mycvsmaster...."
exit 1
esac
if $CVSROOT/CVSROOT/cvs_acls ${1+"$@"}
then
: # ok
else
echo "Access control checks failed! (cvs_acls) 1>&2
exit 1
fi
if $CVSROOT/CVSROOT/commit_prep ${1+"$@"}
then
: # OK
else
echo "commit_prep failed!" 1>&2
exit 1
fi
exit 0 # Lets do it!
------- end commitcheck -------
So, even if someone mirrors the repository, they will not be able to
commit to the mirror unless their hostname happens to believe itself
to be the mycvsmaster host. I also do not trust that their PATH will
contain a hostname that does not lie by using the full pathnames to
the commands I need.
Note that similar logic may need to be applied for tags, but I figure
that I don't care if a user is messing with local tags in a mirror. I
only want to make sure they do not lose any commits.
Enjoy!
-- Mark