update the matrixify script and move it to bin
authorTimo Savola <tsavola@movial.fi>
Sun, 13 Apr 2008 12:47:58 +0000 (15:47 +0300)
committerTimo Savola <tsavola@movial.fi>
Mon, 14 Apr 2008 18:35:37 +0000 (21:35 +0300)
bin/matrixify [new file with mode: 0755]
scripts/matrixify.sh [deleted file]
setup.py

diff --git a/bin/matrixify b/bin/matrixify
new file mode 100755 (executable)
index 0000000..a5b5722
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+if [ x"$@" != x ]
+then
+       echo >&2 "Usage: $0"
+       exit 1
+fi
+
+if [ ! -d .git ]
+then
+       echo >&2 "Git repository not found"
+       echo >&2 "You must be in the working directory of the source repository"
+       exit 1
+fi
+
+if [ -d meta ]
+then
+       echo >&2 "Directory already exists: meta"
+       exit 1
+fi
+
+NAME="`basename $PWD`"
+if echo "$NAME" | grep -q "[^A-Za-z0-9-]"
+then
+       echo >&2 "Invalid component name: $NAME"
+       exit 1
+fi
+
+set -e
+
+mkdir meta
+cd meta
+
+echo -e 'MATRIX_BUILD_STYLE\t= autotools' > plug
+echo 'depends = ""' > $NAME.package
+echo '*.log' > .gitignore
+
+git init -q
+git add -- plug $NAME.package .gitignore
+
+echo
+echo "  - Go to the meta directory: $PWD"
+echo "  - Edit files: plug $NAME.package"
+echo "  - Run: git commit -a"
+echo
diff --git a/scripts/matrixify.sh b/scripts/matrixify.sh
deleted file mode 100755 (executable)
index bbc02e7..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -e
-
-branch="matrix"
-tag="$1"
-name="xorg-$(basename $PWD)"
-
-git checkout -b $branch $tag
-
-mkdir .matrix
-echo "MATRIX_BUILD_STYLE=autotools" > .matrix/plug
-echo "depends=\"@xorg-protos\"" > .matrix/$name.package
-echo "conflicts=\"\"" >> .matrix/$name.package
-echo "description=\"\"" >> .matrix/$name.package
-
-git add .matrix/plug .matrix/$name.package
-git commit -m "* matrixify"
-
-echo "{\"X/lib/$(basename $PWD)\", \"matrix\", repos .. \"/X/lib/$(basename $PWD)\"},"
index deb8e73..4407aef 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,11 @@ setup(
        version='1.0-pre',
        license='GPL',
        packages=['matrix'],
-       scripts=['bin/matrix', 'bin/matrix-graph'],
+       scripts=[
+               'bin/matrix',
+               'bin/matrix-graph',
+               'bin/matrixify',
+       ],
        data_files=[('share/scripts', glob('scripts/*.mk') +
                                      glob('scripts/*.sh'))],
 )