slitaz-base-files annotate rootfs/usr/lib/slitaz/libpkg.sh @ rev 181

prepa for release
author Christophe Lincoln <pankso@slitaz.org>
date Thu May 24 12:38:33 2012 +0200 (2012-05-24)
parents bffd6c0e7c5b
children de45cc358765
rev   line source
pankso@152 1 #!/bin/sh
pankso@152 2 #
pankso@152 3 # SliTaz Packages base functions used by packages manager, cook and
pankso@152 4 # all tools dealing with packages and receipts.
pankso@152 5 #
pankso@152 6 # Documentation: man libpkg or /usr/share/doc/slitaz/libpkg.txt
pankso@152 7 #
pankso@152 8 # Copyright (C) 2012 SliTaz GNU/Linux - BSD License
pankso@152 9 #
pankso@152 10
pankso@152 11 # Unset all receipt variables.
pankso@152 12 unset_receipt() {
pankso@152 13 unset PACKAGE VERSION EXTRAVERSION SHORT_DESC HOST_ARCH TARBALL \
pankso@152 14 DEPENDS BUILD_DEPENDS WANTED WGET_URL PROVIDE CROSS_BUG
pankso@152 15 }
meshca@155 16
pankso@172 17 # Converts /tmp/pkg.tazpkg to pkg
meshca@155 18 package_name() {
meshca@155 19 local name=$(basename $1)
meshca@155 20 echo ${name%.tazpkg}
meshca@155 21 }
meshca@155 22
pankso@181 23 #
pankso@181 24 # Do we realy need the code below here ???
pankso@181 25 #
pankso@181 26
meshca@155 27 # checks to see if file is proper tazpkg
meshca@155 28 is_valid_tazpkg() {
meshca@155 29 local file=$1
meshca@155 30 [ -a $file ] && [ "$file" != "$(package_name $file)" ]
meshca@155 31 }
meshca@155 32
meshca@155 33 check_valid_tazpkg() {
meshca@155 34 local file=$1
meshca@155 35 if ! is_valid_tazpkg $file; then
al@179 36 eval_gettext "\$file is not a tazpkg. Exiting"; newline
meshca@155 37 exit 1
meshca@155 38 fi
meshca@155 39 }