SOLVED: plone.recipe.haproxy-1.1.1 : Failed to compile with user options when archive has a subdirectory

Bug #697169 reported by Mordicus et Cubitus
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
collective.buildout
New
Undecided
Unassigned

Bug Description

Hi,

I have tried to install haproxy on a Solaris system using plone.recipe.haproxy-1.1.1, using this buildout section:

[haproxy-build]
recipe = plone.recipe.haproxy
url = http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.10.tar.gz
cpu = ultrasparc
target = solaris
#pcre = 1

Then it fails, trying to compile the software for "generic" target ignoring user defined parameters.

The fact is that in file plone.recipe.haproxy-1.1.1-py2.4.egg/plone/recipe/haproxy/__init__.py, there is a test to find Makefile in archive, and I guess it is wrong in current implementation:

        try:
            os.chdir(tmp)
            try:
                if not os.path.exists('Makefile'):
                    entries = os.listdir(tmp)
                    # Ignore hidden files
                    entries = [e for e in entries if not e.startswith('.')]
                    if len(entries) == 1:
                        os.chdir(entries[0])
                    else:
                        raise ValueError("Couldn't find Makefile")
                else:
                    optionstring = ' '.join(
                        ['='.join(x) for x in buildoptions.items() if x[1]])
                    system("make %s %s" % (optionstring, extra_options))
                system("make PREFIX=%s install" % dest)
            finally:
                os.chdir(here)
        except:
            shutil.rmtree(dest)
            raise

If archive contains a subdirectory, like in http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.10.tar.gz, then options are not set after the change to this subdirectory in the "if" statement.

Below is a proposed patch:

*** 99,108 ****
                          os.chdir(entries[0])
                      else:
                          raise ValueError("Couldn't find Makefile")
! else:
! optionstring = ' '.join(
! ['='.join(x) for x in buildoptions.items() if x[1]])
! system("make %s %s" % (optionstring, extra_options))
                  system("make PREFIX=%s install" % dest)
              finally:
                  os.chdir(here)
--- 99,108 ----
                          os.chdir(entries[0])
                      else:
                          raise ValueError("Couldn't find Makefile")
!
! optionstring = ' '.join(
! ['='.join(x) for x in buildoptions.items() if x[1]])
! system("make %s %s" % (optionstring, extra_options))
                  system("make PREFIX=%s install" % dest)
              finally:
                  os.chdir(here)

Hope this can help.

Best regards.

summary: - plone.recipe.haproxy-1.1.1 : Failed to compile with user options when
- archive has a subdirectory
+ SOLVED: plone.recipe.haproxy-1.1.1 : Failed to compile with user options
+ when archive has a subdirectory
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.