From da7c6bd49fa166417176dc9643814f796a8ea0e9 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Tue, 20 Aug 2013 00:18:13 +0100 Subject: Fix relative path handling for nested folders --- scripts/mageia-reset-and-import.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/mageia-reset-and-import.sh b/scripts/mageia-reset-and-import.sh index e4bf524..33f1c1b 100755 --- a/scripts/mageia-reset-and-import.sh +++ b/scripts/mageia-reset-and-import.sh @@ -17,8 +17,8 @@ if [ -z "$SOFTWARE" ]; then exit 1 fi -if [ -d ../$SOFTWARE.git ]; then - echo "It seems the converted git repository already exists (../$SOFTWARE.git)" >&2 +if [ -d ../$(basename $SOFTWARE).git ]; then + echo "It seems the converted git repository already exists (../$(basename $SOFTWARE).git)" >&2 exit 1 fi @@ -222,7 +222,7 @@ find . -depth -not -iwholename '.' -not -iwholename "./.git" -not -iwholename ". # We have to create a subversion repository here for the import as we need a repository # for the svn merging below... svn sucks. -SVNPATH=$(realpath ../$SOFTWARE.svn) +SVNPATH=$(realpath ../$(basename $SOFTWARE).svn) rm -rf $SVNPATH mkdir -p $SVNPATH/export cd $SVNPATH/export @@ -347,13 +347,13 @@ echo "done" echo echo "Now creating bare git repository" -git init --bare ../$SOFTWARE.git +git init --bare ../$(basename $SOFTWARE).git git remote rm origin -git remote add origin ../$SOFTWARE.git +git remote add origin ../$(basename $SOFTWARE).git #git push --set-upstream master git push origin master 'refs/remotes/*:refs/heads/*' -pushd ../$SOFTWARE.git +pushd ../$(basename $SOFTWARE).git git branch -D trunk git branch -D origin/master 2>/dev/null @@ -494,7 +494,7 @@ parsesvnrevmap() echo echo -n "Creating revision -> sha1 map SQL... " -sql="../$SOFTWARE-revmap.sql" +sql="../$(basename $SOFTWARE)-revmap.sql" rm -f "$sql" "$sql".xz # First to the old (i.e. mdv) ones -- cgit v1.2.1