From a0d04112c014969e2bdf5f7f280e6635ceea40e8 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Mon, 21 Mar 2011 14:39:10 +0100 Subject: Move find-provides and find-requires link to autodeps/ Implement link reaction with less copied code --- Makefile.am | 7 ++++--- configure.ac | 59 ++++++++++++++++++++++++----------------------------------- 2 files changed, 28 insertions(+), 38 deletions(-) diff --git a/Makefile.am b/Makefile.am index f1bcd7c8a..41d7de818 100644 --- a/Makefile.am +++ b/Makefile.am @@ -90,10 +90,11 @@ rpmbin_PROGRAMS = rpm bin_PROGRAMS = rpm2cpio rpmbuild rpmdb rpmkeys rpmsign rpmspec rpmlibexec_PROGRAMS = -rpmconfig_SCRIPTS = find-provides find-requires mkinstalldirs \ +rpmconfig_SCRIPTS = autodeps/find-provides autodeps/find-requires \ + mkinstalldirs \ config.guess config.sub -DISTCLEANFILES = find-provides -DISTCLEANFILES += find-requires +DISTCLEANFILES = autodeps/find-provides +DISTCLEANFILES += autodeps/find-requires noinst_LTLIBRARIES = libcliutils.la libcliutils_la_SOURCES = cliutils.h cliutils.c diff --git a/configure.ac b/configure.ac index 067088f3e..e71364c8f 100644 --- a/configure.ac +++ b/configure.ac @@ -752,41 +752,30 @@ host_os_major=`echo "${host_os}" | sed 's/\..*$//'` host_os_noversion=`echo "${host_os}" | sed 's/[0-9]*\..*$//'` changequote([, ]) -rm -f ./find-provides -if test -f ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.prov ; then - echo "using ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.prov for automatic provides generation" - ln -s ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.prov ./find-provides -elif test -f ${srcdir}/autodeps/${host_os_exact}.prov ; then - echo "using ${srcdir}/autodeps/${host_os_exact}.prov for automatic provides generation" - ln -s ${srcdir}/autodeps/${host_os_exact}.prov ./find-provides -elif test -f ${srcdir}/autodeps/${host_os_major}.prov ; then - echo "using ${srcdir}/autodeps/${host_os_major}.prov for automatic provides generation" - ln -s ${srcdir}/autodeps/${host_os_major}.prov ./find-provides -elif test -f ${srcdir}/autodeps/${host_os_noversion}.prov ; then - echo "using ${srcdir}/autodeps/${host_os_noversion}.prov for automatic provides generation" - ln -s ${srcdir}/autodeps/${host_os_noversion}.prov ./find-provides -else - echo "*** no default provides information is available for ${host_os_noversion}" - ln -s ${srcdir}/autodeps/none ./find-provides -fi - -rm -f ./find-requires -if test -f ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.req ; then - echo "using ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.req for automatic requires generation" - ln -s ${srcdir}/autodeps/${host_cpu}-${host_os_exact}.req ./find-requires -elif test -f ${srcdir}/autodeps/${host_os_exact}.req ; then - echo "using ${srcdir}/autodeps/${host_os_exact}.req for automatic requires generation" - ln -s ${srcdir}/autodeps/${host_os_exact}.req ./find-requires -elif test -f ${srcdir}/autodeps/${host_os_major}.req ; then - echo "using ${srcdir}/autodeps/${host_os_major}.req for automatic requires generation" - ln -s ${srcdir}/autodeps/${host_os_major}.req ./find-requires -elif test -f ${srcdir}/autodeps/${host_os_noversion}.req ; then - echo "using ${srcdir}/autodeps/${host_os_noversion}.req for automatic requires generation" - ln -s ${srcdir}/autodeps/${host_os_noversion}.req ./find-requires -else - echo "*** no default requires information is available for ${host_os_noversion}" - ln -s ${srcdir}/autodeps/none ./find-requires -fi +for provscript in ${host_cpu}-${host_os_exact}.prov ${host_os_exact}.prov ${host_os_major}.prov ${host_os_noversion}.prov none ; do { + if test -f ${srcdir}/autodeps/${provscript} ; then + if [[ ${provscript} == none ]] ; then + echo "*** no default provides information is available for ${host_os_noversion}" + else + echo "using ${srcdir}/autodeps/${provscript} for automatic provides generation" + fi + ln -sf ${provscript} ${srcdir}/autodeps/find-provides + break + fi +}; done + + +for reqscript in ${host_cpu}-${host_os_exact}.req ${host_os_exact}.req ${host_os_major}.req ${host_os_noversion}.req none ; do { + if test -f ${srcdir}/autodeps/${reqscript} ; then + if [[ ${reqscript} == none ]] ; then + echo "*** no default requires information is available for ${host_os_noversion}" + else + echo "using ${srcdir}/autodeps/${reqscript} for automatic requires generation" + fi + ln -sf ${reqscript} ./autodeps/find-requires + break + fi +} done dnl Determine the canonical arch-vendor-os for the host machine case "${host_cpu}" in -- cgit v1.2.3