Last active
November 5, 2019 21:56
-
-
Save amiad/d9876a004c3e836a69a7 to your computer and use it in GitHub Desktop.
Revisions
-
amiad revised this gist
Jun 9, 2015 . 1 changed file with 31 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,42 @@ #!/bin/bash function help_script(){ echo 'argument is missed' echo 'Usage:' echo './import-to.aur4.sh -l "pack1 pack2 pack3"' echo 'or' echo './import-to.aur4.sh -u username' exit } if [[ -z $1 ]]; then help_script fi while getopts ":l:u:" o; do case "${o}" in l) list=$OPTARG ;; u) results=$(curl "https://aur.archlinux.org/rpc.php?type=msearch&arg=$OPTARG") list=$(echo $results | grep -Po '"Name":.*?[^\\],' | cut -d'"' -f4) if [[ ! $list ]]; then echo 'This user has no packages'; exit; fi ;; \?) help_script ;; esac done mkdir aur4 cd aur4 for package in $list; do git clone ssh://[email protected]/$package.git prefix=$(echo $package | cut -c1-2) -
amiad created this gist
Jun 8, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ #!/bin/bash if [[ -z $1 ]]; then echo 'packages list is missed' echo 'run ./import-to-aur4.sh "pack1 pack2 pack3"' exit fi mkdir aur4 cd aur4 for package in $1; do git clone ssh://[email protected]/$package.git prefix=$(echo $package | cut -c1-2) wget "https://aur.archlinux.org/packages/$prefix/$package/$package.tar.gz" tar xzf $package.tar.gz rm -rf $package.tar.gz cd $package mksrcinfo git add . git commit -m "Initial import" git push origin master cd .. done cd .. echo "Import finished"