Merged from trunk 6173:6178
authorFabian Groffen <grobian@gentoo.org>
Mon, 5 Mar 2007 21:50:20 +0000 (21:50 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 5 Mar 2007 21:50:20 +0000 (21:50 -0000)
allow people to disable compression by setting the PORTAGE_COMPRESS
variables to "" (SpankMan)

Avoid pointless population of the binary tree when --buildpkg is
enabled.  Thanks to vapier for reporting.

these will fail now (WarnerBro)

svn path=/main/branches/prefix/; revision=6180

bin/ecompress
bin/ecompressdir
pym/emerge/__init__.py
pym/portage/tests/dep/test_isvalidatom.py

index 6bd752818135232e3c9f9a27329e19b3ae919c94..f80e6e28ba3b7c1ccb23312b2c4f809aee9c91ad 100755 (executable)
@@ -3,16 +3,18 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: prepman 5507 2007-01-10 04:22:27Z zmedico $
 
+source "${PORTAGE_BIN_PATH:-${EPREFIX}/usr/lib/portage/bin}"/isolated-functions.sh
+
 if [[ -z $1 ]] ; then
-       echo "${0##*/}: at least one argument needed" 1>&2
+       vecho "${0##*/}: at least one argument needed" 1>&2
        exit 1
 fi
 
-source "${PORTAGE_BIN_PATH:-${EPREFIX}/usr/lib/portage/bin}"/isolated-functions.sh
-
 # setup compression stuff
-PORTAGE_COMPRESS=${PORTAGE_COMPRESS:-bzip2}
-if [[ -z ${PORTAGE_COMPRESS_FLAGS} ]] ; then
+PORTAGE_COMPRESS=${PORTAGE_COMPRESS-bzip2}
+[[ -z ${PORTAGE_COMPRESS} ]] && exit 0
+
+if [[ ${PORTAGE_COMPRESS_FLAGS+set} != "set" ]] ; then
        case ${PORTAGE_COMPRESS} in
                bzip2|gzip)  PORTAGE_COMPRESS_FLAGS="-f9";;
        esac
index 62d9af5e0c878855839f436c99d2231bd0d706dd..0c2e0a5d1aec8d59675bd4a401721e5890acab8f 100755 (executable)
@@ -3,19 +3,15 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: prepalldocs 3483 2006-06-10 21:40:40Z genone $
 
+source "${PORTAGE_BIN_PATH:-${EPREFIX}/usr/lib/portage/bin}"/isolated-functions.sh
+
 if [[ -z $1 ]] ; then
-       echo "${0##*/}: at least one argument needed" 1>&2
+       vecho "${0##*/}: at least one argument needed" 1>&2
        exit 1
 fi
 
 # figure out the new suffix
 suffix=$(ecompress --suffix)
-if [[ -z ${suffix} ]] ; then
-       vecho "${0##*/}: unable to figure out compressed suffix"
-       exit 1
-fi
-
-source "${PORTAGE_BIN_PATH:-${EPREFIX}/usr/lib/portage/bin}"/isolated-functions.sh
 
 # funk_up_dir(action, suffix, binary)
 #      - action: compress or decompress
@@ -54,8 +50,6 @@ for dir in "$@" ; do
        if [[ ! -d ${dir} ]] ; then
                vecho "${0##*/}: ${dir#${ED}} does not exist!"
                continue
-       else
-               vecho "${0##*/}: $(ecompress --bin) ${dir#${D}}"
        fi
 
        # not uncommon for packages to compress doc files themselves
@@ -64,6 +58,8 @@ for dir in "$@" ; do
        funk_up_dir "decompress" "bz2" "bunzip2"
 
        # now lets do our work
+       [[ -z ${suffix} ]] && continue
+       vecho "${0##*/}: $(ecompress --bin) ${dir#${D}}"
        funk_up_dir "compress" "${suffix}" "ecompress"
 done
 
index 9f2434159f177160d4d359e8a5a6223cf3e77df9..0ad0f7f6911e2251f1e7b861083a0aafd7719ff8 100644 (file)
@@ -3094,10 +3094,10 @@ class MergeTask(object):
                                                        tree="porttree")
                                                if retval != os.EX_OK:
                                                        return retval
-                                               if "--buildpkgonly" not in self.myopts:
-                                                       bintree = self.trees[myroot]["bintree"]
+                                               bintree = self.trees[myroot]["bintree"]
+                                               if bintree.populated:
                                                        bintree.inject(pkg_key)
-                                                       mytbz2 = bintree.getname(pkg_key)
+                                               if "--buildpkgonly" not in self.myopts:
                                                        msg = " === (%s of %s) Merging (%s::%s)" % \
                                                                (mergecount, len(mymergelist), pkg_key, y)
                                                        short_msg = "emerge: (%s of %s) %s Merge" % \
index 054205eb9b7e689facc4a84fe17ecad0f726c832..995ec9924e4504642033444ef890fe9e12bebf29 100644 (file)
@@ -22,11 +22,12 @@ class IsValidAtom(TestCase):
                          ( ">sys-apps/portage-2.1", True ),
                          ( "<sys-apps/portage-2.1", True ),
                          ( "~sys-apps/portage-2.1", True ),
+                         ( "sys-apps/portage:foo", True ),
                          ( "sys-apps/portage-2.1:foo", False ),
                          ( "sys-apps/portage-2.1:", False ),
-                         ( ">~cate-gory/foo-1.0", False ),
-                         ( ">~category/foo-1.0", False ),
-                         ( "<~category/foo-1.0", False ),
+                         ( ">~cate-gory/foo-1.0", True ),
+                         ( ">~category/foo-1.0", True ),
+                         ( "<~category/foo-1.0", True ),
                          ( "###cat/foo-1.0", False ),
                          ( "~sys-apps/portage", False ),
                          ( "portage", False ) ]