mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
git-srv-admin.sh update-descriptions: Use summary instead of description
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
e49702bd5a
commit
c1c38e1458
1 changed files with 9 additions and 1 deletions
|
|
@ -94,6 +94,13 @@ create_repo()
|
|||
git init --bare --shared=0640 || fatal "git init failed"
|
||||
}
|
||||
|
||||
read_project_metadata()
|
||||
{
|
||||
local pd="$1"
|
||||
local field="$2"
|
||||
git -C $pd show HEAD:make/project.conf | sed -n "/^\[$field\]/,/^\[/ p" | grep -v '\[' | cat -s | sed '${/^$/d;}'
|
||||
}
|
||||
|
||||
update_descriptions()
|
||||
{
|
||||
[ -d $pdir ] || return 0
|
||||
|
|
@ -106,7 +113,8 @@ update_descriptions()
|
|||
[ -d "$proj" ] || fatal "Failed to find project $pdir/$proj"
|
||||
local tmp=`mktemp /tmp/$myname-XXXXXXX`
|
||||
local descr=$proj/description
|
||||
git -C $proj show HEAD:make/project.conf | sed -n '/^\[description\]/,/^\[/ p' | grep -v '\[' | cat -s | sed '${/^$/d;}' > $tmp
|
||||
read_project_metadata $proj summary > $tmp
|
||||
[ -s "$tmp" ] || read_project_metadata $proj description > $tmp
|
||||
if [ -s "$tmp" ] && ! diff -q "$tmp" "$descr" >/dev/null 2>&1; then
|
||||
chown --reference=$proj $tmp
|
||||
chmod 640 $tmp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue