Fix for repositories with duplicate names/identifiers.
This commit is contained in:
parent
8d54ced76b
commit
066e42523e
|
@ -68,7 +68,7 @@ for v in $CHILI_ID_GITORIOUS_REPO; do
|
|||
# Test for already present repo
|
||||
ALREADY_EXIST=`mysql -h$MYSQL_HOSTNAME -u $MYSQL_USER -e "SELECT id
|
||||
FROM $CHILI_MYSQL_DBNAME.repositories
|
||||
WHERE project_id=$chili_project_id
|
||||
WHERE project_id='$chili_project_id'
|
||||
OR url='$gitorious_path'
|
||||
OR root_url='$gitorious_path'" \
|
||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||
|
|
|
@ -73,7 +73,7 @@ for i in `seq 0 $((nrepos-1))`; do
|
|||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||
[ "$USERID" == "" ] && continue
|
||||
|
||||
PROJECTID=`mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT id FROM $CHILI_MYSQL_DBNAME.projects
|
||||
PROJECTID=`mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT DISTINCT id FROM $CHILI_MYSQL_DBNAME.projects
|
||||
WHERE (name='${repos_names[$i]}'
|
||||
OR identifier='${repos_names[$i]}')
|
||||
AND status='1'" \
|
||||
|
@ -82,7 +82,7 @@ for i in `seq 0 $((nrepos-1))`; do
|
|||
|
||||
ALREADY_EXIST=`mysql -h$CHILI_MYSQL_HOSTNAME -u $CHILI_MYSQL_USER -e "SELECT id
|
||||
FROM $CHILI_MYSQL_DBNAME.repositories
|
||||
WHERE project_id=$PROJECTID
|
||||
WHERE project_id='$PROJECTID'
|
||||
OR url='${repos_paths[$i]}'
|
||||
OR root_url='${repos_paths[$i]}'" \
|
||||
| grep -v tables_col|xargs|sed "s/ /\n/g"|tail -n+2`
|
||||
|
|
Loading…
Reference in New Issue