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

add/fix i18n; make pot && make msgmerge; add ru.po
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon May 21 10:44:59 2012 +0300 (2012-05-21)
parents 1691917d8883
children 021b49de9f37
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
meshca@155 23 # checks to see if file is proper tazpkg
meshca@155 24 is_valid_tazpkg() {
meshca@155 25 local file=$1
meshca@155 26 [ -a $file ] && [ "$file" != "$(package_name $file)" ]
meshca@155 27 }
meshca@155 28
meshca@155 29 check_valid_tazpkg() {
meshca@155 30 local file=$1
meshca@155 31 if ! is_valid_tazpkg $file; then
al@179 32 eval_gettext "\$file is not a tazpkg. Exiting"; newline
meshca@155 33 exit 1
meshca@155 34 fi
meshca@155 35 }