From nobody@FreeBSD.org  Thu Mar 22 18:24:23 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C352A106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Mar 2012 18:24:23 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id ADE048FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Mar 2012 18:24:23 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MIONB9045009
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 22 Mar 2012 18:24:23 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q2MIONj2044993;
	Thu, 22 Mar 2012 18:24:23 GMT
	(envelope-from nobody)
Message-Id: <201203221824.q2MIONj2044993@red.freebsd.org>
Date: Thu, 22 Mar 2012 18:24:23 GMT
From: Christer Edwards <christer.edwards@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: sysutils/salt - critical patch - loss of functionality
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         166322
>Category:       ports
>Synopsis:       sysutils/salt - critical patch - loss of functionality
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    scheidell
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 22 18:30:01 UTC 2012
>Closed-Date:    Tue Mar 27 12:30:20 UTC 2012
>Last-Modified:  Tue Mar 27 12:30:20 UTC 2012
>Originator:     Christer Edwards
>Release:        9.0-RELEASE
>Organization:
>Environment:
FreeBSD isabel 9.0-RELEASE FreeBSD 9.0-RELEASE #1: Sun Mar 18 13:42:35 MDT 2012     root@isabel:/usr/obj/usr/src/sys/ISABEL  amd64
>Description:
A critical bug was missed in testing the sysutils/salt 0.9.8 release. The current port is critically broken. The attached diff suggests two patches to regain functionality and address a python warning message.
>How-To-Repeat:

>Fix:
In the even the attached .diff is not clear, a file needs to be created at files/patch-kvm_hyper.py to address a FreeBSD specific issue:

--- salt-0.9.8/kvm_hyper.py     2012-03-22 10:57:13.019199302 -0600
+++ salt/modules/kvm_hyper.py        2012-03-22 10:57:45.441204588 -0600
@@ -46,6 +46,8 @@
         return False
     if __grains__['virtual'] != 'physical':
         return False
+    if __grains__['kernel'] != 'Linux': 
+        return False
     if 'kvm_' not in open('/proc/modules').read():
         return False
     if not has_libvirt:

Without this addition the FreeBSD salt minion chokes trying to read '/proc/modules' and exits. This means salt is essentially non-functioning on FreeBSD at this time.

The second part of the attached diff is a minor update to the Python setup.py, which simply bypasses a warning message during build. It is non-critical.

Patch attached with submission follows:

diff -ruN salt-0.9.8/files/patch-kvm_hyper.py salt-0.9.8_1/files/patch-kvm_hyper.py
--- salt-0.9.8/files/patch-kvm_hyper.py 1969-12-31 17:00:00.000000000 -0700
+++ salt-0.9.8_1/files/patch-kvm_hyper.py       2012-03-22 11:41:04.998199701 -0600
@@ -0,0 +1,11 @@
+--- salt-0.9.8/kvm_hyper.py     2012-03-22 10:57:13.019199302 -0600
++++ salt/modules/kvm_hyper.py        2012-03-22 10:57:45.441204588 -0600
+@@ -46,6 +46,8 @@
+         return False
+     if __grains__['virtual'] != 'physical':
+         return False
++    if __grains__['kernel'] != 'Linux':
++        return False
+     if 'kvm_' not in open('/proc/modules').read():
+         return False
+     if not has_libvirt:
diff -ruN salt-0.9.8/files/patch-setup.py salt-0.9.8_1/files/patch-setup.py
--- salt-0.9.8/files/patch-setup.py     2012-01-25 00:16:18.000000000 -0700
+++ salt-0.9.8_1/files/patch-setup.py   2012-03-22 12:09:05.477195875 -0600
@@ -1,6 +1,6 @@
---- salt-0.9.6/setup.py 2012-01-21 02:18:08.000000000 +0000
-+++ setup.py    2012-01-22 19:21:35.158004570 +0000
-@@ -44,7 +44,7 @@
+--- salt-0.9.8/setup.py        2012-03-21 11:46:26.000000000 -0600
++++ setup.py   2012-03-22 11:57:51.926196304 -0600
+@@ -47,7 +47,7 @@
  if 'SYSCONFDIR' in os.environ:
      etc_path = os.environ['SYSCONFDIR']
  else:
@@ -9,7 +9,7 @@

  libraries = ['ws2_32'] if sys.platform == 'win32' else []

-@@ -91,10 +91,10 @@
+@@ -98,10 +98,10 @@
                 'scripts/salt-run',
                 'scripts/salt'],
        data_files=[(os.path.join(etc_path, 'salt'),
@@ -23,7 +23,7 @@
                      ['doc/man/salt-master.1',
                       'doc/man/salt-key.1',
                       'doc/man/salt.1',
-@@ -104,7 +104,7 @@
+@@ -111,9 +111,8 @@
                       'doc/man/salt-run.1',
                       'doc/man/salt-minion.1',
                      ]),
@@ -32,3 +32,5 @@
                      ['doc/man/salt.7',
                      ]),
                   ],
+-      install_requires=requirements,
+      )


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->scheidell 
Responsible-Changed-By: scheidell 
Responsible-Changed-When: Sat Mar 24 19:32:09 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166322 
State-Changed-From-To: open->feedback 
State-Changed-By: scheidell 
State-Changed-When: Sat Mar 24 19:35:21 UTC 2012 
State-Changed-Why:  
I had a patch failure on the second patch. 
Can you take a look at this?  I won't want to guess at this. 

|diff -ruN salt-0.9.8/files/patch-setup.py salt-0.9.8_1/files/patch-setup.py 
|--- salt-0.9.8/files/patch-setup.py     2012-01-25 00:16:18.000000000 -0700 
|+++ salt-0.9.8_1/files/patch-setup.py   2012-03-22 12:09:05.477195875 -0600 
-------------------------- 
File to patch: files/patch-setup.py 
Patching file files/patch-setup.py using Plan A... 
Hunk #1 succeeded at 1. 
Hunk #2 failed at 9. 
Hunk #3 succeeded at 23. 
Hunk #4 succeeded at 32. 
1 out of 4 hunks failed--saving rejects to files/patch-setup.py.rej 

more *.reg 
more: No match. 
%more *.rej 
*************** 
*** 9,15 **** 

libraries = ['ws2_32'] if sys.platform == 'win32' else [] 

- @@ -91,10 +91,10 @@ 
'scripts/salt-run', 
'scripts/salt'], 
data_files=[(os.path.join(etc_path, 'salt'), 
--- 9,15 ---- 

libraries = ['ws2_32'] if sys.platform == 'win32' else [] 

+ @@ -98,10 +98,10 @@ 
'scripts/salt-run', 
'scripts/salt'], 
data_files=[(os.path.join(etc_path, 'salt'), 

patch applied with patch -EuN 


http://www.freebsd.org/cgi/query-pr.cgi?pr=166322 

From: Christer Edwards <christer.edwards@gmail.com>
To: bug-followup@freebsd.org, christer.edwards@gmail.com
Cc:  
Subject: Re: ports/166322: sysutils/salt - critical patch - loss of functionality
Date: Sat, 24 Mar 2012 14:11:30 -0600

 --f46d042c647b684a9f04bc02c01a
 Content-Type: text/plain; charset=UTF-8
 
 I've attached an updated patch-setup.py. This, along with the the
 patch-kvm_hyper.py submitted previously should both apply cleanly now.
 
 Christer
 
 --f46d042c647b684a9f04bc02c01a
 Content-Type: text/x-python; charset=US-ASCII; name="patch-setup.py"
 Content-Disposition: attachment; filename="patch-setup.py"
 Content-Transfer-Encoding: base64
 X-Attachment-Id: f_h073f3pz0
 
 LS0tIHNldHVwLnB5ICAgIDIwMTItMDMtMjEgMTE6NDY6MjYuMDAwMDAwMDAwIC0wNjAwCisrKyBz
 ZXR1cC5weSAgICAyMDEyLTAzLTI0IDE0OjAxOjMzLjk2NTIwMDI5OCAtMDYwMApAQCAtNDcsNyAr
 NDcsNyBAQAogaWYgJ1NZU0NPTkZESVInIGluIG9zLmVudmlyb246CiAgICAgZXRjX3BhdGggPSBv
 cy5lbnZpcm9uWydTWVNDT05GRElSJ10KIGVsc2U6Ci0gICAgZXRjX3BhdGggPSBvcy5wYXRoLmpv
 aW4ob3MucGF0aC5kaXJuYW1lKFBSRUZJWCksICdldGMnKQorICAgIGV0Y19wYXRoID0gb3MucGF0
 aC5qb2luKCclJVBSRUZJWCUlJywgJ2V0YycpCgogbGlicmFyaWVzID0gWyd3czJfMzInXSBpZiBz
 eXMucGxhdGZvcm0gPT0gJ3dpbjMyJyBlbHNlIFtdCgpAQCAtOTgsMTAgKzk4LDEwIEBACiAgICAg
 ICAgICAgICAgICAnc2NyaXB0cy9zYWx0LXJ1bicsCiAgICAgICAgICAgICAgICAnc2NyaXB0cy9z
 YWx0J10sCiAgICAgICBkYXRhX2ZpbGVzPVsob3MucGF0aC5qb2luKGV0Y19wYXRoLCAnc2FsdCcp
 LAotICAgICAgICAgICAgICAgICAgICBbJ2NvbmYvbWFzdGVyLnRlbXBsYXRlJywKLSAgICAgICAg
 ICAgICAgICAgICAgICdjb25mL21pbmlvbi50ZW1wbGF0ZScsCisgICAgICAgICAgICAgICAgICAg
 IFsnY29uZi9tYXN0ZXIuc2FtcGxlJywKKyAgICAgICAgICAgICAgICAgICAgICdjb25mL21pbmlv
 bi5zYW1wbGUnLAogICAgICAgICAgICAgICAgICAgICBdKSwKLSAgICAgICAgICAgICAgICAoJ3No
 YXJlL21hbi9tYW4xJywKKyAgICAgICAgICAgICAgICAoJ21hbi9tYW4xJywKICAgICAgICAgICAg
 ICAgICAgICAgWydkb2MvbWFuL3NhbHQtbWFzdGVyLjEnLAogICAgICAgICAgICAgICAgICAgICAg
 J2RvYy9tYW4vc2FsdC1rZXkuMScsCiAgICAgICAgICAgICAgICAgICAgICAnZG9jL21hbi9zYWx0
 LjEnLApAQCAtMTExLDkgKzExMSw4IEBACiAgICAgICAgICAgICAgICAgICAgICAnZG9jL21hbi9z
 YWx0LXJ1bi4xJywKICAgICAgICAgICAgICAgICAgICAgICdkb2MvbWFuL3NhbHQtbWluaW9uLjEn
 LAogICAgICAgICAgICAgICAgICAgICBdKSwKLSAgICAgICAgICAgICAgICAoJ3NoYXJlL21hbi9t
 YW43JywKKyAgICAgICAgICAgICAgICAoJ21hbi9tYW43JywKICAgICAgICAgICAgICAgICAgICAg
 Wydkb2MvbWFuL3NhbHQuNycsCiAgICAgICAgICAgICAgICAgICAgIF0pLAogICAgICAgICAgICAg
 ICAgICBdLAotICAgICAgaW5zdGFsbF9yZXF1aXJlcz1yZXF1aXJlbWVudHMsCiAgICAgICkK
 --f46d042c647b684a9f04bc02c01a--
State-Changed-From-To: feedback->patched 
State-Changed-By: scheidell 
State-Changed-When: Sat Mar 24 22:03:23 UTC 2012 
State-Changed-Why:  
Patched and Committed. 
Please check.  I reordered _DEPENDS lines to be more standard. 
Make sure there was no special reason you needed the BUILD_DEPENDS+= in the original Makefile. 
PR will remain open until you confirm this fixes all the issues. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166322 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/166322: commit references a PR
Date: Sat, 24 Mar 2012 22:02:49 +0000 (UTC)

 scheidell    2012-03-24 22:02:35 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/salt        Makefile 
     sysutils/salt/files  patch-setup.py 
   Added files:
     sysutils/salt/files  patch-kvm_hyper.py 
   Log:
   - Fixes broken read of '/proc/modules' [1]
   - Silence warning from setup.py during build [1]
   - Reorder _DEPENDS lines
   - Bump PORTREVISION
   
   PR:             ports/166322 [1]
   Submitted by:   Christer Edwards <christer.edwards@gmail.com> (maintainer)
   Approved by:    Christer Edwards <christer.edwards@gmail.com> (maintainer)
   Feature safe:   yes
   
   Revision  Changes    Path
   1.8       +8 -9      ports/sysutils/salt/Makefile
   1.1       +11 -0     ports/sysutils/salt/files/patch-kvm_hyper.py (new)
   1.3       +9 -7      ports/sysutils/salt/files/patch-setup.py
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: scheidell 
State-Changed-When: Tue Mar 27 12:30:18 UTC 2012 
State-Changed-Why:  
Committed, with minor changes. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166322 
>Unformatted:
