- automagically detect and emit "python(abi) = 2.4" dependencies.
authorjbj <devnull@localhost>
Mon, 6 Dec 2004 15:47:27 +0000 (15:47 +0000)
committerjbj <devnull@localhost>
Mon, 6 Dec 2004 15:47:27 +0000 (15:47 +0000)
- popt 1.10.1 to preserve newer.

CVS patchset: 7631
CVS date: 2004/12/06 15:47:27

CHANGES
build/rpmfc.c
popt/configure.ac
popt/popt.spec
rpm.spec.in
scripts/pythondeps.sh

diff --git a/CHANGES b/CHANGES
index a52412a..e506796 100644 (file)
--- 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).
index a840736..f7dcdae 100644 (file)
@@ -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. */
index 5935014..8bed5f8 100755 (executable)
@@ -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"
index df33aaa..fc29564 100644 (file)
@@ -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
index f387f12..277d554 100644 (file)
@@ -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 <jbj@jbj.org> 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 <jbj@jbj.org> 4.4.1-0.1
 - force *.py->*.pyo byte code compilation with brp-python-bytecompile.
-- automagically detect and emit "python(abi) = 2.4" dependencies.
index bd6535d..61c89f3 100755 (executable)
@@ -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