summaryrefslogtreecommitdiff
path: root/dpkg-split
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2015-02-27 09:44:08 +0100
committerGuillem Jover <guillem@debian.org>2015-04-10 04:23:56 +0200
commitd465dca48fb9c7c03aedf6fd8f266d22085d2bec (patch)
tree51002134f1b1e6206c988eb05bc7c77f791aa977 /dpkg-split
parent9929591b148577bec771400e003c820afcb9175d (diff)
downloaddpkg-d465dca48fb9c7c03aedf6fd8f266d22085d2bec.tar.gz
Consistently use proper quotation marks all over the place
That is "" or '', and not the unbalanced `' pair.
Diffstat (limited to 'dpkg-split')
-rw-r--r--dpkg-split/info.c44
-rw-r--r--dpkg-split/join.c8
-rw-r--r--dpkg-split/main.c4
-rw-r--r--dpkg-split/queue.c25
-rw-r--r--dpkg-split/split.c4
5 files changed, 48 insertions, 37 deletions
diff --git a/dpkg-split/info.c b/dpkg-split/info.c
index 80f928f0b..d773dc0ae 100644
--- a/dpkg-split/info.c
+++ b/dpkg-split/info.c
@@ -52,7 +52,8 @@ parse_intmax(const char *value, const char *fn, const char *what)
errno = 0;
r = strtoimax(value, &endp, 10);
if (value == endp || *endp)
- ohshit(_("file `%.250s' is corrupt - bad digit (code %d) in %s"),fn,*endp,what);
+ ohshit(_("file '%.250s' is corrupt - bad digit (code %d) in %s"),
+ fn, *endp, what);
if (r < 0 || errno == ERANGE)
ohshit(_("file '%s' is corrupt; out of range integer in %s"), fn, what);
return r;
@@ -62,10 +63,12 @@ static char *nextline(char **ripp, const char *fn, const char *what) {
char *newline, *rip;
rip= *ripp;
- if (!rip) ohshit(_("file `%.250s' is corrupt - %.250s missing"),fn,what);
+ if (!rip)
+ ohshit(_("file '%.250s' is corrupt - %.250s missing"), fn, what);
newline= strchr(rip,'\n');
if (!newline)
- ohshit(_("file `%.250s' is corrupt - missing newline after %.250s"),fn,what);
+ ohshit(_("file '%.250s' is corrupt - missing newline after %.250s"),
+ fn, what);
*ripp= newline+1;
while (newline > rip && c_isspace(newline[-1]))
newline--;
@@ -107,7 +110,7 @@ struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir)
if (strncmp(arh.ar_name, PARTMAGIC, sizeof(arh.ar_name)) != 0)
return NULL;
if (dpkg_ar_member_is_illegal(&arh))
- ohshit(_("file `%.250s' is corrupt - bad magic at end of first header"),fn);
+ ohshit(_("file '%.250s' is corrupt - bad magic at end of first header"), fn);
thisilen = dpkg_ar_member_get_size(fn, &arh);
if (thisilen >= readinfobuflen) {
readinfobuflen= thisilen+1;
@@ -117,11 +120,12 @@ struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir)
if (thisilen & 1) {
c= getc(partfile); if (c==EOF) rerreof(partfile,fn);
if (c != '\n')
- ohshit(_("file `%.250s' is corrupt - bad padding character (code %d)"),fn,c);
+ ohshit(_("file '%.250s' is corrupt - bad padding character (code %d)"),
+ fn, c);
}
readinfobuf[thisilen] = '\0';
if (memchr(readinfobuf,0,thisilen))
- ohshit(_("file `%.250s' is corrupt - nulls in info section"),fn);
+ ohshit(_("file '%.250s' is corrupt - nulls in info section"), fn);
ir->filename= fn;
@@ -139,7 +143,8 @@ struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir)
ir->md5sum = nfstrsave(nextline(&rip, fn, _("package file MD5 checksum")));
if (strlen(ir->md5sum) != MD5HASHLEN ||
strspn(ir->md5sum, "0123456789abcdef") != MD5HASHLEN)
- ohshit(_("file `%.250s' is corrupt - bad MD5 checksum `%.250s'"),fn,ir->md5sum);
+ ohshit(_("file '%.250s' is corrupt - bad MD5 checksum '%.250s'"),
+ fn, ir->md5sum);
ir->orglength = parse_intmax(nextline(&rip, fn, _("archive total size")),
fn, _("archive total size"));
@@ -158,7 +163,7 @@ struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir)
ir->maxpartn= templong;
templong = parse_intmax(partnums, fn, _("archive parts number"));
if (templong <= 0 || templong > ir->maxpartn)
- ohshit(_("file '%.250s' is corrupt - bad archive part number"),fn);
+ ohshit(_("file '%.250s' is corrupt - bad archive part number"), fn);
ir->thispartn= templong;
/* If the package was created with dpkg 1.16.1 or later it will include
@@ -173,30 +178,31 @@ struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir)
dpkg_ar_normalize_name(&arh);
if (dpkg_ar_member_is_illegal(&arh))
- ohshit(_("file `%.250s' is corrupt - bad magic at end of second header"),fn);
+ ohshit(_("file '%.250s' is corrupt - bad magic at end of second header"), fn);
if (strncmp(arh.ar_name,"data",4))
- ohshit(_("file `%.250s' is corrupt - second member is not data member"),fn);
+ ohshit(_("file '%.250s' is corrupt - second member is not data member"), fn);
ir->thispartlen = dpkg_ar_member_get_size(fn, &arh);
ir->thispartoffset= (ir->thispartn-1)*ir->maxpartlen;
if (ir->maxpartn != (ir->orglength+ir->maxpartlen-1)/ir->maxpartlen)
- ohshit(_("file `%.250s' is corrupt - wrong number of parts for quoted sizes"),fn);
+ ohshit(_("file '%.250s' is corrupt - wrong number of parts for quoted sizes"), fn);
if (ir->thispartlen !=
(ir->thispartn == ir->maxpartn
? ir->orglength - ir->thispartoffset : ir->maxpartlen))
- ohshit(_("file `%.250s' is corrupt - size is wrong for quoted part number"),fn);
+ ohshit(_("file '%.250s' is corrupt - size is wrong for quoted part number"), fn);
ir->filesize = (strlen(DPKG_AR_MAGIC) +
sizeof(arh) + thisilen + (thisilen & 1) +
sizeof(arh) + ir->thispartlen + (ir->thispartlen & 1));
- if (fstat(fileno(partfile),&stab)) ohshite(_("unable to fstat part file `%.250s'"),fn);
+ if (fstat(fileno(partfile), &stab))
+ ohshite(_("unable to fstat part file '%.250s'"), fn);
if (S_ISREG(stab.st_mode)) {
/* Don't do this check if it's coming from a pipe or something. It's
* only an extra sanity check anyway. */
if (stab.st_size < ir->filesize)
- ohshit(_("file `%.250s' is corrupt - too short"),fn);
+ ohshit(_("file '%.250s' is corrupt - too short"), fn);
}
ir->headerlen = strlen(DPKG_AR_MAGIC) +
@@ -209,9 +215,10 @@ void mustgetpartinfo(const char *filename, struct partinfo *ri) {
FILE *part;
part= fopen(filename,"r");
- if (!part) ohshite(_("cannot open archive part file `%.250s'"),filename);
+ if (!part)
+ ohshite(_("cannot open archive part file '%.250s'"), filename);
if (!read_info(part,filename,ri))
- ohshite(_("file `%.250s' is not an archive part"),filename);
+ ohshite(_("file '%.250s' is not an archive part"), filename);
fclose(part);
}
@@ -256,13 +263,14 @@ do_info(const char *const *argv)
while ((thisarg= *argv++)) {
part= fopen(thisarg,"r");
- if (!part) ohshite(_("cannot open archive part file `%.250s'"),thisarg);
+ if (!part)
+ ohshite(_("cannot open archive part file '%.250s'"), thisarg);
pi= read_info(part,thisarg,&ps);
fclose(part);
if (pi) {
print_info(pi);
} else {
- printf(_("file `%s' is not an archive part\n"),thisarg);
+ printf(_("file '%s' is not an archive part\n"), thisarg);
}
m_output(stdout, _("<standard output>"));
}
diff --git a/dpkg-split/join.c b/dpkg-split/join.c
index f4a00a909..f77be44a6 100644
--- a/dpkg-split/join.c
+++ b/dpkg-split/join.c
@@ -49,13 +49,13 @@ void reassemble(struct partinfo **partlist, const char *outputfile) {
fd_out = creat(outputfile, 0644);
if (fd_out < 0)
- ohshite(_("unable to open output file `%.250s'"), outputfile);
+ ohshite(_("unable to open output file '%.250s'"), outputfile);
for (i=0; i<partlist[0]->maxpartn; i++) {
struct partinfo *pi = partlist[i];
fd_in = open(pi->filename, O_RDONLY);
if (fd_in < 0)
- ohshite(_("unable to (re)open input part file `%.250s'"), pi->filename);
+ ohshite(_("unable to (re)open input part file '%.250s'"), pi->filename);
if (fd_skip(fd_in, pi->headerlen, &err) < 0)
ohshit(_("cannot skip split package header for '%s': %s"), pi->filename,
err.str);
@@ -87,12 +87,12 @@ void addtopartlist(struct partinfo **partlist,
pi->maxpartlen != refi->maxpartlen) {
print_info(pi);
print_info(refi);
- ohshit(_("files `%.250s' and `%.250s' are not parts of the same file"),
+ ohshit(_("files '%.250s' and '%.250s' are not parts of the same file"),
pi->filename,refi->filename);
}
i= pi->thispartn-1;
if (partlist[i])
- ohshit(_("there are several versions of part %d - at least `%.250s' and `%.250s'"),
+ ohshit(_("there are several versions of part %d - at least '%.250s' and '%.250s'"),
pi->thispartn, pi->filename, partlist[i]->filename);
partlist[i]= pi;
}
diff --git a/dpkg-split/main.c b/dpkg-split/main.c
index 752f7f2ac..8a80384bb 100644
--- a/dpkg-split/main.c
+++ b/dpkg-split/main.c
@@ -45,7 +45,7 @@
static void DPKG_ATTR_NORET
printversion(const struct cmdinfo *cip, const char *value)
{
- printf(_("Debian `%s' package split/join tool; version %s.\n"),
+ printf(_("Debian '%s' package split/join tool; version %s.\n"),
SPLITTER, DPKG_VERSION_ARCH);
printf(_(
@@ -124,7 +124,7 @@ set_part_size(const struct cmdinfo *cip, const char *value)
errno = 0;
newpartsize = strtoimax(value, &endp, 10);
if (value == endp || *endp)
- badusage(_("invalid integer for --%s: `%.250s'"), cip->olong, value);
+ badusage(_("invalid integer for --%s: '%.250s'"), cip->olong, value);
if (newpartsize <= 0 || newpartsize > (INT_MAX >> 10) || errno == ERANGE)
badusage(_("part size is far too large or is not positive"));
diff --git a/dpkg-split/queue.c b/dpkg-split/queue.c
index 33323999e..cbc33505a 100644
--- a/dpkg-split/queue.c
+++ b/dpkg-split/queue.c
@@ -92,7 +92,7 @@ scandepot(void)
depot = opendir(opt_depotdir);
if (!depot)
- ohshite(_("unable to read depot directory `%.250s'"), opt_depotdir);
+ ohshite(_("unable to read depot directory '%.250s'"), opt_depotdir);
while ((de= readdir(depot))) {
struct partqueue *pq;
char *p;
@@ -149,10 +149,11 @@ do_auto(const char *const *argv)
refi= nfmalloc(sizeof(struct partqueue));
part= fopen(partfile,"r");
- if (!part) ohshite(_("unable to read part file `%.250s'"),partfile);
+ if (!part)
+ ohshite(_("unable to read part file '%.250s'"), partfile);
if (!read_info(part,partfile,refi)) {
if (!opt_npquiet)
- printf(_("File `%.250s' is not part of a multipart archive.\n"),partfile);
+ printf(_("File '%.250s' is not part of a multipart archive.\n"), partfile);
m_output(stdout, _("<standard output>"));
return 1;
}
@@ -190,10 +191,10 @@ do_auto(const char *const *argv)
fd_src = open(partfile, O_RDONLY);
if (fd_src < 0)
- ohshite(_("unable to reopen part file `%.250s'"), partfile);
+ ohshite(_("unable to reopen part file '%.250s'"), partfile);
fd_dst = creat(p, 0644);
if (fd_dst < 0)
- ohshite(_("unable to open new depot file `%.250s'"), p);
+ ohshite(_("unable to open new depot file '%.250s'"), p);
if (fd_fd_copy(fd_src, fd_dst, refi->filesize, &err) < 0)
ohshit(_("cannot extract split package part '%s': %s"),
@@ -205,7 +206,8 @@ do_auto(const char *const *argv)
ohshite(_("unable to close file '%s'"), p);
close(fd_src);
- if (rename(p,q)) ohshite(_("unable to rename new depot file `%.250s' to `%.250s'"),p,q);
+ if (rename(p, q))
+ ohshite(_("unable to rename new depot file '%.250s' to '%.250s'"), p, q);
free(q);
free(p);
@@ -227,7 +229,8 @@ do_auto(const char *const *argv)
for (i=0; i<refi->maxpartn; i++)
if (partlist[i])
if (unlink(partlist[i]->filename))
- ohshite(_("unable to delete used-up depot file `%.250s'"),partlist[i]->filename);
+ ohshite(_("unable to delete used-up depot file '%.250s'"),
+ partlist[i]->filename);
}
@@ -255,7 +258,7 @@ do_queue(const char *const *argv)
if (pq->info.md5sum) continue;
fputs(gettext(head),stdout); head= "";
if (lstat(pq->info.filename,&stab))
- ohshit(_("unable to stat `%.250s'"),pq->info.filename);
+ ohshit(_("unable to stat '%.250s'"), pq->info.filename);
if (S_ISREG(stab.st_mode)) {
bytes= stab.st_size;
printf(_(" %s (%jd bytes)\n"), pq->info.filename, (intmax_t)bytes);
@@ -284,9 +287,9 @@ do_queue(const char *const *argv)
if (qq) {
printf("%d ",i+1);
if (lstat(qq->info.filename,&stab))
- ohshite(_("unable to stat `%.250s'"),qq->info.filename);
+ ohshite(_("unable to stat '%.250s'"), qq->info.filename);
if (!S_ISREG(stab.st_mode))
- ohshit(_("part file `%.250s' is not a plain file"),qq->info.filename);
+ ohshit(_("part file '%.250s' is not a plain file"), qq->info.filename);
bytes+= stab.st_size;
/* Don't find this package again. */
@@ -326,7 +329,7 @@ discard_parts(struct partqueue *queue, enum discard_which which,
internerr("unknown discard_which '%d'", which);
}
if (unlink(pq->info.filename))
- ohshite(_("unable to discard `%.250s'"),pq->info.filename);
+ ohshite(_("unable to discard '%.250s'"), pq->info.filename);
printf(_("Deleted %s.\n"),pq->info.filename);
}
}
diff --git a/dpkg-split/split.c b/dpkg-split/split.c
index 28ad64656..fbfa96baa 100644
--- a/dpkg-split/split.c
+++ b/dpkg-split/split.c
@@ -129,11 +129,11 @@ mksplit(const char *file_src, const char *prefix, off_t maxpartsize,
fd_src = open(file_src, O_RDONLY);
if (fd_src < 0)
- ohshite(_("unable to open source file `%.250s'"), file_src);
+ ohshite(_("unable to open source file '%.250s'"), file_src);
if (fstat(fd_src, &st))
ohshite(_("unable to fstat source file"));
if (!S_ISREG(st.st_mode))
- ohshit(_("source file `%.250s' not a plain file"), file_src);
+ ohshit(_("source file '%.250s' not a plain file"), file_src);
if (fd_md5(fd_src, hash, -1, &err) < 0)
ohshit(_("cannot compute MD5 hash for file '%s': %s"),