From d34e4d38502a013331e1ffc8a494c6263da3c1b2 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Thu, 24 Mar 2005 14:17:29 +0000 Subject: [PATCH] Adding back in the kill for livecd-stage1 for gconfd-2 and resolving bug #73363. Adding in mkvardb script to create a /var/db/pkg entry from an arbitrary set of files. Modifying default-runscript.sh to copy mkvardb to /tmp in the chroot. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@568 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 10 +- livecd/files/mkvardb | 185 +++++++++++++++++++++++++ livecd/runscript/default-runscript.sh | 4 +- targets/livecd-stage1/livecd-stage1.sh | 5 +- 4 files changed, 200 insertions(+), 4 deletions(-) create mode 100755 livecd/files/mkvardb diff --git a/ChangeLog b/ChangeLog index 2890f90a..bf313793 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for gentoo/src/catalyst # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.193 2005/03/19 17:46:39 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.194 2005/03/24 14:17:29 wolf31o2 Exp $ + + 24 Mar 2005; Chris Gianelloni +livecd/files/mkvardb, + livecd/runscript/default-runscript.sh, + targets/livecd-stage1/livecd-stage1.sh: + Adding back in the kill for livecd-stage1 for gconfd-2 and resolving bug + #73363. Adding in mkvardb script to create a /var/db/pkg entry from an + arbitrary set of files. Modifying default-runscript.sh to copy mkvardb to + /tmp in the chroot. 19 Mar 2005; Chris Gianelloni livecd/runscript/ppc-archscript.sh: diff --git a/livecd/files/mkvardb b/livecd/files/mkvardb new file mode 100755 index 00000000..9faca884 --- /dev/null +++ b/livecd/files/mkvardb @@ -0,0 +1,185 @@ +#!/bin/bash + +PROG=$(basename ${0}) +PORTDIR="$(portageq envvar PORTDIR)" +DB="/var/db/pkg" +filesindex=0 + +declare -a exclude +declare -a files + +function usage { + echo "Usage: $PROG [options] " + echo + echo "Options:" + echo " -h|--help Show this message" + echo " -c|--category Specifies the category for the package to be created" + echo " -p|--pkgname Specifies the name for the package to be created" + echo " -v|--version Specifies the version for the package to be created" +# echo " -m|--makevardb Creates the /var/db/pkg entry manually" +# echo " -e|--emerge Uses emerge to install the created ebuild" +# echo " -x|--exclude This is passed to tar when the specified files are" + echo " packaged. This option can be specified multiple times" + echo + echo "Parameters:" + echo " files These are the existing files that are to be packaged" +} + +function create_ebuild { + DIR="${PORTDIR_OVERLAY}/${category}/${pkgname}" + EBUILD="${DIR}/${pkgname}-${pkgver}.ebuild" + + mkdir -p $DIR + cat > $EBUILD <> /tmp/mkvardb_filelist + fi + echo ${i} >> /tmp/mkvardb_filelist + curdir=${i} + else + [ -d "${curdir}/${i}" ] && continue + echo "${curdir}/${i}" >> /tmp/mkvardb_filelist + fi + done + sort -u /tmp/mkvardb_filelist | sed -e 's://:/:' +} + +function create_vardb { + VARDBDIR="${DB}/${category}/${pkgname}-${pkgver}" + mkdir -p $VARDBDIR + cd $VARDBDIR + cp $EBUILD $VARDBDIR + touch ASFLAGS CATEGORY CBUILD CC CDEPEND CFLAGS CHOST CONTENTS COUNTER CTARGET CXX CXXFLAGS DEPEND EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE FEATURES INHERITED IUSE LDFLAGS LDFLAGS LIBCFLAGS LIBCXXFLAGS LICENSE PDEPEND PF PKGUSE PROVIDE RDEPEND RESTRICT SLOT USE + echo ${category} > CATEGORY + echo $(portageq envvar CFLAGS) > CFLAGS + echo $(portageq envvar CHOST) > CHOST + echo $(portageq envvar CTARGET) > CTARGET + echo $(portageq envvar CXXFLAGS) > CXXFLAGS + echo eutils > INHERITED + echo ${pkgname}-${pkgver} > PF + echo 0 > SLOT + echo $(portageq envvar USE) > USE + for i in $(sort_dirs_and_files); do + if [ -d ${i} ]; then + echo "dir ${i}" >> CONTENTS + else + time=$(stat -c %Y ${i}) + md5=$(md5sum ${i} | cut -d ' ' -f 1) + echo "obj ${i} $md5 $time" >> CONTENTS + fi + done +} + +# Parse args +params=${#} +while [ ${#} -gt 0 ] +do + a=${1} + shift + case "${a}" in + + -h|--help) + usage + exit 0 + ;; + + -c|--category) + category=$1 + shift + ;; + + -p|--pkgname) + pkgname=$1 + shift + ;; + + -v|--pkgversion) + pkgver=$1 + shift + ;; + +# -m|--makevardb) +# makevardb=1 +# emerge=0 +# ;; +# +# -e|--emerge) +# emerge=1 +# makevardb=0 +# ;; +# +# -x|--exclude) +# exclude[#exclude[@]]=$1 +# shift +# ;; +# + -*) + echo "You have specified an invalid option: ${a}" 1>&2 + usage + exit 1 + ;; + + *) + files[$filesindex]=$a + filesindex=$(expr $filesindex + 1) + ;; + + esac +done + +if [ "$category" = "" ]; then + echo "You must specify a category" 1>&2 + usage + exit 1 +fi +if [ "$pkgname" = "" ]; then + echo "You must specify a package name" 1>&2 + usage + exit 1 +fi +if [ "$pkgver" = "" ]; then + echo "You must specify a package version" 1>&2 + usage + exit 1 +fi +if [ $filesindex -eq 0 ]; then + echo "You must specify files to include in the package" 1>&2 + usage + exit 1 +fi + +create_ebuild +create_vardb diff --git a/livecd/runscript/default-runscript.sh b/livecd/runscript/default-runscript.sh index 4074486c..87900db9 100644 --- a/livecd/runscript/default-runscript.sh +++ b/livecd/runscript/default-runscript.sh @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript/Attic/default-runscript.sh,v 1.22 2005/03/02 02:14:34 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/livecd/runscript/Attic/default-runscript.sh,v 1.23 2005/03/24 14:17:29 wolf31o2 Exp $ #return codes to be used by archscript die() { @@ -146,6 +146,8 @@ case $1 in touch ${clst_chroot_path}/root/.bashrc cp ${clst_sharedir}/livecd/files/livecd-local.start \ ${clst_chroot_path}/etc/conf.d/local.start + cp ${clst_sharedir}/livecd/files/mkvardb \ + ${clst_chroot_path}/tmp mkdir -p /usr/share/faces cp ${clst_sharedir}/livecd/files/gentoo.png \ ${clst_chroot_path}/usr/share/faces diff --git a/targets/livecd-stage1/livecd-stage1.sh b/targets/livecd-stage1/livecd-stage1.sh index 8993d4c8..fb98751a 100755 --- a/targets/livecd-stage1/livecd-stage1.sh +++ b/targets/livecd-stage1/livecd-stage1.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/Attic/livecd-stage1.sh,v 1.21 2005/03/05 05:12:58 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/Attic/livecd-stage1.sh,v 1.22 2005/03/24 14:17:29 wolf31o2 Exp $ case $1 in enter) @@ -19,7 +19,8 @@ case $1 in GCONFD_RUNNING="`pidof gconfd-2`" if [ -n "${GCONFD_RUNNING}" ] then - gconftool-2 --shutdown + kill -9 ${GCONFD_RUNNING} + #gconftool-2 --shutdown fi #cp ${clst_sharedir}/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh ${clst_chroot_path}/tmp #${clst_CHROOT} ${clst_chroot_path} /tmp/livecd-stage1-preclean-chroot.sh || exit 1 -- 2.26.2