[Lunar-commits] CVS: moonbase/archive/unzip/plugin.d unpack-zip.plugin, NONE, 1.1

Auke Kok sofar at lunar-linux.org
Wed Mar 30 10:49:27 UTC 2005


Update of /var/cvs/lunar/moonbase/archive/unzip/plugin.d
In directory espresso.foo-projects.org:/tmp/cvs-serv14680/archive/unzip/plugin.d

Added Files:
	unpack-zip.plugin 
Log Message:
Merging in module-dependent plugins


--- NEW FILE: unpack-zip.plugin ---
#!/bin/bash
#############################################################
#                                                           #
# unpack-zip.plugin - generic plugin that unpacks zipfiles  #
#                                                           #
#############################################################
#                                                           #
# Copyright 2005 by Auke Kok under GPLv2                    #
#                                                           #
#############################################################


plugin_unpack_zip() {
	case $1 in
		*.zip)
			if [ ! -x /usr/bin/unzip ]; then
				message "${PROBLEM_COLOR}! Cannot unpack zip-files without ${MODULE_COLOR}unzip${DEFAULT_COLOR}${PROBLEM_COLOR} installed${DEFAULT_COLOR}";
				exit 1
			fi
			debug_msg "Unpacking zip file \"$1\""
			unzip -q $1 || return 1
			;;
		*)
			# fallback: we don't know what to do!
			return 2
			;;
	esac
	# return success!
	return 0
}


plugin_register SOURCE_UNPACK plugin_unpack_zip



More information about the Lunar-commits mailing list