Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

category: getting description #510

Open
dlangille opened this issue Dec 10, 2023 · 1 comment
Open

category: getting description #510

dlangille opened this issue Dec 10, 2023 · 1 comment

Comments

@dlangille
Copy link
Contributor

dlangille commented Dec 10, 2023

I think this is the best way to get the description for a [physical] category.

I am not sure how this is done now.

[17:36 empty dan /usr/ports/arabic] % make -V COMMENT
Arabic language support

see verifyport.pm, where you'll find:

                                        $category = $CategoriesChecked{$category_name};
                                        if (!defined($category)) {
                                                $category = FreshPorts::Category->new($dbh);
                                                $category->{name} = $category_name;
                                                my $category_id = $category->FetchByName();

                                                if (defined($category_id)) {
                                                        print "Category $category_name has ID = $category_id\n";
                                                } else {
                                                        # we need to create this catgory.
                                                        # remember to grab ports/<category>/pkg/COMMENT
                                                        # actually, it's in ports/<category>/Makefile as a COMMENT
                                                        print "creating new category $category_name\n";
                                                        FreshPorts::Utilities::ReportError('warning', "creating new category $category_name", 0);

                                                        $category->{is_primary} = 1;
                                                        $category_id = $category->save();
                                                        if (!defined($category_id)) {
                                                                FreshPorts::Utilities::ReportError('warning', "failed to create new category $category_name", 1);
                                                        }

                                                $CategoriesChecked{$category_name} = $category;
@dlangille
Copy link
Contributor Author

See also #605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant