How to use the pikaur.srcinfo.SrcInfo function in pikaur

To help you get started, we’ve selected a few pikaur examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github actionless / pikaur / pikaur / build.py View on Github external
))
        pkgver_result = joined_spawn(
            isolate_root_cmd(
                MakePkgCommand.get() + [
                    '--nobuild', '--noprepare', '--nocheck', '--nodeps'
                ],
                cwd=self.build_dir
            ),
            cwd=self.build_dir,
        )
        if pkgver_result.returncode != 0:
            print_error(_("failed to retrieve latest dev sources:"))
            print_stderr(pkgver_result.stdout_text)
            if not ask_to_continue(default_yes=False):
                raise SysExit(125)
        SrcInfo(self.build_dir).regenerate()
        self._source_repo_updated = True
github actionless / pikaur / pikaur / build.py View on Github external
def get_deps(
            self,
            all_package_builds: Dict[str, 'PackageBuild'],
            filter_built=True
    ) -> None:
        self.new_deps_to_install = []
        new_make_deps_to_install: List[str] = []
        new_check_deps_to_install: List[str] = []
        for package_name in self.package_names:
            src_info = SrcInfo(pkgbuild_path=self.pkgbuild_path, package_name=package_name)
            for new_deps_version_matchers, deps_destination in (
                    (
                        src_info.get_build_depends(), self.new_deps_to_install
                    ), (
                        src_info.get_build_makedepends(), new_make_deps_to_install,
                    ), (
                        src_info.get_build_checkdepends(), new_check_deps_to_install,
                    ),
            ):
                # find deps satisfied explicitly:
                new_deps_to_install = [
                    dep_line
                    for dep_lines in [
                        new_deps_version_matchers[dep_name].line.split(',')
                        for dep_name in PackageDB.get_not_found_local_packages([
                            vm.line for vm in new_deps_version_matchers.values()
github actionless / pikaur / pikaur / install_cli.py View on Github external
print_stdout(_skip_diff_label.format(
                    pkg=_pkg_label,
                    reason="--noconfirm"
                ))
            elif not repo_status.last_installed_hash:
                print_warning(_skip_diff_label.format(
                    pkg=_pkg_label,
                    reason=_("installing for the first time")
                ))
            else:
                print_warning(_skip_diff_label.format(
                    pkg=_pkg_label,
                    reason=_("already reviewed")
                ))

            src_info = SrcInfo(pkgbuild_path=repo_status.pkgbuild_path)
            if self.ask_to_edit_file(
                    os.path.basename(repo_status.pkgbuild_path), repo_status
            ):
                src_info.regenerate()
                # @TODO: recompute AUR deps

            for pkg_name in repo_status.package_names:
                install_src_info = SrcInfo(
                    pkgbuild_path=repo_status.pkgbuild_path,
                    package_name=pkg_name
                )
                install_file_name = install_src_info.get_install_script()
                if install_file_name:
                    self.ask_to_edit_file(install_file_name, repo_status)

            repo_status.check_pkg_arch()
github actionless / pikaur / pikaur / build.py View on Github external
def _filter_built_deps(
            self,
            all_package_builds: Dict[str, 'PackageBuild']
    ) -> None:

        def _mark_dep_resolved(dep: str) -> None:
            if dep in self.new_make_deps_to_install:
                self.new_make_deps_to_install.remove(dep)
            if dep in self.new_deps_to_install:
                self.new_deps_to_install.remove(dep)

        all_provided_pkgnames: Dict[str, str] = {}
        for pkg_build in all_package_builds.values():
            for pkg_name in pkg_build.package_names:
                srcinfo = SrcInfo(
                    pkgbuild_path=pkg_build.pkgbuild_path, package_name=pkg_name
                )
                all_provided_pkgnames.update({
                    provided_name: pkg_name
                    for provided_name in
                    [pkg_name] + srcinfo.get_values('provides')
                })

        self.built_deps_to_install = {}

        for dep in self.all_deps_to_install:
            dep_name = VersionMatcher(dep).pkg_name
            if dep_name not in all_provided_pkgnames:
                continue
            package_build = all_package_builds[all_provided_pkgnames[dep_name]]
            if package_build == self:
github actionless / pikaur / pikaur / install_info_fetcher.py View on Github external
def get_info_from_pkgbuilds(self) -> None:
        aur_updates_install_info_by_name: Dict[str, InstallInfo] = {}
        local_pkgs = PackageDB.get_local_dict()
        for path in self.pkgbuilds_paths:
            common_srcinfo = SrcInfo(pkgbuild_path=path)
            common_srcinfo.regenerate()
            for pkg_name in common_srcinfo.pkgnames:
                srcinfo = SrcInfo(pkgbuild_path=path, package_name=pkg_name)
                aur_pkg = AURPackageInfo.from_srcinfo(srcinfo)
                if pkg_name in aur_updates_install_info_by_name:
                    raise Exception(_(f"{pkg_name} already added to the list"))
                local_pkg = local_pkgs.get(pkg_name)
                aur_updates_install_info_by_name[pkg_name] = InstallInfo(
                    name=pkg_name,
                    current_version=local_pkg.version if local_pkg else ' ',
                    new_version=aur_pkg.version,
                    description=aur_pkg.desc,
                    package=aur_pkg,
                    pkgbuild_path=path,
                )
        self.aur_updates_install_info = list(aur_updates_install_info_by_name.values())
github actionless / pikaur / pikaur / install_cli.py View on Github external
))
            else:
                print_warning(_skip_diff_label.format(
                    pkg=_pkg_label,
                    reason=_("already reviewed")
                ))

            src_info = SrcInfo(pkgbuild_path=repo_status.pkgbuild_path)
            if self.ask_to_edit_file(
                    os.path.basename(repo_status.pkgbuild_path), repo_status
            ):
                src_info.regenerate()
                # @TODO: recompute AUR deps

            for pkg_name in repo_status.package_names:
                install_src_info = SrcInfo(
                    pkgbuild_path=repo_status.pkgbuild_path,
                    package_name=pkg_name
                )
                install_file_name = install_src_info.get_install_script()
                if install_file_name:
                    self.ask_to_edit_file(install_file_name, repo_status)

            repo_status.check_pkg_arch()
            repo_status.reviewed = True