OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /e/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-re Date: 27-Mar-2003 10:53:36 Branch: HEAD Handle: 2003032709533500 Modified files: openpkg-re openpkg-dev Log: add help and peek commands Summary: Revision Changes Path 1.73 +39 -4 openpkg-re/openpkg-dev ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-re/openpkg-dev ============================================================================ $ cvs diff -u -r1.72 -r1.73 openpkg-dev --- openpkg-re/openpkg-dev 27 Mar 2003 08:57:17 -0000 1.72 +++ openpkg-re/openpkg-dev 27 Mar 2003 09:53:35 -0000 1.73 @@ -39,12 +39,12 @@ # program version prog_name="openpkg-dev" -prog_vers="0.9.2" -prog_date="12-Mar-2003" +prog_vers="0.9.3" +prog_date="27-Mar-2003" # default configuration OPENPKG_INST=/cw -OPENPKG_WILD=* +OPENPKG_WILD="*" OPENPKG_WORK=${HOME}/work/openpkg OPENPKG_TEMP=/tmp/${LOGNAME}/openpkg OPENPKG_MODE=contributor # contributor @@ -245,6 +245,7 @@ \$ openpkg-dev branch .... switch to a different branch \$ openpkg-dev execute ... execute command on instance closest to branch \$ openpkg-dev list ...... list source and binary packages + \$ openpkg-dev peek ...... peek at file list of binary package \$ openpkg-dev search .... search a package on master server \$ openpkg-dev new ....... create new packag from scratch @@ -254,6 +255,7 @@ \$ openpkg-dev install ... install a package \$ openpkg-dev kill ...... kill the environment + \$ openpkg-dev help ...... display this command summary EOF } @@ -763,6 +765,33 @@ fi } +peek () { + for name in $*; do + if [ ! -f "${OPENPKG_WORK}/src/${name}/${name}.spec" ]; then + warn "${OPENPKG_WORK}/src/${name}/${name}.spec not found" + continue + fi + template=`HOME=${OPENPKG_WORK} ${OPENPKG_INST}/bin/rpm --eval '%{_rpmfilename}'` + rpmfile=`HOME=${OPENPKG_WORK} ${OPENPKG_INST}/bin/rpm -q --qf "${template}" \ + --specfile ${OPENPKG_WORK}/src/${name}/${name}.spec` + rpmdir=`HOME=${OPENPKG_WORK} ${OPENPKG_INST}/bin/rpm --eval '%{_rpmdir}'` + if [ ! -f "$rpmdir/$rpmfile" ]; then + die "binary RPM not found: $rpmdir/$rpmfile" + fi + echo "++ peeking at file list of binary RPM: $rpmfile" + filter="sed -e 's;^;\\ \\ \\ ;'" + tmpfile="${OPENPKG_TEMP}/${name}${GUID}" + OIFS="$IFS"; IFS=" +" + for configfile in `HOME=${OPENPKG_WORK} ${OPENPKG_INST}/bin/rpm -qplc $rpmdir/$rpmfile`; do + IFS="$OIFS" + filter="$filter -e \"s;^ \\\\(.* ${configfile}\\\\)\$;C\\\\1;\"" + done + IFS="$OIFS" + HOME=${OPENPKG_WORK} ${OPENPKG_INST}/bin/rpm -qplv $rpmdir/$rpmfile | eval $filter + done +} + diff () { # the name comes from the "cvs diff" command. It is actually a # "dry" run of release() without altering anything. @@ -1146,6 +1175,10 @@ done } +help () { + cat ${OPENPKG_WORK}/00README +} + # ------------------------------------------------------------ if [ $# -eq 0 ]; then @@ -1170,10 +1203,11 @@ setup | set*) cmd="setup" ;; bash | ba* ) cmd="bash" ;; update | u* ) cmd="update" ;; - package | p* ) cmd="package" ;; + package | pa* ) cmd="package" ;; branch | br* ) cmd="branch" ;; execute | e* ) cmd="execute" ;; list | lis*) cmd="list" ;; + peek | pe* ) cmd="peek" ;; search | sea*) cmd="search" ;; new | n* ) cmd="new" ;; diff | d* ) cmd="diff" ;; @@ -1181,6 +1215,7 @@ release | r* ) cmd="release" ;; install | i* ) cmd="install" ;; kill | k* ) cmd="kill" ;; + help | h* ) cmd="help" ;; *) die "unknown command \"${cmd}\"" ;; esac ${cmd} "$@" @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List [EMAIL PROTECTED]