- fix: more debugedit.c problems.
authorjbj <devnull@localhost>
Mon, 27 Jan 2003 17:45:53 +0000 (17:45 +0000)
committerjbj <devnull@localhost>
Mon, 27 Jan 2003 17:45:53 +0000 (17:45 +0000)
CVS patchset: 6029
CVS date: 2003/01/27 17:45:53

25 files changed:
CHANGES
doc/rpmbuild.8
po/cs.po
po/da.po
po/de.po
po/fi.po
po/fr.po
po/gl.po
po/is.po
po/ja.po
po/ko.po
po/no.po
po/pl.po
po/pt.po
po/pt_BR.po
po/ro.po
po/rpm.pot
po/ru.po
po/sk.po
po/sl.po
po/sr.po
po/sv.po
po/tr.po
rpm.spec.in
tools/debugedit.c

diff --git a/CHANGES b/CHANGES
index d4cc159..bb824ea 100644 (file)
--- a/CHANGES
+++ b/CHANGES
        - file conflict checks with colors.
        - fix: debugedit.c problem.
        - permit anaconda to choose "presentation order".
+       - fix: more debugedit.c problems.
 
 4.0.4 -> 4.1:
        - loosely wire beecrypt library into rpm.
index cf39d73..e6aa18d 100644 (file)
@@ -181,7 +181,7 @@ for configuration details.
 When building the package, interpret \fIPLATFORM\fR
 as \fBarch-vendor-os\fR and set the macros
 \fB%_target\fR,
-\fB%_target_arch\fR, and
+\fB%_target_cpu\fR, and
 \fB%_target_os\fR
 accordingly.
 .SS "REBUILD AND RECOMPILE OPTIONS"
index c97c2bb..39b971f 100644 (file)
--- a/po/cs.po
+++ b/po/cs.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 2001-07-24 10:02+0100\n"
 "Last-Translator: Milan Kerslager <kerslage@linux.cz>\n"
 "Language-Team: Czech <cs@li.org>\n"
index cc144f0..a0630de 100644 (file)
--- a/po/da.po
+++ b/po/da.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 2001-04-05 23:03GMT\n"
 "Last-Translator: Claus Hindsgaul <claus_h@image.dk>\n"
 "Language-Team: Danish <dansk@klid.dk>\n"
index 523099d..35eac41 100644 (file)
--- a/po/de.po
+++ b/po/de.po
@@ -37,7 +37,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 1998-08-03 18:02+02:00\n"
 "Last-Translator: Karl Eichwalder <ke@SuSE.DE>\n"
 "Language-Team: German <de@li.org>\n"
index 76a7324..00de6c0 100644 (file)
--- a/po/fi.po
+++ b/po/fi.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 1998-05-02 21:41:47-0400\n"
 "Last-Translator: Raimo Koski <rkoski@pp.weppi.fi>\n"
 "Language-Team: Finnish <linux@sot.com>\n"
index 6c29ebf..d153403 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-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"
index 65dbc80..d3fcf65 100644 (file)
--- a/po/gl.po
+++ b/po/gl.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.1\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 2001-01-13 22:31+0100\n"
 "Last-Translator: Jesús Bravo Álvarez <jba@pobox.com>\n"
 "Language-Team: Galician <trasno@ceu.fi.udc.es>\n"
index 978955a..0612f2e 100644 (file)
--- a/po/is.po
+++ b/po/is.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 2001-07-12 13:25+0000\n"
 "Last-Translator: Richard Allen <ra@hp.is>\n"
 "Language-Team: is <kde-isl@mmedia.is>\n"
index 54c6117..e6e5718 100644 (file)
--- a/po/ja.po
+++ b/po/ja.po
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 1999-12-01 22:49 +JST\n"
 "Last-Translator: Kanda Mitsuru <kanda@nn.iij4u.or.jp>\n"
 "Language-Team: JRPM <jrpm@linux.or.jp>\n"
index 1e589aa..8409919 100644 (file)
--- a/po/ko.po
+++ b/po/ko.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.4\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 2002-03-04 17:17+0900\n"
 "Last-Translator: Jong-Hoon Ryu <redhat4u@netian.com>\n"
 "Language-Team: GNU Translation project <ko@li.org>\n"
index 208585e..22c79b1 100644 (file)
--- a/po/no.po
+++ b/po/no.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 2001-06-27 12:24+0200\n"
 "Last-Translator: Kjartan Maraas <kmaraas@gnome.org>\n"
 "Language-Team: Norwegian <no@li.org>\n"
index 01f1f67..7ed9f0f 100644 (file)
--- a/po/pl.po
+++ b/po/pl.po
@@ -8,7 +8,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 1999-05-25 17:00+0100\n"
 "Last-Translator: Pawe³ Dziekoñski <pdziekonski@mml.ch.pwr.wroc.pl>\n"
 "Language-Team: Polish <pl@li.org>\n"
index c3f2a23..10ea0ad 100644 (file)
--- a/po/pt.po
+++ b/po/pt.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 2002-02-14 10:51+0000\n"
 "Last-Translator: José Nuno Coelho Sanarra Pires <jncp@rnl.ist.utl.pt>\n"
 "Language-Team: pt <morais@kde.org\n"
index 4f369d0..40aca52 100644 (file)
@@ -4,7 +4,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=ISO-8859-1\n"
 "Content-Transfer-Encoding: 8-bit\n"
index f386b46..06a842b 100644 (file)
--- a/po/ro.po
+++ b/po/ro.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 1999-04-10 12:00+EST\n"
 "Last-Translator: Cristian Gafton <gafton@redhat.com>\n"
 "Language-Team: Romanian <ro@li.org>\n"
index ae7034f..c9c1f52 100644 (file)
@@ -7,7 +7,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-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"
index c7a2c7a..4435da4 100644 (file)
--- a/po/ru.po
+++ b/po/ru.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 2002-08-27 13:36-0400\n"
 "Last-Translator: Eugene Kanter, <eugene@blackcatlinux.com>\n"
 "Language-Team: Black Cat Linux Team <blackcat-support@blackcatlinux.com>\n"
index 107b408..9cec33a 100644 (file)
--- a/po/sk.po
+++ b/po/sk.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 1999-04-08 21:37+02:00\n"
 "Last-Translator: Stanislav Meduna <stano@eunet.sk>\n"
 "Language-Team: Slovak <sk-i18n@rak.isternet.sk>\n"
index 9a7f5f5..a696677 100644 (file)
--- a/po/sl.po
+++ b/po/sl.po
@@ -1,12 +1,12 @@
 # -*- mode:po; coding:iso-latin-2; -*- Slovenian messages for Redhat pkg. mngr.
 # Copyright (C) 2000 Free Software Foundation, Inc.
 # Primo¾ Peterlin <primoz.peterlin@biofiz.mf.uni-lj.si>, 2000.
-# $Id: sl.po,v 1.368 2003/01/25 21:00:01 jbj Exp $
+# $Id: sl.po,v 1.369 2003/01/27 17:46:37 jbj Exp $
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 2000-10-08 19:05+0200\n"
 "Last-Translator: Grega Fajdiga <gregor.fajdiga@telemach.net>\n"
 "Language-Team: Slovenian <sl@li.org>\n"
index 22330cf..c3cd294 100644 (file)
--- a/po/sr.po
+++ b/po/sr.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=iso-8859-2\n"
 "Content-Transfer-Encoding: 8bit\n"
index 429acc8..77d90ab 100644 (file)
--- a/po/sv.po
+++ b/po/sv.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.1\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 2002-08-19 22:26+0200\n"
 "Last-Translator: Göran Uddeborg <goeran@uddeborg.pp.se>\n"
 "Language-Team: Swedish <sv@li.org>\n"
index 78a17c9..0d77d87 100644 (file)
--- a/po/tr.po
+++ b/po/tr.po
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2003-01-25 15:52-0500\n"
+"POT-Creation-Date: 2003-01-27 12:37-0500\n"
 "PO-Revision-Date: 2001-07-05 08:02+300\n"
 "Last-Translator: Nilgun Belma Buguner <nilgun@technologist.com>\n"
 "Language-Team: Turkish <tr@li.org>\n"
index 953ae29..a2a4029 100644 (file)
@@ -20,7 +20,7 @@ Name: rpm
 %define version @VERSION@
 Version: %{version}
 %{expand: %%define rpm_version %{version}}
-Release: 0.61
+Release: 0.62
 Group: System Environment/Base
 Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{rpm_version}.tar.gz
 Copyright: GPL
@@ -470,7 +470,10 @@ exit 0
 %{__includedir}/popt.h
 
 %changelog
-* Wed Jan 22 2003 Jeff Johnson <jbj@redhat.com> 4.2-0.61
+* Mon Jan 27 2003 Jeff Johnson <jbj@redhat.com> 4.2-0.67
+- fix: more debugedit.c problems.
+
+* Sat Jan 25 2003 Jeff Johnson <jbj@redhat.com> 4.2-0.61
 - permit anaconda to choose "presentation order".
 
 * Wed Jan 22 2003 Jeff Johnson <jbj@redhat.com> 4.2-0.60
index cea9712..26f4f54 100644 (file)
@@ -38,6 +38,8 @@
 
 #include "hashtab.h"
 
+#define DW_TAG_partial_unit 0x3c
+
 char *base_dir = NULL;
 char *dest_dir = NULL;
 char *list_file = NULL;
@@ -424,6 +426,7 @@ edit_dwarf2_line (DSO *dso, uint_32 off, char *comp_dir, int phase)
   unsigned char opcode_base;
   uint_32 value, dirt_cnt;
   size_t comp_dir_len = strlen (comp_dir);
+  size_t abs_file_cnt = 0, abs_dir_cnt = 0;
 
   if (phase != 0)
     return 0;
@@ -509,7 +512,11 @@ edit_dwarf2_line (DSO *dso, uint_32 off, char *comp_dir, int phase)
          return 1;
        }
       if (*file == '/')
-       memcpy (s, file, file_len + 1);
+       {
+         memcpy (s, file, file_len + 1);
+         if (dest_dir && has_prefix (file, base_dir))
+           ++abs_file_cnt;
+       }
       else if (*dirt[value] == '/')
        {
          memcpy (s, dirt[value], dir_len);
@@ -556,28 +563,90 @@ edit_dwarf2_line (DSO *dso, uint_32 off, char *comp_dir, int phase)
       read_uleb128 (ptr);
       read_uleb128 (ptr);
     }
+  ++ptr;
   
   if (dest_dir)
     {
-      ptr = dir;
-      while (*ptr != 0)
+      unsigned char *srcptr, *buf = NULL;
+      size_t base_len = strlen (base_dir);
+      size_t dest_len = strlen (dest_dir);
+
+      if (dest_len == base_len)
+       abs_file_cnt = 0;
+      if (abs_file_cnt)
+       {
+         srcptr = buf = malloc (ptr - dir);
+         memcpy (srcptr, dir, ptr - dir);
+         ptr = dir;
+       }
+      else
+       ptr = srcptr = dir;
+      while (*srcptr != 0)
        {
-         if (*ptr == '/' && has_prefix (ptr, base_dir))
+         size_t len = strlen (srcptr) + 1;
+
+         if (*srcptr == '/' && has_prefix (srcptr, base_dir))
            {
-             size_t base_len = strlen (base_dir);
-             size_t dest_len = strlen (dest_dir);
+             memcpy (ptr, dest_dir, dest_len);
+             if (dest_len < base_len)
+               {
+                 memmove (ptr + dest_len, srcptr + base_len,
+                          len - base_len);
+                 ptr += dest_len - base_len;
+                 ++abs_dir_cnt;
+               }
+             elf_flagdata (debug_sections[DEBUG_STR].elf_data,
+                           ELF_C_SET, ELF_F_DIRTY);
+           }
+         else if (ptr != srcptr)
+           memmove (ptr, srcptr, len);
+         srcptr += len;
+         ptr += len;
+       }
+
+      if (abs_dir_cnt + abs_file_cnt != 0)
+       {
+         size_t len = (abs_dir_cnt + abs_file_cnt) * (base_len - dest_len);
 
+         if (len == 1)
+           error (EXIT_FAILURE, 0, "-b arg has to be either the same length as -d arg, or more than 1 char shorter");
+         memset (ptr, 'X', len - 1);
+         ptr += len - 1;
+         *ptr++ = '\0';
+       }
+      *ptr++ = '\0';
+      ++srcptr;
+
+      while (*srcptr != 0)
+       {
+         size_t len = strlen (srcptr) + 1;
+
+         if (*srcptr == '/' && has_prefix (srcptr, base_dir))
+           {
              memcpy (ptr, dest_dir, dest_len);
              if (dest_len < base_len)
                {
-                 memmove (ptr + dest_len, ptr + base_len,
-                          strlen (dir + base_len) + 1);
+                 memmove (ptr + dest_len, srcptr + base_len,
+                          len - base_len);
+                 ptr += dest_len - base_len;
                }
              elf_flagdata (debug_sections[DEBUG_STR].elf_data,
                            ELF_C_SET, ELF_F_DIRTY);
            }
-         ptr = strchr (ptr, 0) + 1;
+         else if (ptr != srcptr)
+           memmove (ptr, srcptr, len);
+         srcptr += len;
+         ptr += len;
+         dir = srcptr;
+         read_uleb128 (srcptr);
+         read_uleb128 (srcptr);
+         read_uleb128 (srcptr);
+         if (ptr != dir)
+           memmove (ptr, dir, srcptr - dir);
+         ptr += srcptr - dir;
        }
+      *ptr = '\0';
+      free (buf);
     }
   return 0;
 }
@@ -613,13 +682,14 @@ edit_attributes (DSO *dso, unsigned char *ptr, struct abbrev_tag *t, int phase)
                }
            }
 
-         if (debug_sections[DEBUG_STR].data &&
-             t->attr[i].attr == DW_AT_comp_dir &&
-             form == DW_FORM_strp)
+         if (t->attr[i].attr == DW_AT_comp_dir &&
+             form == DW_FORM_strp &&
+             debug_sections[DEBUG_STR].data)
            {
              char *dir;
              
              dir = debug_sections[DEBUG_STR].data + do_read_32 (ptr);
+             free (comp_dir);
              comp_dir = strdup (dir);
 
              if (phase == 1 && dest_dir && has_prefix (dir, base_dir))
@@ -637,7 +707,45 @@ edit_attributes (DSO *dso, unsigned char *ptr, struct abbrev_tag *t, int phase)
                                ELF_C_SET, ELF_F_DIRTY);
                }
            }
-         
+         else if ((t->tag == DW_TAG_compile_unit
+                   || t->tag == DW_TAG_partial_unit)
+                  && t->attr[i].attr == DW_AT_name
+                  && form == DW_FORM_strp
+                  && debug_sections[DEBUG_STR].data)
+           {
+             char *name;
+             
+             name = debug_sections[DEBUG_STR].data + do_read_32 (ptr);
+             if (*name == '/' && comp_dir == NULL)
+               {
+                 char *enddir = strrchr (name, '/');
+
+                 if (enddir != name)
+                   {
+                     comp_dir = malloc (enddir - name + 1);
+                     memcpy (comp_dir, name, enddir - name);
+                     comp_dir [enddir - name] = '\0';
+                   }
+                 else
+                   comp_dir = strdup ("/");
+               }
+
+             if (phase == 1 && dest_dir && has_prefix (name, base_dir))
+               {
+                 base_len = strlen (base_dir);
+                 dest_len = strlen (dest_dir);
+                 
+                 memcpy (name, dest_dir, dest_len);
+                 if (dest_len < base_len)
+                   {
+                     memmove (name + dest_len, name + base_len,
+                              strlen (name + base_len) + 1);
+                   }
+                 elf_flagdata (debug_sections[DEBUG_STR].elf_data,
+                               ELF_C_SET, ELF_F_DIRTY);
+               }
+           }
+
          switch (form)
            {
            case DW_FORM_addr:
@@ -1115,5 +1223,3 @@ main (int argc, char *argv[])
 
   return 0;
 }
-
-