Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 27981
Collapse All | Expand All

(-)quickpkg.orig (-10 / +30 lines)
Lines 14-30 Link Here
14
	echo "You must run this as root"
14
	echo "You must run this as root"
15
	exit 1
15
	exit 1
16
fi
16
fi
17
18
export PORTAGE_DB="/var/db/pkg"
17
if [ -z $1 ] ; then
19
if [ -z $1 ] ; then
18
	echo "QUICKPKG ver 1.2"
20
	echo "QUICKPKG ver 1.2"
19
	echo "USAGE: quickpkg <list of pkgs>"
21
	echo "USAGE: quickpkg <list of pkgs>"
20
	echo "    a pkg can be of the form:"
22
	echo "    a pkg can be of the form:"
21
	echo "        - /var/db/pkg/<CATEGORY>/<PKG-VERSION>/"
23
	echo "        - ${PORTAGE_DB}/<CATEGORY>/<PKG-VERSION>/"
22
	echo "        - single depend-type atom ..."
24
	echo "        - single depend-type atom ..."
23
	echo "              if portage can emerge it, quickpkg can make a package"
25
	echo "              if portage can emerge it, quickpkg can make a package"
24
	echo "              for exact definitions of depend atoms, see ebuild(5)"
26
	echo "              for exact definitions of depend atoms, see ebuild(5)"
25
	echo
27
	echo
26
	echo "EXAMPLE:"
28
	echo "EXAMPLE:"
27
	echo "    quickpkg /var/db/pkg/net-www/apache-1.3.27-r1"
29
	echo "    quickpkg ${PORTAGE_DB}/net-www/apache-1.3.27-r1"
28
	echo "        package up apache, just version 1.3.27-r1"
30
	echo "        package up apache, just version 1.3.27-r1"
29
	echo "    quickpkg apache"
31
	echo "    quickpkg apache"
30
	echo "        package up apache, all versions of apache installed"
32
	echo "        package up apache, all versions of apache installed"
Lines 43-49 Link Here
43
# $2 = category
45
# $2 = category
44
do_pkg() {
46
do_pkg() {
45
	MYDIR="${PORTAGE_TMPDIR}/portage-pkg/$1"
47
	MYDIR="${PORTAGE_TMPDIR}/portage-pkg/$1"
46
	SRCDIR="/var/db/pkg/$2/$1"
48
	SRCDIR="${PORTAGE_DB}/$2/$1"
47
49
48
	ebegin "Building package for $1"
50
	ebegin "Building package for $1"
49
	(
51
	(
Lines 84-91 Link Here
84
}
86
}
85
87
86
# here we parse the parameters given to use on the cmdline
88
# here we parse the parameters given to use on the cmdline
89
export PKGERROR=""
87
export PKGSTATS=""
90
export PKGSTATS=""
88
for x in $@ ; do
91
for x in "$@" ; do
89
92
90
	# they gave us full path
93
	# they gave us full path
91
	if [ -e ${x}/CONTENTS ] ; then
94
	if [ -e ${x}/CONTENTS ] ; then
Lines 97-115 Link Here
97
	else
100
	else
98
		DIRLIST="`portageq match / ${x}`"
101
		DIRLIST="`portageq match / ${x}`"
99
		if [ -z "${DIRLIST}" ] ; then
102
		if [ -z "${DIRLIST}" ] ; then
100
			eerror "could not find anything to match ${x}"
103
			eerror "Could not find anything to match '${x}'; skipping"
101
			exit 1
104
			export PKGERROR="${PKGERROR} ${x}"
105
			continue
102
		fi
106
		fi
103
107
104
		for d in ${DIRLIST} ; do
108
		for d in ${DIRLIST} ; do
105
			pkg="`echo ${d} | cut -d/ -f2`"
109
			pkg="`echo ${d} | cut -d/ -f2`"
106
			cat="`echo ${d} | cut -d/ -f1`"
110
			cat="`echo ${d} | cut -d/ -f1`"
107
			do_pkg ${pkg} ${cat}
111
			if [ -f "${PORTAGE_DB}/${cat}/${pkg}/CONTENTS" ] ; then
112
				do_pkg ${pkg} ${cat}
113
			elif [ -d "${PORTAGE_DB}/${cat}/${pkg}" ] ; then
114
				ewarn "Package '${cat}/${pkg}' was injected; skipping"
115
			else
116
				eerror "Unhandled case (${cat}/${pkg}) !"
117
				eerror "Please file a bug at http://bugs.gentoo.org/"
118
				exit 10
119
			fi
108
		done
120
		done
109
	fi
121
	fi
110
122
111
done
123
done
112
124
113
[ -z "${PKGSTATS}" ] \
125
if [ -z "${PKGSTATS}" ] ; then
114
	&& eerror "No packages found" \
126
	eerror "No packages found"
115
	|| echo $'\n'"$(einfo Packages now in ${PKGDIR}:)${PKGSTATS}"
127
	exit 1
128
else
129
	echo $'\n'"$(einfo Packages now in ${PKGDIR}:)${PKGSTATS}"
130
fi
131
if [ ! -z "${PKGERROR}" ] ; then
132
	ewarn "The following packages could not be found:"
133
	ewarn "${PKGERROR}"
134
	exit 2
135
fi

Return to bug 27981