updated on Tue Jan 17 12:00:36 UTC 2012
[aur-mirror.git] / pactools / pt-repolist
blob5f15fe462ca84082508d36ff9ef2b2d6a9b3300f
1 #!/bin/sh
3 pacman -Qi >./all_files
5 if [ -z "$1" ] ; then
6 echo -e "\033[0;37mNo repo given!"
7 echo " usage: scriptname reponame"
8 fi
10 reponame=$1
11 list=$1_list
12 pacman -Sl $reponame >./$list
13 sed -i "s|\$reponame |g|" ./$list
14 repo=`cat ./$list | cut --fields 2 --delim " "`
16 for pkg in $repo ; do
17 if [[ $(cat ./all_files | grep -w "$pkg") ]] ; then
18 echo -e "\033[0;34m$pkg\033[0;37m is installed"
19 echo "$pkg" >>./installed_files
20 elif [ "$2" == "all" ] ; then
21 echo -e "\033[0;31m$pkg\033[0;37m is NOT installed"
23 done
25 echo
26 echo -n "Would you like to save the names of these pkgs to a file? (Y/n) "
27 read choice
28 if [ "$choice" == "Y" -o "$choice" == "y" ] ; then
29 echo "Currently in `pwd`"
30 echo -n " Save as: "
31 read filename
32 if [ -z $filename ] ; then
33 echo "No name given saved as ./installed_files_$reponame"
34 cp -u ./installed_files ./installed_files_$reponame
35 else
36 cp -u ./installed_files $filename
38 rm ./installed_files
39 else
40 rm ./installed_files
42 rm ./$list ./all_files