aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2006-10-14 11:30:03 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2006-10-14 11:30:03 +0000
commit7c417b97c38158a7b0d4978bbb6f28174cc9aee3 (patch)
treefeb356ced11097fb9d077c6d4dc5ae59e72aeabb
parent359f9fde359245fd4ed8168dd3deb5deae86ff2a (diff)
downloadsimplepkg-7c417b97c38158a7b0d4978bbb6f28174cc9aee3.tar.gz
simplepkg-7c417b97c38158a7b0d4978bbb6f28174cc9aee3.tar.bz2
some updates; see CHANGELOG for details
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@17 04377dda-e619-0410-9926-eae83683ac58
-rw-r--r--doc/CHANGELOG4
-rwxr-xr-xsrc/lspkg64
-rwxr-xr-xsrc/mkjail2
-rwxr-xr-xsrc/rebuildpkg16
-rwxr-xr-xsrc/simplaret4
5 files changed, 59 insertions, 31 deletions
diff --git a/doc/CHANGELOG b/doc/CHANGELOG
index a8858e3..d143b1f 100644
--- a/doc/CHANGELOG
+++ b/doc/CHANGELOG
@@ -1,6 +1,10 @@
simplepkg changelog
-------------------
+20061013 - small fixes on rebuildpkg
+ lspkg enhancements
+ simplaret fix on --purge
+
0.4.9pre5: added script "repos"
moved simplaret to /usr/bin
diff --git a/src/lspkg b/src/lspkg
index 0eb5e77..e3add47 100755
--- a/src/lspkg
+++ b/src/lspkg
@@ -1,7 +1,6 @@
#!/bin/bash
#
-# lspkg v0.2: view installed and contents of
-# slackware packages
+# lspkg v0.3: view installed and contents of slackware packages
#
# feedback: rhatto at riseup.net | gpl
#
@@ -17,25 +16,33 @@
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA
#
-#
-# -v, --view: view installed package contents
-# -p, --print: print the contents of a package file
-# -r, --remove: remove matching packages
-# -s, --search: search a file under installed packages
-#
-# todo:
-#
-# -d, --description: show matching packages' descriptions
-# -h, --help: show usage
-#
-function usage {
- echo "usage: $0 [-v|-d|-s|-p expression]"
+COMMON="/usr/libexec/simplepkg/common.sh"
+
+if [ -f "$COMMON" ]; then
+ source $COMMON
+else
+ echo "error: file $COMMON found, check your `basename $0` installation"
exit 1
+fi
+
+function usage {
+ echo "usage: `basename $0` [option expression]"
}
-if [[ "$1" = "-v" ]]; then
- if [[ ! -z "$2" ]]; then
+if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
+ usage
+ echo "
+options are:
+
+ -v, --view: view installed package contents
+ -p, --print: print the contents of a package file
+ -r, --remove: remove matching packages
+ -s, --search: search a file under installed packages
+ -d, --description: show matching packages' descriptions
+"
+elif [ "$1" == "-v" ] || [ "$1" == "--view" ] ; then
+ if [ ! -z "$2" ]; then
if $(ls /var/log/packages/$2* &> /dev/null); then
for file in $(ls /var/log/packages/$2*); do
less $file
@@ -44,22 +51,35 @@ if [[ "$1" = "-v" ]]; then
fi
else
usage
+ exit 1
fi
-elif [[ "$1" = "-p" ]]; then
- if [ -f $2 ]; then
+elif [ "$1" == "-p" ] && [ "$1" == "--print" ]; then
+ if [ -f "$2" ]; then
tar ztvf $2
else echo $2: file not found
fi
-elif [[ "$1" == "-r" ]]; then
+elif [ "$1" == "-r" ] && [ "$1" == "--remove" ]; then
if [ ! -z "$2" ]; then
if `ls /var/log/packages/$1* &> /dev/null`; then
removepkg /var/log/packages/$1*
fi
fi
-elif [[ "$1" == "-s" ]]; then
- if [[ ! -z "$2" ]]; then
+elif [ "$1" == "-s" ] || [ "$1" == "--search" ]; then
+ if [ ! -z "$2" ]; then
grep $2 /var/log/packages/*
fi
+elif [ "$1" == "-d" ] || [ "$1" == "--description" ]; then
+ if [ ! -z "$1" ]; then
+ for file in `lspkg $2`; do
+ name="`package_name $file.tgz`"
+ echo "package description for $name:"
+ echo ""
+ grep -e "^$name:" $file | sed -e "s/^$name:/ /"
+ done
+ else
+ usage
+ exit 1
+ fi
else
if `ls /var/log/packages/$1* &> /dev/null`; then
ls /var/log/packages/$1*
diff --git a/src/mkjail b/src/mkjail
index d0d24a0..509bde3 100755
--- a/src/mkjail
+++ b/src/mkjail
@@ -63,7 +63,7 @@ elif [[ -z "$2" && -f "$BASE_CONF/default.template" ]]; then
TEMPLATE="$BASE_CONF/default.template"
echo using default template
else
- echo $0 error: no templates found
+ echo `basename $0` error: no templates found
echo please create a template using templatepkg
exit 1
fi
diff --git a/src/rebuildpkg b/src/rebuildpkg
index 43c76cd..6d3d10c 100755
--- a/src/rebuildpkg
+++ b/src/rebuildpkg
@@ -38,7 +38,7 @@ fi
pack="$1"
-for file in `find $ROOT/var/log/packages -name $pack*`; do
+for file in `ls $ROOT/var/log/packages/$pack*`; do
if [[ "`package_name $file.tgz`" == "$pack" ]]; then
package_file="$file"
break
@@ -47,6 +47,7 @@ done
if [ -z "$package_file" ]; then
echo error: package $pack does not exist
+ exit 1
fi
if [ -d "$TMP/package-$pack" ]; then
@@ -60,11 +61,14 @@ for file in `grep -v -e "^PACKAGE NAME:" -e "^UNCOMPRESSED PACKAGE SIZE:" \
-e "^COMPRESSED PACKAGE SIZE:" -e "^PACKAGE LOCATION:" \
-e "^PACKAGE DESCRIPTION:" -e "^$pack:" -e "^FILE LIST:" $package_file`; do
- if [ -d /$file ]; then
- mkdir -p $TMP/package-$pack/$file
- elif [ -f /$file ]; then
- cp /$file $TMP/package-$pack/$file
- else echo file /$file was not found, please add it manually, exploding and making the package again
+ if [ "$file" != "install" ] && [ "$file" != "install/slack-desc" ] && [ "$file" != "install/doinst,sh" ]; then
+ if [ -d /$file ]; then
+ mkdir -p $TMP/package-$pack/$file
+ elif [ -f /$file ]; then
+ cp /$file $TMP/package-$pack/$file
+ else
+ echo file /$file was not found, please add it manually, exploding and making the package again
+ fi
fi
done
diff --git a/src/simplaret b/src/simplaret
index ed98402..b2b7d2b 100755
--- a/src/simplaret
+++ b/src/simplaret
@@ -275,8 +275,8 @@ function simplaret_purge {
echo purging all packages older than $3 weeks for arch $ARCH and version $VERSION
fi
mtime="`echo "$3*7" | bc -l`"
- for file in `find $STORAGE/$ARCH/$VERSION/ -mtime +$mtime | bc -l 2> /dev/null`; do
- for extension in tgz asc; do
+ for file in `find $STORAGE/$ARCH/$VERSION/ -mtime +$mtime`; do
+ for extension in tgz asc meta; do
if echo $file | grep -qe ".$extension$"; then
rm $file
fi