Revision 23503,
1.8 KB
checked in by geofft, 16 years ago
(diff) |
Merge debathena-gdm-config-athena10 into debathena-gdm-config.
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[22745] | 1 | #!/bin/sh |
---|
| 2 | |
---|
[22773] | 3 | # Usage: gen-packages [-c|-r] [LOCATION] |
---|
[22745] | 4 | |
---|
[22773] | 5 | # Scans the repository or a checkout of it and generates a file named |
---|
| 6 | # "packages" in the current directory containing a table of source |
---|
| 7 | # package names and their corresponding directories. Scanning a |
---|
| 8 | # checkout is much faster, but relies on the checkout being |
---|
| 9 | # sufficiently up to date. |
---|
[22745] | 10 | |
---|
[22773] | 11 | # If -c is specified, scans a checkout. If -r is specified, scans the |
---|
| 12 | # repository. -r is the default. |
---|
[22745] | 13 | |
---|
[22773] | 14 | # If LOCATION is specified, it is used in preference to the canonical |
---|
| 15 | # Athena repository trunk or the canonical source checkout. |
---|
| 16 | |
---|
[22745] | 17 | set -e |
---|
| 18 | |
---|
| 19 | die() { |
---|
| 20 | echo "$@" >&2 |
---|
| 21 | exit 1 |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | usage() { |
---|
[22773] | 25 | die "gen-packages [-r|-c] [LOCATION]" |
---|
[22745] | 26 | } |
---|
| 27 | |
---|
[22773] | 28 | type=repos |
---|
[22745] | 29 | |
---|
[22773] | 30 | while getopts cr opt; do |
---|
[22745] | 31 | case "$opt" in |
---|
[22773] | 32 | c) |
---|
| 33 | type=checkout |
---|
| 34 | ;; |
---|
[22745] | 35 | r) |
---|
[22773] | 36 | type=repos |
---|
[22745] | 37 | ;; |
---|
| 38 | \?) |
---|
| 39 | usage |
---|
| 40 | ;; |
---|
| 41 | esac |
---|
| 42 | done |
---|
| 43 | |
---|
[22773] | 44 | shift $(($OPTIND - 1)) |
---|
| 45 | if [ $# -gt 0 ]; then |
---|
| 46 | loc=$1 |
---|
| 47 | elif [ $type = repos ]; then |
---|
| 48 | loc=svn+ssh://svn.mit.edu/athena/trunk |
---|
| 49 | else |
---|
| 50 | loc=/afs/dev.mit.edu/source/src-svn |
---|
| 51 | fi |
---|
| 52 | |
---|
[22745] | 53 | rm -f packages.unsorted |
---|
[22773] | 54 | echo "Scanning file list of $loc" |
---|
| 55 | if [ $type = repos ]; then |
---|
[23436] | 56 | for cf in $(svn ls -R $loc | egrep 'debian/control(\.in)*$'); do |
---|
[22773] | 57 | echo "Reading $cf" |
---|
| 58 | name=$(svn cat $loc/$cf | sed -ne 's/^Source: \(.*\)$/\1/p') |
---|
[23436] | 59 | dir=${cf%.in} |
---|
[23445] | 60 | dir=${dir%/debian/control} |
---|
[22773] | 61 | printf "%-35s %s\n" $name $dir >> packages.unsorted |
---|
| 62 | done |
---|
| 63 | else |
---|
[23436] | 64 | for cf in $(cd $loc && find | egrep 'debian/control(\.in)*$' \ |
---|
| 65 | | sed -ne 's/^\.\///p'); do |
---|
[22773] | 66 | echo "Reading $cf" |
---|
| 67 | name=$(sed -ne 's/^Source: \(.*\)$/\1/p' $loc/$cf) |
---|
[23436] | 68 | dir=${cf%.in} |
---|
[23445] | 69 | dir=${dir%/debian/control} |
---|
[22773] | 70 | printf "%-35s %s\n" $name $dir >> packages.unsorted |
---|
| 71 | done |
---|
| 72 | fi |
---|
[22950] | 73 | |
---|
| 74 | # cyrus-sasl2-mit has a debian dir but is really a debathenify package. |
---|
[23087] | 75 | # config-package dev has some example packages we want to filter out. |
---|
[23503] | 76 | sort -u packages.unsorted | egrep -v "cyrus-sasl2-mit|/examples/" > packages |
---|
[22745] | 77 | rm -f packages.unsorted |
---|
Note: See
TracBrowser
for help on using the repository browser.