summaryrefslogtreecommitdiff
path: root/pcr/pactools/pt-repolist
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2012-11-22 13:03:18 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2012-11-22 13:03:18 -0300
commitba0b8906199404b7b00cfeac91bff3036b8692e8 (patch)
tree77d6dbaf822d1a66046f76c6698ec9d0f61a9bcd /pcr/pactools/pt-repolist
parentadc549e8519824da803230cee62bfd7d808df989 (diff)
parentf97ff910471fb3ae2c8ea69befecaae8cbf6dbea (diff)
downloadabslibre-ba0b8906199404b7b00cfeac91bff3036b8692e8.tar.gz
abslibre-ba0b8906199404b7b00cfeac91bff3036b8692e8.tar.bz2
abslibre-ba0b8906199404b7b00cfeac91bff3036b8692e8.zip
Merge branch 'master' of ssh://gparabola/srv/git/abslibre
Diffstat (limited to 'pcr/pactools/pt-repolist')
-rwxr-xr-xpcr/pactools/pt-repolist42
1 files changed, 42 insertions, 0 deletions
diff --git a/pcr/pactools/pt-repolist b/pcr/pactools/pt-repolist
new file mode 100755
index 000000000..5f15fe462
--- /dev/null
+++ b/pcr/pactools/pt-repolist
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+pacman -Qi >./all_files
+
+if [ -z "$1" ] ; then
+ echo -e "\033[0;37mNo repo given!"
+ echo " usage: scriptname reponame"
+fi
+
+reponame=$1
+list=$1_list
+pacman -Sl $reponame >./$list
+sed -i "s|\$reponame |g|" ./$list
+repo=`cat ./$list | cut --fields 2 --delim " "`
+
+for pkg in $repo ; do
+ if [[ $(cat ./all_files | grep -w "$pkg") ]] ; then
+ echo -e "\033[0;34m$pkg\033[0;37m is installed"
+ echo "$pkg" >>./installed_files
+ elif [ "$2" == "all" ] ; then
+ echo -e "\033[0;31m$pkg\033[0;37m is NOT installed"
+ fi
+done
+
+echo
+echo -n "Would you like to save the names of these pkgs to a file? (Y/n) "
+read choice
+if [ "$choice" == "Y" -o "$choice" == "y" ] ; then
+ echo "Currently in `pwd`"
+ echo -n " Save as: "
+ read filename
+ if [ -z $filename ] ; then
+ echo "No name given saved as ./installed_files_$reponame"
+ cp -u ./installed_files ./installed_files_$reponame
+ else
+ cp -u ./installed_files $filename
+ fi
+ rm ./installed_files
+else
+ rm ./installed_files
+fi
+rm ./$list ./all_files