1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
#! /bin/sh
## Copyright (C) 2004 Aaron Bentley
##
## See the file "COPYING" for further information about
## the copyright and warranty status of this work.
. "$abadir/aba-lib"
# this command works by attempting to remove revisions. Any revision that
# cannot be removed without producing conflicts is a dependency.
# executes the command ("$@" are the arguments after the command name)
cmd_exec()
{
cd $abadir
gooddir=$abadir/gooddir
testdir=$abadir/testdir
rm -Rf $gooddir
rm -Rf $testdir
version="$(tla parse-package-name -a $1)/$(tla parse-package-name --package-version $1)"
supplied="$version--$(tla parse-package-name -l $1)"
tla get $supplied $gooddir > /dev/null
cp -a $gooddir testdir
patches=$(tla logs --reverse --dir $gooddir)
for patch in $patches;
do
revision="$version--$patch"
if [ $revision = $supplied ]; then
# echo "skipping: $patch"
echo -n
elif tla replay --dir $testdir --reverse "$version--$patch" > /dev/null 2>/dev/null; then
# echo "not required: $patch"
tla replay --dir $gooddir --reverse "$version--$patch" > /dev/null;
else
# echo "required: $patch"
required="$required $patch"
rm -Rf $testdir
cp -a $gooddir testdir
fi
done
rm -Rf $gooddir
rm -Rf $testdir
# echo Required revisions:
oneperline $required|sort -t - -k 2 -n
}
oneperline()
{
for l in $@; do
echo $l
done
}
# one-liner description for aba help
cmd_desc()
{
aba_desc $(basename $0) "Determines a revision's dependencies"
}
# short help for aba command -h, --help
cmd_help()
{
cat <<EOH
determines a revision's dependencies
usage: $abaname $(basename $0) revision
Determines the textual dependencies of a revision by removing everything which
can be removed without producing conflicts.
EOH
}
# extended help for aba command -H or aba help command
cmd_ext_help()
{
cat <<EOH
The guarantee provided by this command is that list of patches can be applied
to the base revision without producing conflicts. No guarantee can be provided
that the resulting tree is usable.
EOH
}
aba_run "$@"
# arch-tag: rev-depends by Aaron Bentley (16:53 Feb 15 2004)
|