summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-08-20 00:18:13 +0100
committerColin Guthrie <colin@mageia.org>2013-08-20 00:40:57 +0100
commitda7c6bd49fa166417176dc9643814f796a8ea0e9 (patch)
treecc521ee8d258390318e6dc9f8f573bfeb0a5b675
parent518b3dd93ce12fd760fbc2b4a88ea1c6654af5a6 (diff)
downloadsvn-git-migration-da7c6bd49fa166417176dc9643814f796a8ea0e9.tar
svn-git-migration-da7c6bd49fa166417176dc9643814f796a8ea0e9.tar.gz
svn-git-migration-da7c6bd49fa166417176dc9643814f796a8ea0e9.tar.bz2
svn-git-migration-da7c6bd49fa166417176dc9643814f796a8ea0e9.tar.xz
svn-git-migration-da7c6bd49fa166417176dc9643814f796a8ea0e9.zip
Fix relative path handling for nested folders
-rwxr-xr-xscripts/mageia-reset-and-import.sh14
1 files 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