<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>135051</bug_id>
          
          <creation_ts>2006-05-31 08:22 0000</creation_ts>
          <short_desc>stage2 tries untaring a stage1root directory if seedache is not specified in config</short_desc>
          <delta_ts>2006-06-08 17:48:19 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Hosted Projects</product>
          <component>Catalyst</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <keywords>InCVS</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>kumba@gentoo.org</reporter>
          <assigned_to>catalyst@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>kumba@gentoo.org</who>
            <bug_when>2006-05-31 08:22:30 0000</bug_when>
            <thetext>Logic in modules/generic_stage_target.py:575 attempts to deduce if both SEEDCACHE is defined in the catalyst config AND if the source_path is a directory.  If both are true, then it is supposed to rsync the stage1root directory over as the stage2 build directory.  If false, it attempts to run a tar extraction.

In the event SEEDCACHE is not defined, but stage1root exists, catalyst inadvertently tries to run a tar extraction on a directory, which bombs most fantastically.  Example:

Using seed-stage from /usr/catalyst/tmp/default/stage1-mips3-2006.1-pre/tmp/stage1root/
Delete this folder if you wish to use a seed stage tarball instead

The autoresume path is /usr/catalyst/tmp/default/.autoresume-stage2-mips3-2006.1-pre/
Location of the package cache is /usr/catalyst/packages/default/stage2-mips3-2006.1-pre/
Location of the kerncache is /usr/catalyst/kerncache/default/stage2-mips3-2006.1-pre/
Checking for processes running in chroot and killing them.
Running action sequence: unpack

Starting tar extract from /usr/catalyst/tmp/default/stage1-mips3-2006.1-pre/tmp/stage1root/
to /usr/catalyst/tmp/default/stage2-mips3-2006.1-pre/ (This may take some time) ...

tar: /usr/catalyst/tmp/default/stage1-mips3-2006.1-pre/tmp/stage1root/: Cannot read: Is a directory
tar: At beginning of tape, quitting now
tar: Error is not recoverable: exiting now

bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: Invalid argument
        Input file = (stdin), output file = (stdout)

[snip]


To resolve this, a patch is attached the re-writes the logic of this conditional block as such (abbreviated hacky C logic):

if has_key(SEEDCACHE) {
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kumba@gentoo.org</who>
            <bug_when>2006-05-31 08:22:30 0000</bug_when>
            <thetext>Logic in modules/generic_stage_target.py:575 attempts to deduce if both SEEDCACHE is defined in the catalyst config AND if the source_path is a directory.  If both are true, then it is supposed to rsync the stage1root directory over as the stage2 build directory.  If false, it attempts to run a tar extraction.

In the event SEEDCACHE is not defined, but stage1root exists, catalyst inadvertently tries to run a tar extraction on a directory, which bombs most fantastically.  Example:

Using seed-stage from /usr/catalyst/tmp/default/stage1-mips3-2006.1-pre/tmp/stage1root/
Delete this folder if you wish to use a seed stage tarball instead

The autoresume path is /usr/catalyst/tmp/default/.autoresume-stage2-mips3-2006.1-pre/
Location of the package cache is /usr/catalyst/packages/default/stage2-mips3-2006.1-pre/
Location of the kerncache is /usr/catalyst/kerncache/default/stage2-mips3-2006.1-pre/
Checking for processes running in chroot and killing them.
Running action sequence: unpack

Starting tar extract from /usr/catalyst/tmp/default/stage1-mips3-2006.1-pre/tmp/stage1root/
to /usr/catalyst/tmp/default/stage2-mips3-2006.1-pre/ (This may take some time) ...

tar: /usr/catalyst/tmp/default/stage1-mips3-2006.1-pre/tmp/stage1root/: Cannot read: Is a directory
tar: At beginning of tape, quitting now
tar: Error is not recoverable: exiting now

bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: Invalid argument
        Input file = (stdin), output file = (stdout)

[snip]


To resolve this, a patch is attached the re-writes the logic of this conditional block as such (abbreviated hacky C logic):

if has_key(SEEDCACHE) {
··· if isdir(source_path) {
······ /* Directory exists, use rsync */
······ run rsync();
··· } else {
······ /* Directory does not exist, or is not a
······ ** directory.  Attempt tar extract instead
······ **/
······ run tar_extract();
··· }
} else {
··· /* No SEEDCACHE, extract tarball */
··· run tar_extract();
}</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kumba@gentoo.org</who>
            <bug_when>2006-05-31 08:23:23 0000</bug_when>
            <thetext>Created an attachment (id=87988)
Rewrite SEEDCACHE extraction logic

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wolf31o2@gentoo.org</who>
            <bug_when>2006-06-08 14:27:09 0000</bug_when>
            <thetext>I&apos;ve added this to CVS</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wolf31o2@gentoo.org</who>
            <bug_when>2006-06-08 17:48:19 0000</bug_when>
            <thetext>Fixed in 2.0_rc47</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>87988</attachid>
            <date>2006-05-31 08:23 0000</date>
            <desc>Rewrite SEEDCACHE extraction logic</desc>
            <filename>cat2-fix-seedcache.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIG1vZHVsZXMvZ2VuZXJpY19zdGFnZV90YXJnZXQucHkub3JpZwkyMDA2LTA1LTMwIDAyOjE4
OjQ3IC0wNDAwCisrKyBtb2R1bGVzL2dlbmVyaWNfc3RhZ2VfdGFyZ2V0LnB5LnJzeW5jCTIwMDYt
MDUtMzEgMTU6MjI6MjcgLTA0MDAKQEAgLTU3MiwxMiArNTcyLDIyIEBAIGNsYXNzIGdlbmVyaWNf
c3RhZ2VfdGFyZ2V0KGdlbmVyaWNfdGFyZ2UKIAogCQljbHN0X3VucGFja19oYXNoPXJ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