Eliminate Makefile.inc dependence in subdirs.
authorjbj <devnull@localhost>
Thu, 21 Jan 1999 17:18:38 +0000 (17:18 +0000)
committerjbj <devnull@localhost>
Thu, 21 Jan 1999 17:18:38 +0000 (17:18 +0000)
Change "Bad header" to "Bad/unreadable header" for most common cpio failure.

CVS patchset: 2728
CVS date: 1999/01/21 17:18:38

13 files changed:
Makefile.am
Makefile.in
build/Makefile.am
build/Makefile.in
lib/Makefile.am
lib/Makefile.in
lib/cpio.c
lib/install.c
macros.in
po/Makefile.in.in
po/rpm.pot
stamp-h [deleted file]
tests/macros.in

index 79b49b8..ac67671 100644 (file)
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = 1.4 foreign
 
-SUBDIRS = popt build lib po intl misc tools scripts tests
+SUBDIRS = popt build lib po intl misc tools scripts tests .
 
 INCLUDES = -I$(top_srcdir)/build -I$(top_srcdir)/lib -I$(top_srcdir)/intl @INCPATH@
 
index 080a5ba..b150d1e 100644 (file)
@@ -111,7 +111,7 @@ varprefix = @varprefix@
 
 AUTOMAKE_OPTIONS = 1.4 foreign
 
-SUBDIRS = popt build lib po intl misc tools scripts tests
+SUBDIRS = popt build lib po intl misc tools scripts tests .
 
 INCLUDES = -I$(top_srcdir)/build -I$(top_srcdir)/lib -I$(top_srcdir)/intl @INCPATH@
 
index a85fa73..db9d730 100644 (file)
@@ -15,11 +15,6 @@ librpmbuild_a_SOURCES = \
        parseFiles.c parsePreamble.c parsePrep.c parseReqs.c parseScript.c \
        parseSpec.c reqprov.c spec.c
 
-include ../Makefile.inc
-
-#files.o: files.c
-#      $(COMPILE) -DFINDPROVIDES=\"$(FINDPROVIDES)\" -DFINDREQUIRES=\"$(FINDREQUIRES)\" -o $@ -c $<
-
 .PHONY:        lclint
 lclint:
        lclint ${DEFS} ${INCLUDES} ${librpmbuild_a_SOURCES}
index b21081d..08c20f2 100644 (file)
@@ -180,7 +180,7 @@ OBJECTS = $(librpmbuild_a_OBJECTS)
 all: all-redirect
 .SUFFIXES:
 .SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(srcdir)/../Makefile.inc
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
        cd $(top_srcdir) && $(AUTOMAKE) --foreign build/Makefile
 
 Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
index 6c8394d..d08dda5 100644 (file)
@@ -22,11 +22,6 @@ librpm_a_SOURCES = \
        rpmrc.c signature.c stringbuf.c tagtable.c \
        tread.c uninstall.c verify.c transaction.c problems.c hash.c fprint.c
 
-include ../Makefile.inc
-
-#rpmrc.o: rpmrc.c
-#      $(COMPILE) -DLIBRPMRC_FILENAME="\"$(LIBRPMRC_FILENAME)"\" -DMACROFILES=\"$(MACROFILES)\" -o $@ -c $<
-
 tagtable.c: rpmlib.h 
        @echo '#include "system.h"' > tagtable.c
        @echo '#include "rpmlib.h"' >> tagtable.c
index 6cad45e..0d9aaed 100644 (file)
@@ -188,7 +188,7 @@ OBJECTS = $(librpm_a_OBJECTS)
 all: all-redirect
 .SUFFIXES:
 .SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(srcdir)/../Makefile.inc
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
        cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile
 
 Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
index 3f632bf..2fcfe3d 100644 (file)
@@ -528,8 +528,10 @@ int cpioInstallArchive(CFD_t *cfd, struct cpioFileMapping * mappings,
     ch.path = NULL;
     do {
        if ((rc = getNextHeader(cfd, &ch))) {
+#if 0  /* XXX this is the failure point for an unreadable rpm */
            fprintf(stderr, _("getNextHeader: %s\n"), cpioStrerror(rc));
-           return CPIOERR_BAD_HEADER;
+#endif
+           return rc;
        }
 
        if (!strcmp(ch.path, TRAILER)) {
@@ -896,7 +898,7 @@ int cpioBuildArchive(CFD_t *cfd, struct cpioFileMapping * mappings,
                hlink = malloc(sizeof(*hlink));
                hlink->next = hlinkList.next;
                hlinkList.next = hlink;
-               hlink->sb = sb;
+               hlink->sb = sb;         /* structure assignment */
                hlink->dev = sb.st_dev;
                hlink->inode = sb.st_ino;
                hlink->nlink = sb.st_nlink;
@@ -984,7 +986,7 @@ const char * cpioStrerror(int rc)
        s = NULL;
        break;
     case CPIOERR_BAD_MAGIC:    s = _("Bad magic");             break;
-    case CPIOERR_BAD_HEADER:   s = _("Bad header");            break;
+    case CPIOERR_BAD_HEADER:   s = _("Bad/unreadable  header");break;
 
     case CPIOERR_OPEN_FAILED:  s = "open";     break;
     case CPIOERR_CHMOD_FAILED: s = "chmod";    break;
index a160b65..4da3f6a 100644 (file)
@@ -614,8 +614,10 @@ static int installArchive(FD_t fd, struct fileInfo * files,
     if (rc) {
        /* this would probably be a good place to check if disk space
           was used up - if so, we should return a different error */
-       rpmError(RPMERR_CPIO, _("unpacking of archive failed on file %s: %s"), 
-                failedFile, cpioStrerror(rc));
+       rpmError(RPMERR_CPIO, _("unpacking of archive failed%s%s: %s"), 
+               (failedFile != NULL ? _(" on file") : ""),
+               (failedFile != NULL ? failedFile : ""),
+               cpioStrerror(rc));
        return 1;
     }
 
index 83646e0..4506fdf 100644 (file)
--- a/macros.in
+++ b/macros.in
 #      (Note: Above is the goal, below are the macros under development)
 #
 # The configure macro does the following:
-#
 #      optionally change to a subdirectory.
 #      attempt to update onfig.guess and config.sub.
 #      run configure with correct prefix, platform, and CFLAGS.
 #      optionally restore current directory.
+# The configure macro should be invoked as %configure (rather than %{configure})
+# because the rest of the arguments will be expanded using %*. Another
+# gotcha is that arguments, if present, should be on the same line as the
+# %configure.
 #
 %configure(C:) \
-  %{C:%{-C:pushd %{-C*}}} \
+  %{-C:pushd %{-C*}} \
   %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
-  CFLAGS="%{optflags}" ./configure %{_build} --prefix=%{_prefix} \
-  %{C:%{-C:popd }}
-
+  CFLAGS="%{optflags}" ./configure %{_target} --prefix=%{_prefix} \
+  %{-C:popd}
index 94ffce7..82f73bc 100644 (file)
@@ -2,8 +2,6 @@ srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = $(srcdir)
 
-include ../Makefile.inc
-
 INSTALL= @INSTALL@
 INSTALL_PROGRAM= @INSTALL_PROGRAM@
 INSTALL_DATA= @INSTALL_DATA@
index 31f4801..4f49f3a 100644 (file)
@@ -7,7 +7,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 1999-01-19 12:43-0500\n"
+"POT-Creation-Date: 1999-01-21 10:57-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2149,37 +2149,37 @@ msgstr ""
 msgid "line %d: Bad %s number: %s\n"
 msgstr ""
 
-#: ../lib/cpio.c:531
+#: ../lib/cpio.c:532
 #, c-format
 msgid "getNextHeader: %s\n"
 msgstr ""
 
-#: ../lib/cpio.c:983
+#: ../lib/cpio.c:985
 #, c-format
 msgid "(error 0x%x)"
 msgstr ""
 
-#: ../lib/cpio.c:986
+#: ../lib/cpio.c:988
 msgid "Bad magic"
 msgstr ""
 
-#: ../lib/cpio.c:987
-msgid "Bad header"
+#: ../lib/cpio.c:989
+msgid "Bad/unreadable  header"
 msgstr ""
 
-#: ../lib/cpio.c:1005
+#: ../lib/cpio.c:1007
 msgid "Internal error"
 msgstr ""
 
-#: ../lib/cpio.c:1006
+#: ../lib/cpio.c:1008
 msgid "Header size too big"
 msgstr ""
 
-#: ../lib/cpio.c:1007
+#: ../lib/cpio.c:1009
 msgid "Unknown file type"
 msgstr ""
 
-#: ../lib/cpio.c:1016
+#: ../lib/cpio.c:1018
 msgid " failed - "
 msgstr ""
 
@@ -2395,7 +2395,7 @@ msgstr ""
 msgid "warning: %s saved as %s"
 msgstr ""
 
-#: ../lib/install.c:426 ../lib/install.c:761 ../lib/uninstall.c:337
+#: ../lib/install.c:426 ../lib/install.c:763 ../lib/uninstall.c:337
 #, c-format
 msgid "rename of %s to %s failed: %s"
 msgstr ""
@@ -2408,38 +2408,42 @@ msgstr ""
 #. was used up - if so, we should return a different error
 #: ../lib/install.c:617
 #, c-format
-msgid "unpacking of archive failed on file %s: %s"
+msgid "unpacking of archive failed%s%s: %s"
+msgstr ""
+
+#: ../lib/install.c:618
+msgid " on file"
 msgstr ""
 
-#: ../lib/install.c:655
+#: ../lib/install.c:657
 msgid "installing a source package\n"
 msgstr ""
 
-#: ../lib/install.c:661 ../lib/install.c:667
+#: ../lib/install.c:663 ../lib/install.c:669
 #, c-format
 msgid "cannot write to %s"
 msgstr ""
 
-#: ../lib/install.c:672
+#: ../lib/install.c:674
 #, c-format
 msgid "sources in: %s\n"
 msgstr ""
 
-#: ../lib/install.c:673
+#: ../lib/install.c:675
 #, c-format
 msgid "spec file in: %s\n"
 msgstr ""
 
-#: ../lib/install.c:706 ../lib/install.c:738
+#: ../lib/install.c:708 ../lib/install.c:740
 msgid "source package contains no .spec file"
 msgstr ""
 
-#: ../lib/install.c:759
+#: ../lib/install.c:761
 #, c-format
 msgid "renaming %s to %s\n"
 msgstr ""
 
-#: ../lib/install.c:882
+#: ../lib/install.c:884
 #, c-format
 msgid "package %s-%s-%s (which is newer) is already installed"
 msgstr ""
diff --git a/stamp-h b/stamp-h
deleted file mode 100644 (file)
index 9788f70..0000000
--- a/stamp-h
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
index 3fd8e21..dfcdd49 100644 (file)
 #      (Note: Above is the goal, below are the macros under development)
 #
 # The configure macro does the following:
-#
 #      optionally change to a subdirectory.
 #      attempt to update onfig.guess and config.sub.
 #      run configure with correct prefix, platform, and CFLAGS.
 #      optionally restore current directory.
+# The configure macro should be invoked as %configure (rather than %{configure})
+# because the rest of the arguments will be expanded using %*. Another
+# gotcha is that arguments, if present, should be on the same line as the
+# %configure.
 #
 %configure(C:) \
-  %{C:%{-C:pushd %{-C*}}} \
+  %{-C:pushd %{-C*}} \
   %{?__libtoolize:[ -f configure.in ] && %{__libtoolize} --copy --force} \
   CFLAGS="%{optflags}" ./configure %{_build} --prefix=%{_prefix} \
-  %{C:%{-C:popd }}
-
+  %{-C:popd}