aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/feeds26
-rwxr-xr-xscripts/metadata.pl12
-rw-r--r--scripts/metadata.pm1
3 files changed, 38 insertions, 1 deletions
diff --git a/scripts/feeds b/scripts/feeds
index be07e59613..26c2de0945 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -262,11 +262,17 @@ sub list_feed {
sub list {
my %opts;
- getopts('r:d:sh', \%opts);
+ getopts('r:d:nsh', \%opts);
if ($opts{h}) {
usage();
return 0;
}
+ if ($opts{n}) {
+ foreach my $feed (@feeds) {
+ printf "%s\n", $feed->[1];
+ }
+ return 0;
+ }
if ($opts{s}) {
foreach my $feed (@feeds) {
my $localpath = "./feeds/$feed->[1]";
@@ -598,6 +604,22 @@ sub update {
return 0;
}
+sub feed_config() {
+ foreach my $feed (@feeds) {
+ my $installed = (-f "feeds/$feed->[1].index");
+
+ printf "\tconfig FEED_%s\n", $feed->[1];
+ printf "\t\tbool \"Enable feed %s\"\n", $feed->[1];
+ printf "\t\tdepends on PER_FEED_REPO\n";
+ printf "\t\tdefault y\n" if $installed;
+ printf "\t\thelp\n";
+ printf "\t\t Enable the \\\"%s\\\" feed at %s.\n", $feed->[1], $feed->[2][0];
+ printf "\n";
+ }
+
+ return 0;
+}
+
sub usage() {
print <<EOF;
Usage: $0 <command> [options]
@@ -605,6 +627,7 @@ Usage: $0 <command> [options]
Commands:
list [options]: List feeds, their content and revisions (if installed)
Options:
+ -n : List of feed names.
-s : List of feed names and their URL.
-r <feedname>: List packages of specified feed.
-d <delimiter>: Use specified delimiter to distinguish rows (default: spaces)
@@ -640,6 +663,7 @@ my %commands = (
'install' => \&install,
'search' => \&search,
'uninstall' => \&uninstall,
+ 'feed_config' => \&feed_config,
'clean' => sub {
system("rm -rf feeds");
}
diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index e408beb507..79f930c5ea 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -848,6 +848,16 @@ sub gen_package_source() {
}
}
+sub gen_package_feeds() {
+ parse_package_metadata($ARGV[0]) or exit 1;
+ foreach my $name (sort {uc($a) cmp uc($b)} keys %package) {
+ my $pkg = $package{$name};
+ if ($pkg->{name} && $pkg->{feed}) {
+ print "Package/$name/feed = $pkg->{feed}\n";
+ }
+ }
+}
+
sub parse_command() {
my $cmd = shift @ARGV;
for ($cmd) {
@@ -856,6 +866,7 @@ sub parse_command() {
/^package_config$/ and return gen_package_config();
/^kconfig/ and return gen_kconfig_overrides();
/^package_source$/ and return gen_package_source();
+ /^package_feeds$/ and return gen_package_feeds();
}
print <<EOF
Available Commands:
@@ -864,6 +875,7 @@ Available Commands:
$0 package_config [file] Package metadata in Kconfig format
$0 kconfig [file] [config] Kernel config overrides
$0 package_source [file] Package source file information
+ $0 package_feeds [file] Package feed information in makefile format
EOF
}
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index 6f86e67eaf..0e55c8ebed 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -119,6 +119,7 @@ sub parse_package_metadata($) {
/^Build-Depends: \s*(.+)\s*$/ and $pkg->{builddepends} = [ split /\s+/, $1 ];
/^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ];
/^Build-Types:\s*(.+)\s*$/ and $pkg->{buildtypes} = [ split /\s+/, $1 ];
+ /^Feed:\s*(.+?)\s*$/ and $pkg->{feed} = $1;
/^Category: \s*(.+)\s*$/ and do {
$pkg->{category} = $1;
defined $category{$1} or $category{$1} = {};