Changeset 457
- Timestamp:
- 01/31/08 20:59:40 (8 months ago)
- Files:
-
- firmware/trunk/kamikaze/scripts/feeds (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
firmware/trunk/kamikaze/scripts/feeds
r454 r457 143 143 } 144 144 145 146 145 sub search { 147 146 my %opts; … … 151 150 search_feed($feed->[1], @ARGV) if (!defined($opts{r}) or $opts{r} eq $feed->[1]); 152 151 } 152 } 153 154 sub list_feed { 155 my $feed = shift; 156 157 get_feed($feed); 158 foreach my $name (sort { lc($a) cmp lc($b) } keys %package) { 159 my $pkg = $package{$name}; 160 if($pkg->{name}) { 161 printf "\%-32s\t\%s\n", $pkg->{name}, $pkg->{title}; 162 } 163 } 164 165 return 0; 166 } 167 168 sub list { 169 my %opts; 170 171 getopts('r:sh', \%opts); 172 if ($opts{h}) { 173 usage(); 174 return 0; 175 } 176 if ($opts{s}) { 177 foreach my $feed (@feeds) { 178 printf "\%-32s\tURL: %s\n", $feed->[1], $feed->[2]; 179 } 180 return 0; 181 } 182 foreach my $feed (@feeds) { 183 list_feed($feed->[1], @ARGV) if (!defined($opts{r}) or $opts{r} eq $feed->[1]); 184 } 185 return 0; 153 186 } 154 187 … … 333 366 334 367 Commands: 368 list [options]: List feeds and their content 369 Options: 370 -s : List of feed names and their URL. 371 -r <feedname>: List packages of specified feed. 372 335 373 install [options] <package>: Install a package 336 374 Options: 337 -a installs all packages from all feeds or from the specified feed338 -p <feedname>: Prefer this feed when installing packages 339 -d <y|m|n>: Set default for newly installed packages 375 -a : Install all packages from all feeds or from the specified feed using the -p option. 376 -p <feedname>: Prefer this feed when installing packages. 377 -d <y|m|n>: Set default for newly installed packages. 340 378 341 379 search [options] <substring>: Search for a package … … 344 382 345 383 uninstall -a|<package>: Uninstall a package 346 -a uninstalls all packages 347 348 update: Update packages and lists of feeds in feeds.list 349 clean: Remove downloaded/generated files 384 -a : Uninstalls all packages. 385 386 update: Update packages and lists of feeds in feeds.conf . 387 388 clean: Remove downloaded/generated files. 350 389 351 390 EOF … … 361 400 362 401 my %commands = ( 402 'list' => \&list, 363 403 'update' => sub { 364 404 -d "feeds" or do {
