#!@BASH@
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
# Leo Lipelis <aeoo@gentoo.org>
# Karl Trygve Kalleberg <karltk@gentoo.org>
+cd /
+
if type -P gsed >/dev/null ; then
function sed() { gsed "$@"; }
fi
}
dyn_spec() {
- tar czf "/usr/src/redhat/SOURCES/${PF}.tar.gz" "${O}/${PF}.ebuild" "${O}/files" || die "Failed to create base rpm tarball."
+ tar czf "/usr/src/rpm/SOURCES/${PF}.tar.gz" \
+ "${O}/${PF}.ebuild" "${O}/files" || \
+ die "Failed to create base rpm tarball."
cat <<__END1__ > ${PF}.spec
Summary: ${DESCRIPTION}
}
dyn_rpm() {
- addwrite /usr/src/redhat/
- addwrite ${RPMDIR}
+ addwrite /usr/src/rpm
+ addwrite "${RPMDIR}"
dyn_spec
rpmbuild -bb "${PF}.spec" || die "Failed to integrate rpm spec file"
- install -D "/usr/src/redhat/RPMS/i386/${PN}-${PV}-${PR}.i386.rpm" "${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || die "Failed to move rpm"
+ install -D "/usr/src/rpm/RPMS/i386/${PN}-${PV}-${PR}.i386.rpm" \
+ "${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || \
+ die "Failed to move rpm"
}
if [ -n "${MISC_FUNCTIONS_ARGS}" ]; then
print
sys.exit(1)
- if isCvs:
+ if True:
mycvstree=portage.cvstree.getentries("./",recursive=1)
mychanged=portage.cvstree.findchanged(mycvstree,recursive=1,basedir="./")
mynew=portage.cvstree.findnew(mycvstree,recursive=1,basedir="./")
myremoved=portage.cvstree.findremoved(mycvstree,recursive=1,basedir="./")
+ bin_blob_pattern = re.compile("^-kb$")
+ bin_blobs = set(portage.cvstree.findoption(mycvstree,
+ bin_blob_pattern, recursive=1, basedir="./"))
+
if isSvn:
svnstatus = os.popen("svn status").readlines()
mychanged = [ elem.rstrip()[7:] for elem in svnstatus if elem.startswith("M") ]
headerstring="'\$(Header|Id)"
headerstring+=".*\$'"
for myfile in myupdates:
+ if myfile in bin_blobs:
+ continue
myout=getstatusoutput("egrep -q "+headerstring+" "+myfile)
if myout[0]==0:
myheaders.append(myfile)
+# /etc/etc-update.conf: config file for `etc-update` utility
# edit the lines below to your liking
-# $Id: etc-update.conf 3483 2006-06-10 21:40:40Z genone $
# mode - 0 for text, 1 for menu (support incomplete)
# note that you need dev-util/dialog installed
mytype, myroot, mykey = mybigkey
- if mytype == "blocks":
- if myparent and \
- "--buildpkgonly" not in self.myopts and \
- "--nodeps" not in self.myopts and \
- myparent not in self._slot_collision_nodes:
- mybigkey[1] = myparent[1]
- self.blocker_parents.setdefault(
- tuple(mybigkey), set()).add(myparent)
- return 1
-
# select the correct /var database that we'll be checking against
vardbapi = self.trees[myroot]["vartree"].dbapi
portdb = self.trees[myroot]["porttree"].dbapi
print "Candidates:",mymerge
for x in mymerge:
selected_pkg = None
- if x[0]=="!":
- selected_pkg = (["blocks", myroot, x[1:]], None)
+ if x.startswith("!"):
+ if "--buildpkgonly" not in self.myopts and \
+ "--nodeps" not in self.myopts and \
+ myparent not in self._slot_collision_nodes:
+ p_type, p_root, p_key, p_status = myparent
+ if p_type != "installed" and p_status != "merge":
+ # It's safe to ignore blockers from --onlydeps nodes.
+ continue
+ self.blocker_parents.setdefault(
+ ("blocks", p_root, x[1:]), set()).add(myparent)
+ continue
else:
#We are not processing a blocker but a normal dependency
if myparent:
mysettings["PF"] = mypv
mysettings["PORTDIR"] = os.path.realpath(mysettings["PORTDIR"])
+ mysettings["DISTDIR"] = os.path.realpath(mysettings["DISTDIR"])
+ mysettings["RPMDIR"] = os.path.realpath(mysettings["RPMDIR"])
+
mysettings["ECLASSDIR"] = mysettings["PORTDIR"]+"/eclass"
mysettings["SANDBOX_LOG"] = mycpv.replace("/", "_-_")
for mydir in entries["dirs"]:
mylist+=findnew(entries["dirs"][mydir],recursive,basedir+mydir)
return mylist
-
+
+def findoption(entries, pattern, recursive=0, basedir=""):
+ """(entries, pattern, recursive=0, basedir="")
+ Iterate over paths of cvs entries for which the pattern.search() method
+ finds a match. Returns a list of paths, optionally prepended with a
+ basedir."""
+ if not basedir.endswith("/"):
+ basedir += "/"
+ for myfile, mydata in entries["files"].iteritems():
+ if "cvs" in mydata["status"]:
+ if pattern.search(mydata["flags"]):
+ yield basedir+myfile
+ if recursive:
+ for mydir, mydata in entries["dirs"].iteritems():
+ for x in findoption(mydata, pattern,
+ recursive, basedir+mydir):
+ yield x
+
def findchanged(entries,recursive=0,basedir=""):
"""(entries,recursive=0,basedir="")
Recurses the entries tree to find all elements that exist in the cvs tree