From 63377cb838839e519a81757698bbc380cca94b36 Mon Sep 17 00:00:00 2001 From: jbj Date: Mon, 6 Dec 2004 15:47:27 +0000 Subject: [PATCH] - automagically detect and emit "python(abi) = 2.4" dependencies. - popt 1.10.1 to preserve newer. CVS patchset: 7631 CVS date: 2004/12/06 15:47:27 --- CHANGES | 1 + build/rpmfc.c | 27 +++++++++++++++++++++++++-- popt/configure.ac | 2 +- popt/popt.spec | 2 +- rpm.spec.in | 12 ++++++++---- scripts/pythondeps.sh | 5 ++--- 6 files changed, 38 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index a52412a..e506796 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ 4.4 -> 4.4.1: - force *.py->*.pyo byte code compilation with brp-python-bytecompile. - automagically detect and emit "python(abi) = 2.4" dependencies. + - popt 1.10.1 to preserve newer. 4.3.3 -> 4.4: - pentium3/pentium4 arch support (pluto@PLD). diff --git a/build/rpmfc.c b/build/rpmfc.c index a840736..f7dcdae 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -452,12 +452,19 @@ static struct rpmfcTokens_s rpmfcTokens[] = { { "perl script text", RPMFC_PERL|RPMFC_INCLUDE }, { "Perl5 module source text", RPMFC_PERL|RPMFC_MODULE|RPMFC_INCLUDE }, + { " /usr/bin/python", RPMFC_PYTHON|RPMFC_INCLUDE }, + + /* XXX "a /usr/bin/python -t script text executable" */ + /* XXX "python 2.3 byte-compiled" */ + { "python ", RPMFC_PYTHON|RPMFC_INCLUDE }, + { "current ar archive", RPMFC_STATIC|RPMFC_LIBRARY|RPMFC_ARCHIVE|RPMFC_INCLUDE }, { "Zip archive data", RPMFC_COMPRESSED|RPMFC_ARCHIVE|RPMFC_INCLUDE }, { "tar archive", RPMFC_ARCHIVE|RPMFC_INCLUDE }, { "cpio archive", RPMFC_ARCHIVE|RPMFC_INCLUDE }, { "RPM v3", RPMFC_ARCHIVE|RPMFC_INCLUDE }, + { "RPM v4", RPMFC_ARCHIVE|RPMFC_INCLUDE }, { " image", RPMFC_IMAGE|RPMFC_INCLUDE }, { " font", RPMFC_FONT|RPMFC_INCLUDE }, @@ -466,8 +473,6 @@ static struct rpmfcTokens_s rpmfcTokens[] = { { " commands", RPMFC_SCRIPT|RPMFC_INCLUDE }, { " script", RPMFC_SCRIPT|RPMFC_INCLUDE }, - { "python compiled", RPMFC_WHITE|RPMFC_INCLUDE }, - { "empty", RPMFC_WHITE|RPMFC_INCLUDE }, { "HTML", RPMFC_WHITE|RPMFC_INCLUDE }, @@ -721,7 +726,9 @@ static int rpmfcSCRIPT(rpmfc fc) } if (fc->fcolor->vals[fc->ix] & RPMFC_PYTHON) { xx = rpmfcHelper(fc, 'P', "python"); +#ifdef NOTYET if (is_executable) +#endif xx = rpmfcHelper(fc, 'R', "python"); } @@ -1051,6 +1058,7 @@ typedef struct rpmfcApplyTbl_s { static struct rpmfcApplyTbl_s rpmfcApplyTable[] = { { rpmfcELF, RPMFC_ELF }, { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL) }, + { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PYTHON) }, { NULL, 0 } }; @@ -1075,6 +1083,18 @@ int rpmfcApply(rpmfc fc) /* Generate package and per-file dependencies. */ for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) { + /* XXX Insure that /usr/lib{,64}/python files are marked RPMFC_PYTHON */ + /* XXX HACK: classification by path is intrinsically stupid. */ + { const char *fn = strstr(fc->fn[fc->ix], "/usr/lib"); + if (fn) { + fn += sizeof("/usr/lib")-1; + if (fn[0] == '6' && fn[1] == '4') + fn += 2; + if (!strncmp(fn, "/python", sizeof("/python")-1)) + fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON; + } + } + for (fcat = rpmfcApplyTable; fcat->func != NULL; fcat++) { if (!(fc->fcolor->vals[fc->ix] & fcat->colormask)) /*@innercontinue@*/ continue; @@ -1209,7 +1229,10 @@ assert(ftype != NULL); /* XXX figger a proper return path. */ se = ftype; rpmMessage(RPMMESS_DEBUG, "%s: %s\n", s, se); + /* Save the path. */ xx = argvAdd(&fc->fn, s); + + /* Save the file type string. */ xx = argvAdd(&fcav, se); /* Add (filtered) entry to sorted class dictionary. */ diff --git a/popt/configure.ac b/popt/configure.ac index 5935014..8bed5f8 100755 --- a/popt/configure.ac +++ b/popt/configure.ac @@ -2,7 +2,7 @@ AC_INIT(popt.h) AC_CANONICAL_SYSTEM AC_PREREQ(2.12) AC_CONFIG_HEADERS -AM_INIT_AUTOMAKE(popt, 1.10) +AM_INIT_AUTOMAKE(popt, 1.10.1) AM_CONFIG_HEADER(config.h) ALL_LINGUAS="cs da de es eu_ES fi fr gl hu id is it ja ko no pl pt pt_BR ro ru sk sl sr sv tr uk wa zh zh_CN.GB2312" diff --git a/popt/popt.spec b/popt/popt.spec index df33aaa..fc29564 100644 --- a/popt/popt.spec +++ b/popt/popt.spec @@ -4,7 +4,7 @@ # Summary: A C library for parsing command line parameters. Name: popt -Version: 1.10 +Version: 1.10.1 Release: 0.1 License: X Consortium Group: System Environment/Libraries diff --git a/rpm.spec.in b/rpm.spec.in index f387f12..277d554 100644 --- a/rpm.spec.in +++ b/rpm.spec.in @@ -20,7 +20,7 @@ Name: rpm %define version @VERSION@ Version: %{version} %{expand: %%define rpm_version %{version}} -Release: 0.1 +Release: 0.3 Group: System Environment/Base Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{rpm_version}.tar.gz License: GPL @@ -28,7 +28,7 @@ Conflicts: patch < 2.5 %ifos linux Prereq: fileutils shadow-utils %endif -Requires: popt = 1.10 +Requires: popt = 1.10.1 Obsoletes: rpm-perl < %{version} # XXX necessary only to drag in /usr/lib/libelf.a, otherwise internal elfutils. @@ -112,7 +112,7 @@ programs that will manipulate RPM packages and databases. %package -n popt Summary: A C library for parsing command line parameters. Group: Development/Libraries -Version: 1.10 +Version: 1.10.1 %description -n popt Popt is a C library for parsing command line parameters. Popt was @@ -412,6 +412,7 @@ exit 0 %rpmattr %{__prefix}/lib/rpm/perldeps.pl %rpmattr %{__prefix}/lib/rpm/perl.prov %rpmattr %{__prefix}/lib/rpm/perl.req +%rpmattr %{__prefix}/lib/rpm/pythondeps.sh %rpmattr %{__prefix}/lib/rpm/rpm[bt] %rpmattr %{__prefix}/lib/rpm/rpmdeps @@ -495,6 +496,9 @@ exit 0 %{__includedir}/popt.h %changelog +* Mon Dec 6 2004 Jeff Johnson 4.4.1-0.2 +- automagically detect and emit "python(abi) = 2.4" dependencies. +- popt 1.10.1 to preserve newer. + * Sun Dec 5 2004 Jeff Johnson 4.4.1-0.1 - force *.py->*.pyo byte code compilation with brp-python-bytecompile. -- automagically detect and emit "python(abi) = 2.4" dependencies. diff --git a/scripts/pythondeps.sh b/scripts/pythondeps.sh index bd6535d..61c89f3 100755 --- a/scripts/pythondeps.sh +++ b/scripts/pythondeps.sh @@ -9,13 +9,12 @@ PYVER=`python -c "import sys; v=sys.version_info[:2]; print '%d.%d'%v"` case $1 in -P|--provides) shift - grep /usr/bin/python 2> /dev/null && echo "python(abi) = ${PYVER}" + grep "/usr/bin/python\*\$" 2> /dev/null && echo "python(abi) = ${PYVER}" exit 0 ;; -R|--requires) shift - cat > /dev/null - echo "python(abi) = ${PYVER}" + grep "/usr/lib[^/]*/python${PYVER}/" 2> /dev/null && echo "python(abi) = ${PYVER}" exit 0 ;; esac -- 2.7.4