From a4adb1a09f2f5fcb86980b3c300bf8b9cdf4bae5 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Wed, 20 Dec 2000 07:42:03 +0000 Subject: * main/processarc.c: Don't copy trailing zeros from dpkg-deb pipe. * main/archives.c: Fix some i8ln. * dpkg-deb/extract.c: Remove skipmember(), and use the buffer copy code. --- ChangeLog | 8 +++ dpkg-deb/extract.c | 14 +---- main/archives.c | 10 ++-- main/processarc.c | 1 - po/dpkg.pot | 151 +++++++++++++++++++++++++---------------------------- 5 files changed, 87 insertions(+), 97 deletions(-) diff --git a/ChangeLog b/ChangeLog index 181960671..de64512f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Dec 20 01:39:30 CST 2000 Adam Heath + + * main/processarc.c: Don't copy trailing zeros from dpkg-deb + pipe. + * main/archives.c: Fix some i8ln. + * dpkg-deb/extract.c: Remove skipmember(), and use the buffer + copy code. + Wed Dec 20 01:31:28 CST 2000 Adam Heath * lib/nfmalloc.c, lib/parsehelp.c: Lesson the memory footprint. diff --git a/dpkg-deb/extract.c b/dpkg-deb/extract.c index b6df1075e..6ef82153c 100644 --- a/dpkg-deb/extract.c +++ b/dpkg-deb/extract.c @@ -79,16 +79,6 @@ static unsigned long parseheaderlength(const char *inh, size_t len, return r; } -static void skipmember(FILE *ar, const char *fn, long memberlen) { - int c; - - memberlen += (memberlen&1); - while (memberlen > 0) { - if ((c= getc(ar)) == EOF) readfail(ar,fn,_("skipped member data")); - memberlen--; - } -} - void extracthalf(const char *debar, const char *directory, const char *taroption, int admininfo) { char versionbuf[40]; @@ -157,7 +147,7 @@ void extracthalf(const char *debar, const char *directory, /* Members with `_' are noncritical, and if we don't understand them * we skip them. */ - skipmember(ar,debar,memberlen); + stream_null_copy(ar, memberlen + (memberlen&1),_("skipped member data from %s"), debar); } else { adminmember= (!memcmp(arh.ar_name,ADMINMEMBER,sizeof(arh.ar_name)) || @@ -175,7 +165,7 @@ void extracthalf(const char *debar, const char *directory, ctrllennum= memberlen; } if (!adminmember != !admininfo) { - skipmember(ar,debar,memberlen); + stream_null_copy(ar, memberlen + (memberlen&1),_("skipped member data from %s"), debar); } else { break; /* Yes ! - found it. */ } diff --git a/main/archives.c b/main/archives.c index d1357f549..9b1a15a15 100644 --- a/main/archives.c +++ b/main/archives.c @@ -234,8 +234,8 @@ int tarobject(struct TarInfo *ti) { nifd->namenode->flags |= fnnf_new_inarchive; debug(dbg_eachfile, - _("tarobject ti->Name=`%s' Mode=%lo owner=%u.%u Type=%d(%c)" - " ti->LinkName=`%s' namenode=`%s' flags=%o instead=`%s'"), + "tarobject ti->Name=`%s' Mode=%lo owner=%u.%u Type=%d(%c)" + " ti->LinkName=`%s' namenode=`%s' flags=%o instead=`%s'", ti->Name, (long)ti->Mode, (unsigned)ti->UserID, (unsigned)ti->GroupID, ti->Type, ti->Type == '\0' ? '_' : ti->Type >= '0' && ti->Type <= '6' ? "-hlcbdp"[ti->Type - '0'] : '?', @@ -392,7 +392,7 @@ int tarobject(struct TarInfo *ti) { * it until we apply the proper mode, which might be a statoverride. */ fd= open(fnamenewvb.buf, (O_CREAT|O_EXCL|O_WRONLY), 0); - if (fd < 0) ohshite("unable to create 1 `%.255s'",ti->Name); + if (fd < 0) ohshite(_("unable to create `%.255s'"),ti->Name); push_cleanup(cu_closefd,ehflag_bombout, 0,0, 1,(void*)fd); debug(dbg_eachfiledetail,"tarobject NormalFile[01] open size=%lu", (unsigned long)ti->Size); @@ -400,7 +400,7 @@ int tarobject(struct TarInfo *ti) { r= ti->Size % TARBLKSZ; if (r > 0) r= read(tc->backendpipe,databuf,TARBLKSZ - r); if (nifd->namenode->statoverride) - debug(dbg_eachfile, _("tarobject ... stat override, uid=%d, gid=%d, mode=%04o"), + debug(dbg_eachfile, "tarobject ... stat override, uid=%d, gid=%d, mode=%04o", nifd->namenode->statoverride->uid, nifd->namenode->statoverride->gid, nifd->namenode->statoverride->mode); @@ -498,7 +498,7 @@ int tarobject(struct TarInfo *ti) { do { varbufextend(&symlinkfn); r= readlink(fnamevb.buf,symlinkfn.buf,symlinkfn.size); - if (r<0) ohshite("unable to read link `%.255s'",ti->Name); + if (r<0) ohshite(_("unable to read link `%.255s'"),ti->Name); } while (r == symlinkfn.size); symlinkfn.used= r; varbufaddc(&symlinkfn,0); if (symlink(symlinkfn.buf,fnametmpvb.buf)) diff --git a/main/processarc.c b/main/processarc.c index c0642ec4c..95d18d6af 100644 --- a/main/processarc.c +++ b/main/processarc.c @@ -525,7 +525,6 @@ void process_archive(const char *filename) { ohshite(_("corrupted filesystem tarfile - corrupted package archive")); } } - fd_null_copy(tc.backendpipe,-1,_("dpkg-deb: zap possible trailing zeros")); close(tc.backendpipe); waitsubproc(c1,BACKEND " --fsys-tarfile",1); diff --git a/po/dpkg.pot b/po/dpkg.pot index b4954c978..cd31fa209 100644 --- a/po/dpkg.pot +++ b/po/dpkg.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-12-20 01:32-0600\n" +"POT-Creation-Date: 2000-12-20 01:38-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -745,13 +745,6 @@ msgstr "" msgid "error setting permissions of `%.255s'" msgstr "" -#: main/archives.c:237 -#, c-format -msgid "" -"tarobject ti->Name=`%s' Mode=%lo owner=%u.%u Type=%d(%c) ti->LinkName=`%s' " -"namenode=`%s' flags=%o instead=`%s'" -msgstr "" - #: main/archives.c:250 #, c-format msgid "" @@ -801,14 +794,17 @@ msgstr "" msgid "trying to overwrite `%.250s', which is also in package %.250s" msgstr "" -#: main/archives.c:399 +#. Now that we have verified everything its time to actually +#. * build something. Lets start by making the ar-wrapper. +#. +#: dpkg-deb/build.c:367 main/archives.c:395 #, c-format -msgid "backend dpkg-deb during `%.255s'" +msgid "unable to create `%.255s'" msgstr "" -#: main/archives.c:403 +#: main/archives.c:399 #, c-format -msgid "tarobject ... stat override, uid=%d, gid=%d, mode=%04o" +msgid "backend dpkg-deb during `%.255s'" msgstr "" #: main/archives.c:416 @@ -851,6 +847,11 @@ msgstr "" msgid "unable to move aside `%.255s' to install new version" msgstr "" +#: main/archives.c:501 +#, c-format +msgid "unable to read link `%.255s'" +msgstr "" + #: main/archives.c:505 #, c-format msgid "unable to make backup symlink for `%.255s'" @@ -2383,69 +2384,65 @@ msgstr "" msgid "corrupted filesystem tarfile - corrupted package archive" msgstr "" -#: main/processarc.c:528 -msgid "dpkg-deb: zap possible trailing zeros" -msgstr "" - -#: main/processarc.c:620 +#: main/processarc.c:619 #, c-format msgid "dpkg: warning - unable to delete old file `%.250s': %s\n" msgstr "" -#: main/processarc.c:642 main/processarc.c:877 main/remove.c:287 +#: main/processarc.c:641 main/processarc.c:876 main/remove.c:287 msgid "cannot read info directory" msgstr "" -#: main/processarc.c:655 +#: main/processarc.c:654 #, c-format msgid "old version of package has overly-long info file name starting `%.250s'" msgstr "" -#: main/processarc.c:667 +#: main/processarc.c:666 #, c-format msgid "unable to remove obsolete info file `%.250s'" msgstr "" -#: main/processarc.c:670 +#: main/processarc.c:669 #, c-format msgid "unable to install (supposed) new info file `%.250s'" msgstr "" -#: main/processarc.c:677 +#: main/processarc.c:676 msgid "unable to open temp control directory" msgstr "" -#: main/processarc.c:686 +#: main/processarc.c:685 #, c-format msgid "package contains overly-long control info file name (starting `%.50s')" msgstr "" -#: main/processarc.c:691 +#: main/processarc.c:690 #, c-format msgid "package control info contained directory `%.250s'" msgstr "" -#: main/processarc.c:693 +#: main/processarc.c:692 #, c-format msgid "package control info rmdir of `%.250s' didn't say not a dir" msgstr "" -#: main/processarc.c:699 +#: main/processarc.c:698 #, c-format msgid "dpkg: warning - package %s contained list as info file" msgstr "" -#: main/processarc.c:706 +#: main/processarc.c:705 #, c-format msgid "unable to install new info file `%.250s' as `%.250s'" msgstr "" -#: main/processarc.c:857 +#: main/processarc.c:856 #, c-format msgid "(Noting disappearance of %s, which has been completely replaced.)\n" msgstr "" -#: main/processarc.c:893 +#: main/processarc.c:892 #, c-format msgid "unable to delete disappearing control info file `%.250s'" msgstr "" @@ -2782,14 +2779,6 @@ msgstr "" msgid "dpkg-deb: ignoring %d warnings about the control file(s)\n" msgstr "" -#. Now that we have verified everything its time to actually -#. * build something. Lets start by making the ar-wrapper. -#. -#: dpkg-deb/build.c:367 -#, c-format -msgid "unable to create `%.255s'" -msgstr "" - #: dpkg-deb/build.c:368 #, c-format msgid "unable to unbuffer `%.255s'" @@ -2893,182 +2882,186 @@ msgstr "" msgid "file `%.250s' is corrupt - bad digit (code %d) in %s" msgstr "" -#: dpkg-deb/extract.c:87 -msgid "skipped member data" -msgstr "" - -#: dpkg-deb/extract.c:118 +#: dpkg-deb/extract.c:108 #, c-format msgid "failed to read archive `%.255s'" msgstr "" -#: dpkg-deb/extract.c:119 +#: dpkg-deb/extract.c:109 msgid "failed to fstat archive" msgstr "" -#: dpkg-deb/extract.c:120 +#: dpkg-deb/extract.c:110 msgid "version number" msgstr "" -#: dpkg-deb/extract.c:129 +#: dpkg-deb/extract.c:119 msgid "between members" msgstr "" -#: dpkg-deb/extract.c:131 split/info.c:94 +#: dpkg-deb/extract.c:121 split/info.c:94 #, c-format msgid "file `%.250s' is corrupt - bad magic at end of first header" msgstr "" -#: dpkg-deb/extract.c:135 +#: dpkg-deb/extract.c:125 #, c-format msgid "file `%.250s' is corrupt - negative member length %ld" msgstr "" -#: dpkg-deb/extract.c:139 +#: dpkg-deb/extract.c:129 #, c-format msgid "file `%.250s' is not a debian binary archive (try dpkg-split?)" msgstr "" -#: dpkg-deb/extract.c:142 +#: dpkg-deb/extract.c:132 msgid "header info member" msgstr "" -#: dpkg-deb/extract.c:145 +#: dpkg-deb/extract.c:135 msgid "archive has no newlines in header" msgstr "" -#: dpkg-deb/extract.c:148 +#: dpkg-deb/extract.c:138 msgid "archive has no dot in version number" msgstr "" -#: dpkg-deb/extract.c:151 +#: dpkg-deb/extract.c:141 #, c-format msgid "archive version %.250s not understood, get newer dpkg-deb" msgstr "" -#: dpkg-deb/extract.c:169 +#. Members with `_' are noncritical, and if we don't understand them +#. * we skip them. +#. +#: dpkg-deb/extract.c:150 dpkg-deb/extract.c:168 +#, c-format +msgid "skipped member data from %s" +msgstr "" + +#: dpkg-deb/extract.c:159 #, c-format msgid "file `%.250s' contains ununderstood data member %.*s, giving up" msgstr "" -#: dpkg-deb/extract.c:174 +#: dpkg-deb/extract.c:164 #, c-format msgid "file `%.250s' contains two control members, giving up" msgstr "" -#: dpkg-deb/extract.c:186 +#: dpkg-deb/extract.c:176 #, c-format msgid "" " new debian package, version %s.\n" " size %ld bytes: control archive= %ld bytes.\n" msgstr "" -#: dpkg-deb/extract.c:198 +#: dpkg-deb/extract.c:188 msgid "ctrl information length" msgstr "" -#: dpkg-deb/extract.c:200 +#: dpkg-deb/extract.c:190 #, c-format msgid "archive has malformatted ctrl len `%s'" msgstr "" -#: dpkg-deb/extract.c:203 +#: dpkg-deb/extract.c:193 #, c-format msgid "" " old debian package, version %s.\n" " size %ld bytes: control archive= %ld, main archive= %ld.\n" msgstr "" -#: dpkg-deb/extract.c:212 +#: dpkg-deb/extract.c:202 msgid "ctrlarea" msgstr "" -#: dpkg-deb/extract.c:218 +#: dpkg-deb/extract.c:208 msgid "" "dpkg-deb: file looks like it might be an archive which has been\n" "dpkg-deb: corrupted by being downloaded in ASCII mode\n" msgstr "" -#: dpkg-deb/extract.c:223 +#: dpkg-deb/extract.c:213 #, c-format msgid "`%.255s' is not a debian format archive" msgstr "" -#: dpkg-deb/extract.c:228 +#: dpkg-deb/extract.c:218 msgid "fgetpos failed" msgstr "" -#: dpkg-deb/extract.c:232 +#: dpkg-deb/extract.c:222 msgid "fsetpos failed" msgstr "" -#: dpkg-deb/extract.c:239 +#: dpkg-deb/extract.c:229 msgid "failed to fdopen p1 in paste" msgstr "" -#: dpkg-deb/extract.c:241 +#: dpkg-deb/extract.c:231 msgid "failed to write to gzip -dc" msgstr "" -#: dpkg-deb/extract.c:242 +#: dpkg-deb/extract.c:232 msgid "failed to close gzip -dc" msgstr "" -#: dpkg-deb/extract.c:249 +#: dpkg-deb/extract.c:239 msgid "failed to syscall lseek to files archive portion" msgstr "" -#: dpkg-deb/extract.c:257 +#: dpkg-deb/extract.c:247 msgid "failed to write to pipe in copy" msgstr "" -#: dpkg-deb/extract.c:258 +#: dpkg-deb/extract.c:248 msgid "failed to close pipe in copy" msgstr "" -#: dpkg-deb/extract.c:281 +#: dpkg-deb/extract.c:271 #, c-format msgid "internal gzip error: `%s'" msgstr "" -#: dpkg-deb/extract.c:287 +#: dpkg-deb/extract.c:277 msgid "failed to exec gzip -dc" msgstr "" -#: dpkg-deb/extract.c:296 +#: dpkg-deb/extract.c:286 msgid "failed to create directory" msgstr "" -#: dpkg-deb/extract.c:297 +#: dpkg-deb/extract.c:287 msgid "failed to chdir to directory after creating it" msgstr "" -#: dpkg-deb/extract.c:299 +#: dpkg-deb/extract.c:289 msgid "failed to chdir to directory" msgstr "" -#: dpkg-deb/extract.c:313 +#: dpkg-deb/extract.c:303 msgid "failed to exec tar" msgstr "" -#: dpkg-deb/extract.c:336 dpkg-deb/extract.c:351 dpkg-deb/info.c:66 +#: dpkg-deb/extract.c:326 dpkg-deb/extract.c:341 dpkg-deb/info.c:66 #, c-format msgid "--%s needs a .deb filename argument" msgstr "" -#: dpkg-deb/extract.c:339 +#: dpkg-deb/extract.c:329 #, c-format msgid "" "--%s needs a target directory.\n" "Perhaps you should be using dpkg --install ?" msgstr "" -#: dpkg-deb/extract.c:342 +#: dpkg-deb/extract.c:332 #, c-format msgid "--%s takes at most two arguments (.deb and directory)" msgstr "" -#: dpkg-deb/extract.c:353 +#: dpkg-deb/extract.c:343 #, c-format msgid "--%s takes only one argument (.deb filename)" msgstr "" -- cgit v1.2.3