]> git.ozlabs.org Git - next-scripts/blobdiff - make_tree_file
make_tree_file: do some tidying up
[next-scripts] / make_tree_file
index d434ab11da31c3b7642533fdb59348ede9ec699f..195fb2c640984e584ffb2641e2bda5af67c8e150 100755 (executable)
@@ -27,22 +27,23 @@ n="next-$d"
 
 mkdir Next
 
-echo 'Trees included into this release:
-
-Name           Type    URL
-----           ----    ---' > Next/Trees
-
 (
-IFS='  '
-while read email type name url ref build; do
-       [[ "$email" =~ '^#.*$' ]] && continue
-       tab="\t"
-       [ $(echo "$name" | wc -c) -le 8 ] && tab="\t\t"
-       [ "${ref%:*}" = "${ref}" ] || ref=${ref##*:}
-       [ "$type" = "git" ] && url="$url#$ref"
-       printf "%s$tab%s\t%s\n" $name $type $url >>Next/Trees
-done <$CTRL_FILE
-)
+       cat <<-'EOF'
+       Trees included into this release:
+
+       Name            Type    URL
+       ----            ----    ---
+       EOF
+
+       IFS='   '
+       grep -v '^#' $CTRL_FILE |
+               while read email type name url ref build; do
+                       tab="\t"
+                       [ ${#name} -le 8 ] && tab="\t\t"
+                       [ "$type" = "git" ] && url="$url#${ref##*:}"
+                       printf "%s$tab%s\t%s\n" $name $type $url
+               done
+) >Next/Trees
 
 mv ../SHA1s Next/SHA1s
 
@@ -61,14 +62,11 @@ git branch -f stable refs/remotes/origin/master
 p="patch-$l-$n"
 git diff-tree -p "$l.." >"../$p"
 gpg2 -u 41D5C07A -a -b "../$p"
-#echo "$l" > "../LATEST-IS-$n"
-
-"$bin_dir/make_abat_scripts" "$d" "$l"
 
 oldest=$(date --date "3 months ago" '+%Y%m%d')
 echo "Removing old releases ... <= next-$oldest"
 
-old_tags=$(git ls-remote --tags korg next-\* |
+old_tags=$(git ls-remote --tags korg 'next-*[0-9]' |
        awk -F - '$2 ~ /^[0-9]*$/ && $2 <= '$oldest' { printf("next-%s\n", $2); }')
 
 [ "$old_tags" ] && git push korg --delete $old_tags