
from distutils.core import setup
from glob import glob
import os
import sys

import py2exe

if len(sys.argv) == 1:
    sys.argv.append("py2exe")
    sys.argv.append("-b 1")


class Target:
    def __init__(self, **kw):
        self.__dict__.update(kw)
        self.version = "1.0.16"
        self.company_name = "Red Hat"
        self.copyright = "Copyright(C) Red Hat Inc."
        self.name = "Guest VDS Agent "

OVirtAgentTarget = Target(description="Ovirt Guest Agent",
                          modules=["OVirtGuestService"])

DLL_EXCLUDES = ['POWRPROF.dll', 'KERNELBASE.dll',
                'WTSAPI32.dll', 'MSWSOCK.dll']
for name in glob(os.getenv('windir') + '\*\API-MS-Win-*.dll'):
    DLL_EXCLUDES.append(name[name.rfind('\\') + 1:])

setup(service=[OVirtAgentTarget],
      options={'py2exe': {
          'bundle_files': 1,
          'dll_excludes': DLL_EXCLUDES}},
      zipfile=None)


from distutils.core import setup
from glob import glob
import os
import sys

import py2exe

if len(sys.argv) == 1:
    sys.argv.append("py2exe")
    sys.argv.append("-b 1")


class Target:
    def __init__(self, **kw):
        self.__dict__.update(kw)
        self.version = "1.0.16"
        self.package_version = "1.0.16"
        self.company_name = "Red Hat"
        self.copyright = "Copyright(C) Red Hat Inc."
        self.name = "Guest VDS Agent "

OVirtAgentTarget = Target(description="Ovirt Guest Agent",
                          modules=["OVirtGuestService"])

DLL_EXCLUDES = ['POWRPROF.dll', 'KERNELBASE.dll',
                'WTSAPI32.dll', 'MSWSOCK.dll']
for name in glob(os.getenv('windir') + '\*\API-MS-Win-*.dll'):
    DLL_EXCLUDES.append(name[name.rfind('\\') + 1:])

setup(service=[OVirtAgentTarget],
      options={'py2exe': {
          'bundle_files': 1,
          'dll_excludes': DLL_EXCLUDES}},
      zipfile=None)

Add explicit package version to the oVirt GA executable
Add explicit package version to the oVirt GA executable

We really need to track 2 different versions in case of oVirt GA:
- the version of the oVirt GA package itself
- RH(E)V specific version of the oVirt GA package

This patch adds setting of the package_version.

Change-Id: I2dea656facbf2aa33a733316136e0e4d1b8d4744
Signed-off-by: Lev Veyde <32edd3ccb8e9d69e90ee9ce8dbc368c1f61bdf7b@redhat.com>

  
  from distutils.core import setup
  from glob import glob
  import os
  import sys
  
  import py2exe
  
  if len(sys.argv) == 1:
      sys.argv.append("py2exe")
      sys.argv.append("-b 1")
  
  
  class Target:
      def __init__(self, **kw):
          self.__dict__.update(kw)
          self.version = "1.0.16"
+         self.package_version = "1.0.16"
          self.company_name = "Red Hat"
          self.copyright = "Copyright(C) Red Hat Inc."
          self.name = "Guest VDS Agent "
  
  OVirtAgentTarget = Target(description="Ovirt Guest Agent",
                            modules=["OVirtGuestService"])
  
  DLL_EXCLUDES = ['POWRPROF.dll', 'KERNELBASE.dll',
                  'WTSAPI32.dll', 'MSWSOCK.dll']
  for name in glob(os.getenv('windir') + '\*\API-MS-Win-*.dll'):
      DLL_EXCLUDES.append(name[name.rfind('\\') + 1:])
  
  setup(service=[OVirtAgentTarget],
        options={'py2exe': {
            'bundle_files': 1,
            'dll_excludes': DLL_EXCLUDES}},
        zipfile=None)
  
Add explicit package version to the oVirt GA executable
## Code Before:

from distutils.core import setup
from glob import glob
import os
import sys

import py2exe

if len(sys.argv) == 1:
    sys.argv.append("py2exe")
    sys.argv.append("-b 1")


class Target:
    def __init__(self, **kw):
        self.__dict__.update(kw)
        self.version = "1.0.16"
        self.company_name = "Red Hat"
        self.copyright = "Copyright(C) Red Hat Inc."
        self.name = "Guest VDS Agent "

OVirtAgentTarget = Target(description="Ovirt Guest Agent",
                          modules=["OVirtGuestService"])

DLL_EXCLUDES = ['POWRPROF.dll', 'KERNELBASE.dll',
                'WTSAPI32.dll', 'MSWSOCK.dll']
for name in glob(os.getenv('windir') + '\*\API-MS-Win-*.dll'):
    DLL_EXCLUDES.append(name[name.rfind('\\') + 1:])

setup(service=[OVirtAgentTarget],
      options={'py2exe': {
          'bundle_files': 1,
          'dll_excludes': DLL_EXCLUDES}},
      zipfile=None)

## Instruction:
Add explicit package version to the oVirt GA executable
## Code After:

from distutils.core import setup
from glob import glob
import os
import sys

import py2exe

if len(sys.argv) == 1:
    sys.argv.append("py2exe")
    sys.argv.append("-b 1")


class Target:
    def __init__(self, **kw):
        self.__dict__.update(kw)
        self.version = "1.0.16"
        self.package_version = "1.0.16"
        self.company_name = "Red Hat"
        self.copyright = "Copyright(C) Red Hat Inc."
        self.name = "Guest VDS Agent "

OVirtAgentTarget = Target(description="Ovirt Guest Agent",
                          modules=["OVirtGuestService"])

DLL_EXCLUDES = ['POWRPROF.dll', 'KERNELBASE.dll',
                'WTSAPI32.dll', 'MSWSOCK.dll']
for name in glob(os.getenv('windir') + '\*\API-MS-Win-*.dll'):
    DLL_EXCLUDES.append(name[name.rfind('\\') + 1:])

setup(service=[OVirtAgentTarget],
      options={'py2exe': {
          'bundle_files': 1,
          'dll_excludes': DLL_EXCLUDES}},
      zipfile=None)
