@@ -4,36 +4,16 @@ set -eu
44self=" $( basename " $BASH_SOURCE " ) "
55cd " $( dirname " $( readlink -f " $BASH_SOURCE " ) " ) "
66
7- # get the most recent commit which modified any of "$@"
8- fileCommit () {
9- git log -1 --format=' format:%H' HEAD -- " $@ "
10- }
11-
12- # get the most recent commit which modified "$1/Dockerfile" or any file COPY'd from "$1/Dockerfile"
13- dirCommit () {
14- local dir=" $1 " ; shift
15- (
16- cd " $dir "
17- fileCommit \
18- Dockerfile \
19- $( git show HEAD:./Dockerfile | awk '
20- toupper($1) == "COPY" {
21- for (i = 2; i < NF; i++) {
22- print $i
23- }
24- }
25- ' )
26- )
27- }
7+ commit=" $( git log -1 --format=' format:%H' HEAD -- ' [^.]*/**' ) "
288
29- generateCommit =" $( fileCommit " $self " ) "
9+ selfCommit =" $( git log -1 --format= ' format:%H ' HEAD -- " $self " ) "
3010cat << -EOH
31- # this file is generated via https://github.com/docker-library/hello-world/blob/$generateCommit /$self
11+ # this file is generated via https://github.com/docker-library/hello-world/blob/$selfCommit /$self
3212
3313Maintainers: Tianon Gravi <admwiggin@gmail.com> (@tianon),
3414 Joseph Ferguson <yosifkit@gmail.com> (@yosifkit)
3515GitRepo: https://github.com/docker-library/hello-world.git
36- GitCommit: $generateCommit
16+ GitCommit: $commit
3717EOH
3818
3919# prints "$2$1$3$1...$N"
@@ -53,11 +33,7 @@ cat <<-EOE
5333 Architectures: $( join ' , ' " ${arches[@]} " )
5434EOE
5535for arch in " ${arches[@]} " ; do
56- commit=" $( dirCommit " $arch " ) "
57- cat << -EOE
58- $arch -GitCommit: $commit
59- $arch -Directory: $arch
60- EOE
36+ echo " $arch -Directory: $arch "
6137done
6238
6339for winVariant in \
@@ -75,14 +51,8 @@ for winVariant in \
7551 Architectures: $( join ' , ' " ${winArches[@]/#/ windows-} " )
7652 EOE
7753 for arch in " ${winArches[@]} " ; do
78- commit=" $( dirCommit " $arch /$winVariant " ) "
79- cat << -EOE
80- windows-$arch -GitCommit: $commit
81- windows-$arch -Directory: $arch /$winVariant
82- EOE
54+ echo " windows-$arch -Directory: $arch /$winVariant "
8355 done
84- cat << -EOE
85- Constraints: $winVariant
86- EOE
56+ echo " Constraints: $winVariant "
8757 fi
8858done
0 commit comments