summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/mageia-import.sh21
1 files changed, 11 insertions, 10 deletions
diff --git a/scripts/mageia-import.sh b/scripts/mageia-import.sh
index dc49f4b..048ea63 100755
--- a/scripts/mageia-import.sh
+++ b/scripts/mageia-import.sh
@@ -8,14 +8,15 @@ if [ -z $SOFTWARE ]; then
echo "Missing software to convert..."
exit 1
fi
+BASESOFTWARE=$(basename $SOFTWARE)
-if [ -d $SOFTWARE-origin ]; then
- echo "It seems the svn-git repository already exists ($SOFTWARE-origin)"
+if [ -d $BASESOFTWARE-origin ]; then
+ echo "It seems the svn-git repository already exists ($BASESOFTWARE-origin)"
exit 1
fi
-if [ -d $SOFTWARE.git ]; then
- echo "It seems the converted git repository already exists ($SOFTWARE.git)"
+if [ -d $BASESOFTWARE.git ]; then
+ echo "It seems the converted git repository already exists ($BASESOFTWARE.git)"
exit 1
fi
@@ -35,8 +36,8 @@ echo "Identified software name: $SOFTWARE"
echo "SVN Revisions to skip: $skiprevisions"
echo
-git svn init $NEWSVNURL/$SOFTWARE --no-metadata --stdlayout $SOFTWARE-origin
-cd $SOFTWARE-origin
+git svn init $NEWSVNURL/$SOFTWARE --no-metadata --stdlayout $BASESOFTWARE-origin
+cd $BASESOFTWARE-origin
revision=0
if [ -n "$skiprevisions" ]; then
for rev in $skiprevisions; do
@@ -52,13 +53,13 @@ echo "done"
echo
echo "Now creating bare git repository"
-git init --bare ../$SOFTWARE.git
+git init --bare ../$BASESOFTWARE.git
git remote rm origin
-git remote add origin ../$SOFTWARE.git
+git remote add origin ../$BASESOFTWARE.git
#git push --set-upstream master
git push origin master 'refs/remotes/*:refs/heads/*'
-pushd ../$SOFTWARE.git
+pushd ../$BASESOFTWARE.git
git branch -D trunk
git branch -D origin/master 2>/dev/null
@@ -199,7 +200,7 @@ parsesvnrevmap()
echo
echo -n "Creating revision -> sha1 map SQL... "
-sql="../$SOFTWARE-revmap.sql"
+sql="../$BASESOFTWARE-revmap.sql"
rm -f "$sql" "$sql".xz
# Mageia commits