aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRalph Hempel <ralph.hempel@lantiq.com>2008-01-30 09:22:05 +0000
committerRalph Hempel <ralph.hempel@lantiq.com>2008-01-30 09:22:05 +0000
commit3b420c84148586c445f6b353a1a5f8884c167496 (patch)
treef353f98ced33f3caa0a710bd75bd1f93d249bc32 /scripts
parent42ecd8397208dbe45adcd4fb314ea1786ec55747 (diff)
downloadupstream-3b420c84148586c445f6b353a1a5f8884c167496.tar.gz
upstream-3b420c84148586c445f6b353a1a5f8884c167496.tar.bz2
upstream-3b420c84148586c445f6b353a1a5f8884c167496.zip
- added package list function
-r list packages of specified feed -s list the feed names only and their URL - refresh of usage text -d-This line, and those below, will be ignored-- M feeds git-svn-id: svn://svn.openwrt.org/openwrt/trunk@10322 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/feeds54
1 files changed, 47 insertions, 7 deletions
diff --git a/scripts/feeds b/scripts/feeds
index 7add0291e6..9ab0d7e6df 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -142,7 +142,6 @@ sub search_feed {
return 0;
}
-
sub search {
my %opts;
@@ -152,6 +151,40 @@ sub search {
}
}
+sub list_feed {
+ my $feed = shift;
+
+ get_feed($feed);
+ foreach my $name (sort { lc($a) cmp lc($b) } keys %package) {
+ my $pkg = $package{$name};
+ if($pkg->{name}) {
+ printf "\%-32s\t\%s\n", $pkg->{name}, $pkg->{title};
+ }
+ }
+
+ return 0;
+}
+
+sub list {
+ my %opts;
+
+ getopts('r:sh', \%opts);
+ if ($opts{h}) {
+ usage();
+ return 0;
+ }
+ if ($opts{s}) {
+ foreach my $feed (@feeds) {
+ printf "\%-32s\tURL: %s\n", $feed->[1], $feed->[2];
+ }
+ return 0;
+ }
+ foreach my $feed (@feeds) {
+ list_feed($feed->[1], @ARGV) if (!defined($opts{r}) or $opts{r} eq $feed->[1]);
+ }
+ return 0;
+}
+
sub install_generic() {
my $feed = shift;
my $pkg = shift;
@@ -332,21 +365,27 @@ sub usage() {
Usage: $0 <command> [options]
Commands:
+ list [options]: List feeds and their content
+ Options:
+ -s : List of feed names and their URL.
+ -r <feedname>: List packages of specified feed.
+
install [options] <package>: Install a package
Options:
- -a installs all packages from all feeds or from the specified feed
- -p <feedname>: Prefer this feed when installing packages
- -d <y|m|n>: Set default for newly installed packages
+ -a : Install all packages from all feeds or from the specified feed using the -p option.
+ -p <feedname>: Prefer this feed when installing packages.
+ -d <y|m|n>: Set default for newly installed packages.
search [options] <substring>: Search for a package
Options:
-r <feedname>: Only search in this feed
uninstall -a|<package>: Uninstall a package
- -a uninstalls all packages
+ -a : Uninstalls all packages.
+
+ update: Update packages and lists of feeds in feeds.conf .
- update: Update packages and lists of feeds in feeds.list
- clean: Remove downloaded/generated files
+ clean: Remove downloaded/generated files.
EOF
exit(1);
@@ -360,6 +399,7 @@ my %update_method = (
);
my %commands = (
+ 'list' => \&list,
'update' => sub {
-d "feeds" or do {
mkdir "feeds" or die "Unable to create the feeds directory";