From f4acb0f6bfb3ddf07ec83af94db527017cb855f7 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sun, 21 Oct 2007 10:34:42 +0000 Subject: [PATCH] Merged from trunk 8123:8140 | 8124 | Add a note to clarify os.walk() behavior with respect to | | zmedico | symlinks to directories. | | 8125 | Sort the modes in the repoman --help output. | | zmedico | | | 8126 | Document the "manifest" mode. | | zmedico | | | 8128 | remove unused tmpfs variable | | genone | | | 8129 | Bug #195949 - Use a different diff_command sanity check when | | zmedico | using_editor is true. | | 8130 | Bug #195949 - Add one more using_editor conditional for | | zmedico | diff_command. | | 8136 | Update NOTE_2 to document proper use of the using_editor | | zmedico | config option. | | 8138 | Update emacs and vim docs to reference NOTE_2. | | zmedico | | | 8140 | Fix --help summary so that "commit" mode shows. | | zmedico | | svn path=/main/branches/prefix/; revision=8203 --- bin/etc-update | 33 ++++++++++++++++++++++++--------- bin/repoman | 5 ++++- cnf/etc-update.conf | 9 +++++---- cnf/make.conf | 10 ---------- man/repoman.1 | 3 +++ pym/portage/dbapi/porttree.py | 8 -------- pym/portage/dbapi/vartree.py | 3 +++ 7 files changed, 39 insertions(+), 32 deletions(-) diff --git a/bin/etc-update b/bin/etc-update index 8121ddbc3..f0e544d7b 100755 --- a/bin/etc-update +++ b/bin/etc-update @@ -412,8 +412,16 @@ Please select from the menu above (-1 to exit, losing this merge): " rm ${rm_opts} "${file}" return 255 ;; - 2) ( echo "Showing differences between ${ofile} and ${mfile}" - diff_command "${ofile}" "${mfile}" ) | ${pager} + 2) if [ "${using_editor}" == 0 ]; then + ( + echo "Showing differences between ${ofile} and ${mfile}" + diff_command "${ofile}" "${mfile}" + ) | ${pager} + else + echo "Beginning of differences between ${ofile} and ${mfile}" + diff_command "${ofile}" "${mfile}" + echo "End of differences between ${ofile} and ${mfile}" + fi continue ;; 3) break @@ -520,13 +528,20 @@ declare -i mode=$(get_config mode) [[ -z ${mode} ]] && mode=0 [[ -z ${pager} ]] && pager="cat" -# Sanity check to make sure diff exists and works -echo > "${TMP}"/.diff-test-1 -echo > "${TMP}"/.diff-test-2 - -if ! diff_command "${TMP}"/.diff-test-1 "${TMP}"/.diff-test-2 &> /dev/null ; then - echo "ERROR: '${diff_command}' does not seem to work, aborting" - exit 1 +if [ "${using_editor}" == 0 ]; then + # Sanity check to make sure diff exists and works + echo > "${TMP}"/.diff-test-1 + echo > "${TMP}"/.diff-test-2 + + if ! diff_command "${TMP}"/.diff-test-1 "${TMP}"/.diff-test-2 ; then + echo "ERROR: '${diff_command}' does not seem to work, aborting" + exit 1 + fi +else + if ! type ${diff_command%% *} >/dev/null; then + echo "ERROR: '${diff_command}' does not seem to work, aborting" + exit 1 + fi fi #echo "rm_opts: $rm_opts, mv_opts: $mv_opts, cp_opts: $cp_opts" diff --git a/bin/repoman b/bin/repoman index fa7749c12..1b27172eb 100755 --- a/bin/repoman +++ b/bin/repoman @@ -121,6 +121,7 @@ modeshelp={ "lfull" : "Remember report from last run (full listing)" } modes=modeshelp.keys() +modes.sort() repoman_options={ "--commitmsg" : "Adds a commit message via the command line", "--commitmsgfile" : "Adds a commit message from the specified file", @@ -287,7 +288,9 @@ def help(exitstatus=1,helpfulness=1): print bold(" Usage:"),turquoise(exename),"[",green("options"),"] [",green("mode"),"]" if helpfulness: print bold(" Modes:"),turquoise("scan (default)"), - for x in modes[1:]: + for x in modes: + if x == "scan": + continue print "|",turquoise(x), print print diff --git a/cnf/etc-update.conf b/cnf/etc-update.conf index 12396b3b4..fcb4f582b 100644 --- a/cnf/etc-update.conf +++ b/cnf/etc-update.conf @@ -17,15 +17,15 @@ mv_opts="-i" # arguments used whenever cp is called cp_opts="-i" -# pager for use with diff commands (see NOTE_2) +# pager for use with diff commands pager="less" #pager="" -# For emacs-users +# For emacs-users (see NOTE_2) # diff_command="eval emacs -nw --eval=\'\(ediff\ \"%file1\"\ \"%file2\"\)\'" #using_editor=1 -# vim-users: you CAN use vimdiff for diff_command. (see NOTE_1) +# vim-users: you CAN use vimdiff for diff_command. (see NOTE_1 and NOTE_2) #diff_command="vim -d %file1 %file2" #using_editor=1 @@ -72,4 +72,5 @@ merge_command="sdiff -s -o %merged %orig %new" # because it is not known what filenames the produced files have (the user can # choose while using those programs) -# NOTE_2: Make sure pager is set to "" when using an editor as diff_command! +# NOTE_2: Make sure using_editor is set to "1" when using an editor as +# diff_command! diff --git a/cnf/make.conf b/cnf/make.conf index abe42f587..1077d28ea 100644 --- a/cnf/make.conf +++ b/cnf/make.conf @@ -244,16 +244,6 @@ # packages. Do not use it unless absolutely necessary! #AUTOCLEAN="yes" # -# PORTAGE_TMPFS is a location where portage may create temporary files. -# If specified, portage will use this directory whenever possible -# for all rapid operations such as lockfiles and transient data. -# It is _highly_ recommended that this be a tmpfs or ramdisk. Do not -# set this to anything that does not give a significant performance -# enhancement and proper FS compliance for locks and read/write. -# /dev/shm is a glibc mandated tmpfs, and should be a reasonable -# setting for all linux kernel+glibc based systems. -#PORTAGE_TMPFS="/dev/shm" -# # FEATURES are settings that affect the functionality of portage. Most of # these settings are for developer use, but some are available to non- # developers as well. diff --git a/man/repoman.1 b/man/repoman.1 index 81d9e6a08..5fc789c82 100644 --- a/man/repoman.1 +++ b/man/repoman.1 @@ -68,6 +68,9 @@ Fix simple QA issues (stray digests, missing digests) .B lfull Remember report from last run (full listing) .TP +.B manifest +Generate a Manifest (fetches files if necessary) +.TP .B commit Scan directory tree for QA issues; if OK, commit via cvs .SH QA KEYWORDS diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 6a8e441ca..05fe2a767 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -65,14 +65,6 @@ class portdbapi(dbapi): self.depcachedir = self.mysettings.depcachedir[:] - self.tmpfs = self.mysettings["PORTAGE_TMPFS"] - if self.tmpfs and not os.path.exists(self.tmpfs): - self.tmpfs = None - if self.tmpfs and not os.access(self.tmpfs, os.W_OK): - self.tmpfs = None - if self.tmpfs and not os.access(self.tmpfs, os.R_OK): - self.tmpfs = None - self.eclassdb = eclass_cache.cache(self.porttree_root, overlays=self.mysettings["PORTDIR_OVERLAY"].split()) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 26badff20..a298f48b3 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1731,6 +1731,9 @@ class dblink(object): if stat.S_ISREG(file_mode): myfilelist.append(file_path[len(srcroot):]) elif stat.S_ISLNK(file_mode): + # Note: os.walk puts symlinks to directories in the "dirs" + # list and it does not traverse them since that could lead + # to an infinite recursion loop. mylinklist.append(file_path[len(srcroot):]) # Preserve old libs if they are still in use -- 2.26.2