Skip to content

Instantly share code, notes, and snippets.

@ShadowKyogre
Forked from amiad/import-to-aur4.sh
Last active August 29, 2015 14:22
Show Gist options
  • Save ShadowKyogre/a38ac983350a76078309 to your computer and use it in GitHub Desktop.
Save ShadowKyogre/a38ac983350a76078309 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ -z $@ ]]; then
echo 'packages list is missed'
echo 'run ./import-to-aur4.sh pack1 pack2 pack3'
exit
fi
mkdir aur4
cd aur4
for package in $@; do
prefix=$(echo $package | cut -c1-2)
wget "https://aur.archlinux.org/packages/$prefix/$package/$package.tar.gz"
tar xzf $package.tar.gz
rm -f $package.tar.gz
cd $package
mksrcinfo
git init
git add .
git commit -m "Initial import"
git remote add origin "ssh://aur@aur4.archlinux.org/$package.git"
git push origin master
cd ..
done
cd ..
echo "Import finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment