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: 17-Jun-2004 12:40:27
Branch: HEAD Handle: -NONE-
Modified files:
openpkg-tools/cmd dev.sh
Log:
allow the repository module name to be specified by
--rmod/OPENPKG_RMOD; skip release number check and linting when
developing for a private repository; pass arguments into development
shell otherwise default/environment/rc/option precedence is broken
inside the shell
Summary:
Revision Changes Path
1.24 +0 -0 openpkg-tools/cmd/dev.sh
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-tools/cmd/dev.sh
============================================================================
$ cvs diff -u -r1.23 -r1.24 dev.sh
--- openpkg-tools/cmd/dev.sh 24 May 2004 15:37:00 -0000 1.23
+++ openpkg-tools/cmd/dev.sh 17 Jun 2004 10:40:26 -0000 1.24
@@ -37,6 +37,8 @@
unset OPENPKG_TOOLS_APIPATH
unset OPENPKG_TOOLS_CMDPATH
fi
+
+# export variables
export OPENPKG_TOOLS
export OPENPKG_TOOLS_APIPATH
export OPENPKG_TOOLS_CMDPATH
@@ -46,6 +48,7 @@
export OPENPKG_TOOLS_TRUN
export OPENPKG_TOOLS_APIPATH_TRUN
export OPENPKG_TOOLS_CMDPATH_TRUN
+export OPENPKG_ARGS
# default configuration
OPENPKG_INST="/openpkg-dev /openpkg-20 /openpkg-13"
@@ -53,11 +56,13 @@
OPENPKG_TEMP=${TMPDIR-/tmp}/${LOGNAME}/openpkg
OPENPKG_MODE=contributor # contributor
OPENPKG_REPO=:pserver:[EMAIL PROTECTED]:/e/openpkg/cvs # contributor
+OPENPKG_RMOD=openpkg-src # contributor
OPENPKG_DIST=ftp://ftp.openpkg.org/contrib/00UPLOAD # contributor
#OPENPKG_MODE=developer # developer
[EMAIL PROTECTED]:/e/openpkg/cvs # developer
+#OPENPKG_RMOD=openpkg-src # developer
#OPENPKG_DIST=master.openpkg.org:/e/openpkg/ftp/ # developer
-export OPENPKG_INST OPENPKG_WORK OPENPKG_TEMP OPENPKG_MODE OPENPKG_REPO OPENPKG_DIST
+export OPENPKG_INST OPENPKG_WORK OPENPKG_TEMP OPENPKG_MODE OPENPKG_REPO
OPENPKG_RMOD OPENPKG_DIST
# enforced and user controlled (through package/branch/execute) variables
OPENPKG_SPEC="${OPENPKG_SPEC}"; P="$P" # package, spec file without .spec suffix
@@ -107,6 +112,7 @@
fi
# override configuration from command line
+OPENPKG_ARGS=""
help=0
while [ $# -gt 0 ]; do
opt=$1
@@ -116,17 +122,18 @@
esac
case ${opt} in
-h|--help ) help=1 ;;
- --inst=* ) OPENPKG_INST=${arg} ;;
- --work=* ) OPENPKG_WORK=${arg} ;;
- --temp=* ) OPENPKG_TEMP=${arg} ;;
- --mode=* ) OPENPKG_MODE=${arg} ;;
- --repo=* ) OPENPKG_REPO=${arg} ;;
- --dist=* ) OPENPKG_DIST=${arg} ;;
- --spec=* ) OPENPKG_SPEC=${arg} ;;
- --ctag=* ) OPENPKG_CTAG=${arg} ;;
- --exec=* ) OPENPKG_EXEC=${arg} ;;
- --trun=* ) OPENPKG_TRUN=${arg} ;;
- --sdir=* ) OPENPKG_SDIR=${arg} ;;
+ --inst=* ) OPENPKG_INST=${arg} OPENPKG_ARGS="$OPENPKG_ARGS
--inst=${arg} ";;
+ --work=* ) OPENPKG_WORK=${arg} OPENPKG_ARGS="$OPENPKG_ARGS
--work=${arg} ";;
+ --temp=* ) OPENPKG_TEMP=${arg} OPENPKG_ARGS="$OPENPKG_ARGS
--temp=${arg} ";;
+ --mode=* ) OPENPKG_MODE=${arg} OPENPKG_ARGS="$OPENPKG_ARGS
--mode=${arg} ";;
+ --repo=* ) OPENPKG_REPO=${arg} OPENPKG_ARGS="$OPENPKG_ARGS
--repo=${arg} ";;
+ --rmod=* ) OPENPKG_RMOD=${arg} OPENPKG_ARGS="$OPENPKG_ARGS
--rmod=${arg} ";;
+ --dist=* ) OPENPKG_DIST=${arg} OPENPKG_ARGS="$OPENPKG_ARGS
--dist=${arg} ";;
+ --spec=* ) OPENPKG_SPEC=${arg} OPENPKG_ARGS="$OPENPKG_ARGS
--spec=${arg} ";;
+ --ctag=* ) OPENPKG_CTAG=${arg} OPENPKG_ARGS="$OPENPKG_ARGS
--ctag=${arg} ";;
+ --exec=* ) OPENPKG_EXEC=${arg} OPENPKG_ARGS="$OPENPKG_ARGS
--exec=${arg} ";;
+ --trun=* ) OPENPKG_TRUN=${arg} OPENPKG_ARGS="$OPENPKG_ARGS
--trun=${arg} ";;
+ --sdir=* ) OPENPKG_SDIR=${arg} OPENPKG_ARGS="$OPENPKG_ARGS
--sdir=${arg} ";;
-* ) help="Invalid option \`${opt}'"; break ;;
* ) break ;;
esac
@@ -510,9 +517,9 @@
cvs -q -d "${OPENPKG_REPO}" checkout -d web openpkg-web
cvs -q -d "${OPENPKG_REPO}" checkout -d tools openpkg-tools
if [ ".${B:-HEAD}" = .HEAD ]; then
- cvs -q -d "${OPENPKG_REPO}" checkout -d src openpkg-src
+ cvs -q -d "${OPENPKG_REPO}" checkout -d src "${OPENPKG_RMOD}"
else
- cvs -q -d "${OPENPKG_REPO}" checkout -r ${B} -d src openpkg-src
+ cvs -q -d "${OPENPKG_REPO}" checkout -r ${B} -d src "${OPENPKG_RMOD}"
fi
)
else
@@ -523,11 +530,11 @@
cvs -q -d "${OPENPKG_REPO}" checkout -d re openpkg-re
cvs -q -d "${OPENPKG_REPO}" checkout -d tools openpkg-tools
if [ ".${B:-HEAD}" = .HEAD ]; then
- cvs -q -d "${OPENPKG_REPO}" checkout -d src openpkg-src/00README
- cvs -q -d "${OPENPKG_REPO}" checkout -d src openpkg-src/${P}
+ cvs -q -d "${OPENPKG_REPO}" checkout -d src "${OPENPKG_RMOD}/00README"
+ cvs -q -d "${OPENPKG_REPO}" checkout -d src "${OPENPKG_RMOD}/${P}"
else
- cvs -q -d "${OPENPKG_REPO}" checkout -r ${B} -d src
openpkg-src/00README
- cvs -q -d "${OPENPKG_REPO}" checkout -r ${B} -d src openpkg-src/${P}
+ cvs -q -d "${OPENPKG_REPO}" checkout -r ${B} -d src
"${OPENPKG_RMOD}/00README"
+ cvs -q -d "${OPENPKG_REPO}" checkout -r ${B} -d src
"${OPENPKG_RMOD}/${P}"
fi
)
fi
@@ -1083,7 +1090,7 @@
fi
}
- alias opd="openpkg dev"
+ alias opd="openpkg dev $OPENPKG_ARGS"
}
bashrcepilog () {
@@ -1360,7 +1367,7 @@
cvs_rev="No"
fi
if [ ".${cvs_rev}" != .No ]; then
- cvs -d ${OPENPKG_REPO} co -p -r${cvs_rev}
openpkg-src/${name}/${name}.spec >${tmpfile} 2>/dev/null
+ cvs -d ${OPENPKG_REPO} co -p -r${cvs_rev}
"${OPENPKG_RMOD}/${name}/${name}.spec" >${tmpfile} 2>/dev/null
rpm_version_old=`rpmE -q --qf "%{VERSION}" --specfile ${tmpfile}
2>/dev/null`
rpm_release_old=`rpmE -q --qf "%{RELEASE}" --specfile ${tmpfile}
2>/dev/null`
rm -f ${tmpfile}
@@ -1413,56 +1420,59 @@
upload="release/${OPMAJORV}.${OPMINORV}/UPD/00UPLOAD/"
fi
- echo "++ checking release number"
- if [ ".$rpm_release_req" = . ]; then
- die "cannot predict required release number for branch $B"
- fi
- if [ ".$rpm_release_new" != ".$rpm_release_req" ]; then
- die "release number ${rpm_release_new} does not match expectation
${rpm_release_req}"
- fi
-
- echo "++ checking upload suffix"
- if [ ".$upload" = . ]; then
- die "cannot determine upload suffix for branch $B"
- fi
+ if [ ".${OPENPKG_REPO}" = "[EMAIL PROTECTED]:/e/openpkg/cvs" ]; then
+ echo "++ checking release number"
+ if [ ".$rpm_release_req" = . ]; then
+ die "cannot predict required release number for branch $B"
+ fi
+ if [ ".$rpm_release_new" != ".$rpm_release_req" ]; then
+ die "release number ${rpm_release_new} does not match
expectation ${rpm_release_req}"
+ fi
- if [ ".${BRANCH}" = .HEAD ]; then
- echo "++ linting ${name}.spec (package specification)"
- openpkgT lint-spec ${OPENPKG_WORK}/$S/${name}/${name}.spec
- if [ $? -gt 0 ]; then
- die "unacceptable specification:
${OPENPKG_WORK}/$S/${name}/${name}.spec"
+ echo "++ checking upload suffix"
+ if [ ".$upload" = . ]; then
+ die "cannot determine upload suffix for branch $B"
fi
- if [ -f rc.${name} ]; then
- echo "++ linting rc.${name} (run-command script)"
- openpkgT lint-rc ${OPENPKG_WORK}/$S/${name}/rc.${name}
+
+ if [ ".${BRANCH}" = .HEAD ]; then
+ echo "++ linting ${name}.spec (package specification)"
+ openpkgT lint-spec ${OPENPKG_WORK}/$S/${name}/${name}.spec
if [ $? -gt 0 ]; then
- die "unacceptable run commands:
${OPENPKG_WORK}/$S/${name}/rc.${name}"
+ die "unacceptable specification:
${OPENPKG_WORK}/$S/${name}/${name}.spec"
fi
- fi
- if [ -f fsl.${name} ]; then
- echo "++ linting fsl.${name} (OSSP fsl configuration)"
- openpkgT lint-fsl ${OPENPKG_WORK}/$S/${name}/fsl.${name}
- if [ $? -gt 0 ]; then
- die "unacceptable fsl configuration:
${OPENPKG_WORK}/$S/${name}/fsl.${name}"
+ if [ -f rc.${name} ]; then
+ echo "++ linting rc.${name} (run-command script)"
+ openpkgT lint-rc ${OPENPKG_WORK}/$S/${name}/rc.${name}
+ if [ $? -gt 0 ]; then
+ die "unacceptable run commands:
${OPENPKG_WORK}/$S/${name}/rc.${name}"
+ fi
+ fi
+ if [ -f fsl.${name} ]; then
+ echo "++ linting fsl.${name} (OSSP fsl configuration)"
+ openpkgT lint-fsl ${OPENPKG_WORK}/$S/${name}/fsl.${name}
+ if [ $? -gt 0 ]; then
+ die "unacceptable fsl configuration:
${OPENPKG_WORK}/$S/${name}/fsl.${name}"
+ fi
fi
fi
- fi
- if [ ".${BRANCH}" = .HEAD -a ".$extra" = .1 ]; then
- bin_template=`rpmE --eval '%{_rpmfilename}'`
- bin_rpmfile=`rpmE -q --qf "${bin_template}" \
- --specfile ${OPENPKG_WORK}/$S/${name}/${name}.spec`
- bin_rpmdir=`rpmE --eval '%{_rpmdir}'`
- if [ -f "$bin_rpmdir/$bin_rpmfile" ]; then
- echo "++ linting ${bin_rpmfile} (binary package)"
- openpkgT lint-rpm --check=layout,attrib $bin_rpmdir/$bin_rpmfile
- if [ $? -gt 0 ]; then
- die "unacceptable specification: $bin_rpmdir/$bin_rpmfile"
+ if [ ".${BRANCH}" = .HEAD -a ".$extra" = .1 ]; then
+ bin_template=`rpmE --eval '%{_rpmfilename}'`
+ bin_rpmfile=`rpmE -q --qf "${bin_template}" \
+ --specfile ${OPENPKG_WORK}/$S/${name}/${name}.spec`
+ bin_rpmdir=`rpmE --eval '%{_rpmdir}'`
+ if [ -f "$bin_rpmdir/$bin_rpmfile" ]; then
+ echo "++ linting ${bin_rpmfile} (binary package)"
+ openpkgT lint-rpm --check=layout,attrib
$bin_rpmdir/$bin_rpmfile
+ if [ $? -gt 0 ]; then
+ die "unacceptable specification:
$bin_rpmdir/$bin_rpmfile"
+ fi
fi
fi
fi
- echo "++ releasing ${rpmfile}.${ext} to OpenPKG distribution area
${upload}"
+ area=`echo ${OPENPKG_DIST}/${upload} | sed -e
's;master.openpkg.org:/e/openpkg/ftp/;OpenPKG ;'`
+ echo "++ releasing ${rpmfile}.${ext} to distribution area ${area}"
if [ ${bundle} -eq 1 ]; then
bundle_srpms="${bundle_srpms}
${OPENPKG_WORK}/pkg/src/${rpmfile}.${ext}"
elif [ ${dry} -eq 0 ]; then
@@ -1647,7 +1657,7 @@
die "directory ${OPENPKG_WORK}/$S/${name} already exists -- remove
first"
fi
- echo "++ creating openpkg-src/${name}/ CVS area"
+ echo "++ creating ${OPENPKG_RMOD}/${name}/ CVS area"
if [ ${dry} -eq 0 ]; then
makedir 755 ${OPENPKG_WORK}/$S/${name} || die "cannot create
${OPENPKG_WORK}/$S/${name}"
if [ ".${OPENPKG_MODE}" = .developer ]; then
@@ -1660,7 +1670,7 @@
fi
fi
- echo "++ creating openpkg-src/${name}/${name}.spec skeleton"
+ echo "++ creating ${OPENPKG_RMOD}/${name}/${name}.spec skeleton"
year=`date '+%Y'`
if [ ${dry} -eq 0 ]; then
( echo "##"
@@ -2198,7 +2208,7 @@
fi
for file in $files; do
TERM=${TERM}-color command vim "${file}"
- if [ ".${OPENPKG_MODE}" = .developer -a ".${B}" = .HEAD -o $force -ne 0
]; then
+ if [ ".${OPENPKG_MODE}" = .developer -a ".${B}" = .HEAD -a
".${OPENPKG_REPO}" = "[EMAIL PROTECTED]:/e/openpkg/cvs" -o $force -ne 0 ]; then
openpkgT lint-spec ${file}
if [ $? -gt 0 ]; then
die "unacceptable specification: ${file}"
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]