FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 05-09-2008, 03:30 AM
Allan McRae
 
Default contrib/paclist - list packages installed from given repo

The paclist script provides a simple method for monitoring
which packages are installed from a given repo. This is
particularly useful when using a testing or unstable repository.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
---
contrib/paclist | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ +
1 files changed, 51 insertions(+), 0 deletions(-)
create mode 100644 contrib/paclist

diff --git a/contrib/paclist b/contrib/paclist
new file mode 100644
index 0000000..87592a5
--- /dev/null
+++ b/contrib/paclist
@@ -0,0 +1,51 @@
+#!/bin/bash
+# paclist - List all packages installed from a given repo
+#
+# Copyright (C) 2008 Allan McRae <mcrae_allan@hotmail.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+readonly progname="paclist"
+readonly version="1.0"
+
+if [ -z "$1" -o "$1" = "--help" -o "$1" = "-h" ]; then
+ echo "$progname - List all packages installed from a given repo"
+ echo "Usage: $progname <repo>"
+ echo "Example: $progname testing"
+ exit 0
+fi
+
+if [ "$1" = "--version" -o "$1" = "-v" ]; then
+ echo "$progname version $version"
+ echo "Copyright (C) 2008 Allan McRae"
+ exit 0
+fi
+
+pkglist=$(mktemp)
+ret=0
+pacman -Sl $1 > $pkglist || ret=$?
+if [ $ret -ne 0 ]; then
+ exit 1
+fi
+
+pacman -Q | while read pkg; do
+ ret=0
+ grep -q "$pkg" $pkglist || ret=$?
+ if [ $ret -eq 0 ]; then
+ echo $pkg
+ fi
+done
+
+rm $pkglist
--
1.5.5.1


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-09-2008, 12:48 PM
Allan McRae
 
Default contrib/paclist - list packages installed from given repo

The paclist script provides a simple method for monitoring
which packages are installed from a given repo. This is
particularly useful when using a testing or unstable repository.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
---
contrib/paclist | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ ++
1 files changed, 52 insertions(+), 0 deletions(-)
create mode 100755 contrib/paclist

diff --git a/contrib/paclist b/contrib/paclist
new file mode 100755
index 0000000..95d2d13
--- /dev/null
+++ b/contrib/paclist
@@ -0,0 +1,52 @@
+#!/bin/bash
+# paclist - List all packages installed from a given repo
+#
+# Copyright (C) 2008 Allan McRae <mcrae_allan@hotmail.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+readonly progname="paclist"
+readonly version="1.0"
+
+if [ -z "$1" -o "$1" = "--help" -o "$1" = "-h" ]; then
+ echo "$progname - List all packages installed from a given repo"
+ echo "Usage: $progname <repo>"
+ echo "Example: $progname testing"
+ exit 0
+fi
+
+if [ "$1" = "--version" -o "$1" = "-v" ]; then
+ echo "$progname version $version"
+ echo "Copyright (C) 2008 Allan McRae"
+ exit 0
+fi
+
+pkglist=$(mktemp)
+ret=0
+pacman -Sl $1 > $pkglist || ret=$?
+if [ $ret -ne 0 ]; then
+ rm $pkglist
+ exit 1
+fi
+
+pacman -Q | while read pkg; do
+ ret=0
+ grep -q "$pkg" $pkglist || ret=$?
+ if [ $ret -eq 0 ]; then
+ echo $pkg
+ fi
+done
+
+rm $pkglist
--
1.5.5.1


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-09-2008, 12:56 PM
Allan McRae
 
Default contrib/paclist - list packages installed from given repo

I have made a couple of additional changes apart from what Dan
suggested. I also made the indentation consistent and adjusted the
permissions of the script file.

As an aside, git-send-email is finally working for me!

Allan




_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 10:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org