Exemple #1
0
 def _validate_files(self, key, required=True):
     """Validate the existence of the required input files for the current package."""
     self.pkg[key] = onlu.validate_src_dst_file_tuples(self.dir,
                                                       self.pkg[key],
                                                       dict(PKG=self.pkg['name'], PKG_INSTALL='/usr/share/onl/packages/%s/%s' % (self.pkg['arch'], self.pkg['name'])),
                                                       OnlPackageError,
                                                       required=required)
 def _validate_files(self):
     """Validate the existence of the required input files for the current package."""
     self.pkg["files"] = onlu.validate_src_dst_file_tuples(
         self.dir,
         self.pkg["files"],
         dict(
             PKG=self.pkg["name"], PKG_INSTALL="/usr/share/onl/packages/%s/%s" % (self.pkg["arch"], self.pkg["name"])
         ),
         OnlPackageError,
     )
Exemple #3
0
    def build(self, dir_=None):
        """Build all packages in the current group.

        dir_ : The output directory for the package group.
               The default is the package group parent directory.

        The option to build individual packages is not provided.
        The assumption is that the packages defined in the group are
        related and should always be built together.

        It is also assumed that all packages in the group have a common
        build step. That build step is performed once, and all packages
        are then built from the artifacts as defined in the package
        specifications.

        This assures there are not mismatches in the contents of packages
        from the same group and that there are no unecessary invocations of
        the build steps.
        """

        products = []

        with onlu.Lock(os.path.join(self._pkgs['__directory'], '.lock')):
            self.gmake_locked("", 'Build')
            for p in self.packages:
                products.append(p.build(dir_=dir_))


        if 'release' in self._pkgs:
            release_list = onlu.validate_src_dst_file_tuples(self._pkgs['__directory'],
                                                      self._pkgs['release'],
                                                      dict(),
                                                      OnlPackageError)
            for f in release_list:
                release_dir = os.environ.get('ONLPM_OPTION_RELEASE_DIR',
                                             os.path.join(os.environ.get('ONL', 'RELEASE')))
                dst = os.path.join(release_dir, g_dist_codename, f[1])
                if not os.path.exists(dst):
                    os.makedirs(dst)
                logger.info("Releasing %s -> %s" % (os.path.basename(f[0]), dst))
                shutil.copy(f[0], dst)

        return products
Exemple #4
0
    def build(self, dir_=None):
        """Build all packages in the current group.

        dir_ : The output directory for the package group.
               The default is the package group parent directory.

        The option to build individual packages is not provided.
        The assumption is that the packages defined in the group are
        related and should always be built together.

        It is also assumed that all packages in the group have a common
        build step. That build step is performed once, and all packages
        are then built from the artifacts as defined in the package
        specifications.

        This assures there are not mismatches in the contents of packages
        from the same group and that there are no unecessary invocations of
        the build steps.
        """

        products = []

        with onlu.Lock(os.path.join(self._pkgs['__directory'], '.lock')):
            self.gmake_locked("", 'Build')
            for p in self.packages:
                products.append(p.build(dir_=dir_))

        if 'release' in self._pkgs:
            release_list = onlu.validate_src_dst_file_tuples(
                self._pkgs['__directory'], self._pkgs['release'], dict(),
                OnlPackageError)
            for f in release_list:
                release_dir = os.environ.get(
                    'ONLPM_OPTION_RELEASE_DIR',
                    os.path.join(os.environ.get('ONL', 'RELEASE')))
                dst = os.path.join(release_dir, g_dist_codename, f[1])
                if not os.path.exists(dst):
                    os.makedirs(dst)
                logger.info("Releasing %s -> %s" %
                            (os.path.basename(f[0]), dst))
                shutil.copy(f[0], dst)

        return products
    def build(self, dir_=None):
        """Build all packages in the current group.

        dir_ : The output directory for the package group.
               The default is the package group parent directory.

        The option to build individual packages is not provided.
        The assumption is that the packages defined in the group are
        related and should always be built together.

        It is also assumed that all packages in the group have a common
        build step. That build step is performed once, and all packages
        are then built from the artifacts as defined in the package
        specifications.

        This assures there are not mismatches in the contents of packages
        from the same group and that there are no unecessary invocations of
        the build steps.
        """

        products = []

        with onlu.Lock(os.path.join(self._pkgs["__directory"], ".lock")):
            self.gmake_locked("", "Build")
            for p in self.packages:
                products.append(p.build(dir_=dir_))

        if "release" in self._pkgs:
            for (src, dst) in onlu.validate_src_dst_file_tuples(
                self._pkgs["__directory"], self._pkgs["release"], dict(), OnlPackageError
            ):
                root = os.path.join(
                    os.environ.get("ONLPM_OPTION_RELEASE_DIR", os.path.join(os.environ.get("ONL", "RELEASE"))),
                    g_dist_codename,
                )
                OnlPackage.copyf(src, dst, root)

        return products
Exemple #6
0
 def _validate_files(self):
     """Validate the existence of the required input files for the current package."""
     self.pkg['files'] = onlu.validate_src_dst_file_tuples(self.dir,
                                                           self.pkg['files'],
                                                           dict(PKG=self.pkg['name'], PKG_INSTALL='/usr/share/onl/packages/%s/%s' % (self.pkg['arch'], self.pkg['name'])),
                                                           OnlPackageError)