~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to fai/aba/commands/package-versions

  • Committer: Aaron Bentley
  • Date: 2005-06-07 18:52:04 UTC
  • Revision ID: abentley@panoramicfeedback.com-20050607185204-5fc1f0e3d393b909
Added NEWS, obsoleted bzr-pull

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
## Copyright (C) 2004 Aaron Bentley
3
 
##
4
 
## See the file "COPYING" for further information about
5
 
## the copyright and warranty status of this work.
6
 
 
7
 
. "$abadir/aba-lib"
8
 
 
9
 
# executes the command ($* are the arguments after the command name)
10
 
cmd_exec()
11
 
{
12
 
  options="library full revisions"
13
 
  . "$abadir/getopt"
14
 
  if [ -n "$library" ]; then
15
 
    library="--library"
16
 
    vercmd="library-versions"
17
 
  else
18
 
    vercmd="versions"
19
 
  fi
20
 
  if [ -n "$1" ]; then
21
 
    archive="$1/";
22
 
  else
23
 
    archive="";
24
 
  fi
25
 
  if [ -n "$full" ]; then
26
 
    prefix="$archive"
27
 
  fi
28
 
 
29
 
  for cat in `aba packages $library $1`; do
30
 
    for packageversion in $(tla $vercmd $archive$cat); do
31
 
      if [ -z "$revisions" ]; then
32
 
        echo $prefix$packageversion
33
 
      else
34
 
        if [ -n "$(tla library-revisions $archive$packageversion)" ]; then
35
 
          echo $prefix$packageversion
36
 
        fi
37
 
      fi
38
 
    done;
39
 
  done;
40
 
}
41
 
 
42
 
# one-liner description for aba help
43
 
cmd_desc()
44
 
{
45
 
   aba_desc package-versions Lists all package versions in an archive 
46
 
}
47
 
 
48
 
# short help for aba command -h, --help
49
 
cmd_help()
50
 
{
51
 
   cat <<EOT
52
 
usage: aba package-versions [archive]
53
 
 
54
 
  --library         search revision libraries instead of archives
55
 
  --full            show the full version name
56
 
  --revisions       show only versions that have revisions in the library
57
 
 
58
 
List all the package versions in the given archive.  Defaults to 
59
 
my-default-archive.
60
 
 
61
 
EOT
62
 
}
63
 
 
64
 
# extended help for aba command -H or aba help command
65
 
cmd_ext_help()
66
 
{
67
 
   echo -n
68
 
}       
69
 
 
70
 
aba_run "$@"
71
 
# arch-tag: package-versions by Aaron Bentley  (12:03 Feb 10 2004)