Blob Blame History Raw
#!/bin/sh
pkg=$1
[ -n "$1" ] || exit 1
first=$(echo $pkg | cut -c1)
p=packages/$first/$pkg
if ! test -d $p ; then # handle lib*
    first=$(echo $pkg | cut -c1-4)
    p=packages/$first/$pkg
fi
test -d $p || exit 2
rm -rf $p
git rm $p
git commit -m "Drop $pkg submodule"
git subtree add -P $p https://code.opensuse.org/package/$pkg master
#grep '"$pkg"' /home/opensuserabbit/dumprabbit.json | tail -1 | scripts/rabbithandle-single.py
#scripts/splitone2 "$pkg"
#(cd /data/openSUSE-test/$p/ && rm -rf $p && git pull )
if [ -e /data/openSUSE-test/$p/.git ] ; then
    cp -a /data/openSUSE-test/$p/.git $p/
else
    rm -rf $p
    git clone https://code.opensuse.org/package/$pkg.git $p
fi