OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-tools Date: 10-Oct-2005 11:58:53 Branch: HEAD Handle: 2005101010585300 Modified files: openpkg-tools/cmd dev.sh Log: Change cleanup handling of logs and temp based on Steve's feedback. Short: now "install" cleans local logs and temp from all but the current package, "clean -a" cleans all logs and local temp. Long: usually multiple packages are given to "install" to satisfy build dependencies of the current package and the developer has little interest in the resulting logs and temp. However, the information about the current package might be useful when runtime testing reveals problems. So it is kept now. A "release" assumes a milestone in development is reached and cleans all logs and local temp (it cannot access remote temp) for the packages listed. A "clean" works orthogonal to related commands and cleans local logs and local temp (it cannot access remote temp) for the packages listed, keeping logs from other hosts where work mighth still in progress. Along with -l it discards all logs for all packages, with -t it discards all contents of the local temp directory and -f does both. The result is a compromise between keeping useful information as long as possible while saving disk space. Summary: Revision Changes Path 1.60 +49 -13 openpkg-tools/cmd/dev.sh ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-tools/cmd/dev.sh ============================================================================ $ cvs diff -u -r1.59 -r1.60 dev.sh --- openpkg-tools/cmd/dev.sh 12 Aug 2005 20:29:38 -0000 1.59 +++ openpkg-tools/cmd/dev.sh 10 Oct 2005 09:58:53 -0000 1.60 @@ -1864,15 +1864,49 @@ } clean () { - echo "++ cleaning up logs ${OPENPKG_WORK}/$S" - rm ${OPENPKG_WORK}/$S/*/[EMAIL PROTECTED] >/dev/null 2>&1 || true - case ${OPENPKG_TEMP} in - /?* ) ;; - * ) die "temporary area ${OPENPKG_TEMP} seems to be strange" ;; - esac - if [ -d ${OPENPKG_TEMP} ]; then - echo "++ cleaning temporary area ${OPENPKG_TEMP}" - rm -rf ${OPENPKG_TEMP}/* ${OPENPKG_TEMP}/.[a-z]* >/dev/null 2>&1 || true + cleanlogs=0 + cleantemp=0 + force=0 + packages="" + while [ ".$1" != . ]; do + case ".$1" in + .-l ) cleanlogs=1 ;; + .-t ) cleantemp=1 ;; + .-f ) force=1 ;; + .-* ) die "unsupported option \"$1\"." ;; + * ) packages="${packages} $1" + esac + shift + done + + if [ $force -eq 1 -o $cleanlogs -eq 1 ]; then + echo "++ cleaning up all logs in ${OPENPKG_WORK}/$S" + rm ${OPENPKG_WORK}/$S/*/[EMAIL PROTECTED] >/dev/null 2>&1 || true + fi + if [ $force -eq 1 -o $cleantemp -eq 1 ]; then + case ${OPENPKG_TEMP} in + /?* ) ;; + * ) die "temporary area ${OPENPKG_TEMP} seems to be strange" ;; + esac + if [ -d ${OPENPKG_TEMP} ]; then + echo "++ cleaning temporary area ${OPENPKG_TEMP}" + rm -rf ${OPENPKG_TEMP}/* ${OPENPKG_TEMP}/.[a-z]* >/dev/null 2>&1 || true + fi + fi + if [ $force -eq 0 -a $cleanlogs -eq 0 -a $cleantemp -eq 0 ]; then + if [ ".${packages}" = . ]; then + if [ ".$P" = . ]; then + die "package cannot be identified. Neither parameter given nor \$P set." + fi + all="$P" + else + all="${packages}" + fi + for name in $all; do + echo "++ cleaning up sources and logs for ${name}" + rpmE --clean --nodeps ${OPENPKG_WORK}/$S/${name}/${name}.spec >/dev/null 2>&1 || true + rm ${OPENPKG_WORK}/$S/${name}/[EMAIL PROTECTED] >/dev/null 2>&1 || true + done fi } @@ -2060,9 +2094,11 @@ if [ $? -ne 0 ]; then warn "failed to install $package" fi - echo "++ cleaning up sources and logs" - rpmE --clean --nodeps ${OPENPKG_WORK}/$S/${name}/${name}.spec >/dev/null 2>&1 || true - rm ${OPENPKG_WORK}/$S/${name}/[EMAIL PROTECTED] >/dev/null 2>&1 || true + if [ ".${name}" != ".$P" ]; then + echo "++ cleaning up sources and logs for ${name}" + rpmE --clean --nodeps ${OPENPKG_WORK}/$S/${name}/${name}.spec >/dev/null 2>&1 || true + rm ${OPENPKG_WORK}/$S/${name}/[EMAIL PROTECTED] >/dev/null 2>&1 || true + fi done } @@ -2669,7 +2705,7 @@ \$ openpkg dev branch # [ctag] switch to a different branch \$ openpkg dev bsource # [[spec]...] [-f][-s][-D with...] rpmE -bs [--short-circuit] spec (force, opt) \$ openpkg dev build # [[spec]...] [-f][-f][-D with...] build a package (force, option) - \$ openpkg dev clean # clean the temporary area + \$ openpkg dev clean # [-l][-t][-f] [[spec]...] clean logs and/or temp (force all) \$ openpkg dev diff # alias for "release -dry" \$ openpkg dev execute # [exec] execute command on instance closest to branch \$ openpkg dev fetch # [[spec]...] [-s][-a] fetch sources; clean selected or all dst files @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org