[Lunar-commits] CVS: moonbase/archive/rpmunpack/plugin.d unpack-rpm.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/rpmunpack/plugin.d
In directory espresso.foo-projects.org:/tmp/cvs-serv14680/archive/rpmunpack/plugin.d

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


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


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


plugin_register SOURCE_UNPACK plugin_unpack_rpm



More information about the Lunar-commits mailing list