OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-tools Date: 24-May-2004 17:37:01
Branch: HEAD Handle: 2004052416370000
Modified files:
openpkg-tools/cmd dev.sh
Log:
enforce use of bash; add documentation, align code and do minor
cleanups
Summary:
Revision Changes Path
1.23 +129 -70 openpkg-tools/cmd/dev.sh
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-tools/cmd/dev.sh
============================================================================
$ cvs diff -u -r1.22 -r1.23 dev.sh
--- openpkg-tools/cmd/dev.sh 30 Apr 2004 06:26:20 -0000 1.22
+++ openpkg-tools/cmd/dev.sh 24 May 2004 15:37:00 -0000 1.23
@@ -22,12 +22,14 @@
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
+if [ ".$BASH" = . ]; then
+ echo "openpkg:dev:ERROR: this tool must be run under bash" 1>&2
+ exit 1
+fi
# decouple from the calling instance
unset OPENPKG_PREFIX
-# FIXME: rse: quick workaround to allow us to use "dev" now: T=$OPENPKG_TOOLS
-
# work around broken multiplexer in OpenPKG 2.0.0 and 2.0.1
# this inhibits the caller from controlling additional and replacement tools
through environment variables
if [ ".$OPENPKG_TOOLS_CMDSTACK" = . ]; then
@@ -46,7 +48,7 @@
export OPENPKG_TOOLS_CMDPATH_TRUN
# default configuration
-OPENPKG_INST="/openpkg-dev /openpkg-20 /openpkg-13 /cw13 /cw12 /cw11 /cw10"
+OPENPKG_INST="/openpkg-dev /openpkg-20 /openpkg-13"
OPENPKG_WORK=${HOME}/work/openpkg
OPENPKG_TEMP=${TMPDIR-/tmp}/${LOGNAME}/openpkg
OPENPKG_MODE=contributor # contributor
@@ -105,9 +107,6 @@
fi
# override configuration from command line
-verbose=0
-quiet=0
-version=0
help=0
while [ $# -gt 0 ]; do
opt=$1
@@ -116,10 +115,7 @@
*) arg='' ;;
esac
case ${opt} in
- -v|--verbose ) verbose=1 ;;
- -q|--quiet ) quiet=1 ;;
-h|--help ) help=1 ;;
- -V|--version ) version=1 ;;
--inst=* ) OPENPKG_INST=${arg} ;;
--work=* ) OPENPKG_WORK=${arg} ;;
--temp=* ) OPENPKG_TEMP=${arg} ;;
@@ -132,7 +128,7 @@
--trun=* ) OPENPKG_TRUN=${arg} ;;
--sdir=* ) OPENPKG_SDIR=${arg} ;;
-* ) help="Invalid option \`${opt}'"; break ;;
- * ) break ;;
+ * ) break ;;
esac
shift
done
@@ -2233,8 +2229,28 @@
fi
sed -e 's;^ *;;' <<EOF | $out
- OpenPKG Development Area [created by $0]
+ OpenPKG Development
+ ===================
+
+ \$ openpkg dev [options] [cmds]
+ options and environment variables
+
--------------------------------------------------------------------------------------------------------
+ -h|--help ) Display brief usage message.
+
+ --inst=... equal to setting OPENPKG_INST
+ --work=... equal to setting OPENPKG_WORK
+ --temp=... equal to setting OPENPKG_TEMP
+ --mode=... equal to setting OPENPKG_MODE
+ --repo=... equal to setting OPENPKG_REPO
+ --dist=... equal to setting OPENPKG_DIST
+ --spec=... equal to setting OPENPKG_SPEC or running cmd "package"
+ --ctag=... equal to setting OPENPKG_CTAG or running cmd "branch"
+ --exec=... equal to setting OPENPKG_EXEC or running cmd "execute"
+ --trun=... equal to setting OPENPKG_TRUN or running cmd "tools"
+ --sdir=... equal to setting OPENPKG_SDIR or running cmd "srcdir"
+
+ cmds and parameters
--------------------------------------------------------------------------------------------------------
\$ openpkg dev bash # [[[spec]ctag]exec] enter development
environment
\$ openpkg dev build # [[spec]...] [-f] [-D with...] build a package
(forcibly) (with option)
@@ -2262,12 +2278,16 @@
\$ openpkg dev track # [[spec]...] track version
\$ openpkg dev update # update development
environment from master server
\$ openpkg dev vim # [[spec]...] [-f] spec edit and lint
(if HEAD or forced)
-
--------------------------------------------------------------------------------------------------------
EOF
}
# ------------------------------------------------------------
+# when invoked with -h|--help option, artifically replace cmd with "help"
+if [ $help -eq 1 ]; then
+ set -- help
+fi
+
# when invoked without any parameter, artifically inject "bash" command as default
if [ $# -eq 0 ]; then
set -- bash
@@ -2335,9 +2355,9 @@
=head1 DESCRIPTION
-B<openpkg dev> is the Development Shell of the OpenPKG Tool Chain.
-It is used by OpenPKG developers to work conviniently with the
-OpenPKG packaging sources from the OpenPKG CVS Repository.
+B<openpkg dev> is the Development Shell of the OpenPKG Tool Chain. It
+is used by developers to work conveniently with the OpenPKG packaging
+sources from the OpenPKG CVS Repository.
=head1 GLOBAL OPTIONS
@@ -2345,68 +2365,107 @@
=over 4
-=item B<-v>, B<--verbose>
-
-Enable verbose processing.
-
-=item B<-q>, B<--quiet>
-
-Enable quiet processing.
-
=item B<-h>, B<--help>
Display brief usage message.
-=item B<-V>, B<--version>
-
-Display command version.
-
=item B<--inst=>I<dir-list>
Specify white-space separated list of directories where OpenPKG
-instances can be found. The current default is "C</openpkg-dev
-/openpkg-20 /openpkg-13 /cw13 /cw12 /cw11 /cw10>". This can be
-overridden in F<~/openpkg/dev.rc> with variable C<OPENPKG_INST>.
-
-=item B<--work=>
-
-FIXME
-OPENPKG_WORK
-
-=item B<--temp=>
-
-FIXME
-OPENPKG_TEMP
-
-=item B<--mode=>
-
-FIXME
-OPENPKG_MODE=
-
-=item B<--repo=>
-
-FIXME
-OPENPKG_REPO
-
-=item B<--dist=>
-
-FIXME
-OPENPKG_DIST
-
-=item B<--spec=>
-
-FIXME
-OPENPKG_SPEC
-
-=item B<--ctag=>
-
-FIXME
-OPENPKG_CTAG
-
-=item B<--exec=>
-
-FIXME
-OPENPKG_EXEC
+instances can be found. If omitted the variable C<OPENPKG_INST> is
+read from F<~/openpkg/dev.rc>, read from environment or defaults to
+"C</openpkg-dev /openpkg-20 /openpkg-13>".
+
+=item B<--work=>I<dir>
+
+Specify a directory where all the Development takes place. If omitted
+the variable C<OPENPKG_WORK> is read from F<~/openpkg/dev.rc>, read from
+environment or defaults to "C<${HOME}/work/openpkg>".
+
+=item B<--temp=>I<dir>
+
+Specify a directory used to place temporary files during the various
+build stages. If omitted the variable C<OPENPKG_TEMP> is read
+from F<~/openpkg/dev.rc>, read from environment or defaults to
+"C<${TMPDIR-/tmp}/${LOGNAME}/openpkg>".
+
+=item B<--mode=>I<contributor|developer>
+
+Specify the mode of operation. Pick from "C<contributor>" or
+"C<developer>". The former can upload modified package specifications
+and upload modified packges via FTP into the contribution area, the
+latter requires direct access to the project master server via SSH. If
+omitted the variable C<OPENPKG_MODE> is read from F<~/openpkg/dev.rc>,
+read from environment or defaults to "C<contributor>".
+
+=item B<--repo=>I<dir>
+
+Specify access to the repository for uploading
+modified package specifications. Contributors use
+"C<:pserver:[EMAIL PROTECTED]:/e/openpkg/cvs>" and developers
+use "C<[EMAIL PROTECTED]:/e/openpkg/cvs>". If omitted the
+variable C<OPENPKG_REPO> is read from F<~/openpkg/dev.rc>, read from
+environment or defaults to the contributor setting.
+
+=item B<--dist=>I<dir>
+
+Specify access to the repository for uploading modified packages.
+Contributors use "C<ftp://ftp.openpkg.org/contrib/00UPLOAD>" and
+developers use "C<master.openpkg.org:/e/openpkg/ftp/>". If omitted the
+variable C<OPENPKG_DIST> is read from F<~/openpkg/dev.rc>, read from
+environment or defaults to the contributor setting.
+
+=item B<--spec=>I<name>
+
+Specify the name of the package to work with. This also sets the C<$P>
+variable within the Development Shell which can be used to shorten
+command line input. If omitted the variable C<OPENPKG_SPEC> is read
+from F<~/openpkg/dev.rc>, read from environment. The default is empty
+and makes C<$P> being computed from the CWD. While working within the
+Development Shell this setting can be changed at any time by running the
+"package" command.
+
+=item B<--ctag=>I<branch>
+
+Specify the name of the CVS tag (branch) to work with. This also sets
+the C<$B> variable within the Development Shell which can be used to
+shorten command line input. If omitted the variable C<OPENPKG_CTAG> is
+read from F<~/openpkg/dev.rc>, read from environment. The default is
+empty and makes C<$B> being computed from CVS files below the CWD. While
+working within the Development Shell this setting can be changed at any
+time by running the "branch" command.
+
+=item B<--exec=>I<dir>
+
+Specify the prefix of the OpenPKG instance used to execute packaging
+commands. This also sets the C<$E> variable within the Development
+Shell which can be used to shorten command line input. If omitted the
+variable C<OPENPKG_EXEC> is read from F<~/openpkg/dev.rc>, read from
+environment. The default is empty and makes C<$E> being computed by
+finding appropriate commands in the path of C<OPENPKG_INST>. While
+working within the Development Shell this setting can be changed at any
+time by running the "exec" command.
+
+=item B<--trun=>I<dir>
+
+Specify the prefix of the OpenPKG instance used to run tools commands.
+This also sets the C<$T> variable within the Development Shell which
+can be used to shorten command line input. If omitted the variable
+C<OPENPKG_TRUN> is read from F<~/openpkg/dev.rc>, read from environment.
+The default is empty and makes C<$T> being computed by finding
+appropriate commands in the path of C<OPENPKG_INST>. While working
+within the Development Shell this setting can be changed at any time by
+running the "trun" command.
+
+=item B<--sdir=>I<subdir>
+
+Specify the subdirectory below C<OPENPKG_WORK> where packages can be
+found. This also sets the C<$S> variable within the Development Shell
+which can be used to shorten command line input. If omitted the variable
+C<OPENPKG_SDIR> is read from F<~/openpkg/dev.rc>, read from environment.
+The default is empty and makes C<$S> being computed from the CWD with
+fallback to "src". While working within the Development Shell this
+setting can be changed at any time by running the "srcdir" command.
=back
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]