+2007-08-08 Guillem Jover <guillem@debian.org>
+
+ * dpkg-deb/build.c (do_build): Use NULL instead of '(char *)0'.
+ * dpkg-deb/extract.c (movecontrolfiles, extracthalf): Likewise.
+ * dpkg-deb/info.c (cu_info_prepare, info_prepare): Likewise.
+ * src/cleanup.c (cu_prermupgrade, cu_prermdeconfigure)
+ (cu_prerminfavour, cu_preinstverynew, cu_preinstnew)
+ (cu_preinstupgrade, cu_postrmupgrade, cu_prermremove): Likewise.
+ * src/configure.c (deferred_configure, suspend): Likewise.
+ * src/help.c (maintainer_script_alternative)
+ (ensure_pathname_nonexisting): Likewise.
+ * src/processarc.c (process_archive): Likewise.
+ * src/remove.c (deferred_remove, removal_bulk_remove_files)
+ (removal_bulk_remove_configfiles): Likewise.
+
2007-08-08 Guillem Jover <guillem@debian.org>
* src/cleanup.c (cu_prermdeconfigure): Split call to
m_dup2(p1[1],1); close(p1[0]); close(p1[1]);
if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
if (chdir(BUILDCONTROLDIR)) ohshite(_("failed to chdir to .../DEBIAN"));
- execlp(TAR,"tar","-cf","-",".",(char*)0); ohshite(_("failed to exec tar -cf"));
+ execlp(TAR, "tar", "-cf", "-", ".", NULL);
+ ohshite(_("failed to exec tar -cf"));
}
close(p1[1]);
/* Create a temporary file to store the control data in. Immediately unlink
m_dup2(p1[0],0); close(p1[0]); close(p1[1]);
m_dup2(p2[1],1); close(p2[0]); close(p2[1]);
if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
- execlp(TAR,"tar","-cf", "-", "--null", "-T", "-", "--no-recursion", (char*)0);
+ execlp(TAR, "tar", "-cf", "-", "--null", "-T", "-", "--no-recursion", NULL);
ohshite(_("failed to exec tar -cf"));
}
close(p1[0]);
if (!(c3= m_fork())) {
m_dup2(p3[1],1); close(p3[0]); close(p3[1]);
if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
- execlp(FIND,"find",".","-path","./" BUILDCONTROLDIR,"-prune","-o","-print0",(char*)0);
+ execlp(FIND, "find", ".", "-path", "./" BUILDCONTROLDIR, "-prune", "-o",
+ "-print0", NULL);
ohshite(_("failed to exec find"));
}
close(p3[1]);
sprintf(buf, "mv %s/* . && rmdir %s", thing, thing);
if (!(c1= m_fork())) {
- execlp("sh","sh","-c",buf,(char*)0); ohshite(_("failed to exec sh -c mv foo/* &c"));
+ execlp("sh", "sh", "-c", buf, NULL);
+ ohshite(_("failed to exec sh -c mv foo/* &c"));
}
waitsubproc(c1,"sh -c mv foo/* &c",0);
}
strcat(buffer, "f");
m_dup2(p2[0],0);
close(p2[0]);
- execlp(TAR,"tar",buffer,"-",(char*)0);
+ execlp(TAR, "tar", buffer, "-", NULL);
ohshite(_("failed to exec tar"));
}
close(p2[0]);
if (lstat(directory,&stab) && errno==ENOENT) return;
if ((c1= fork()) == -1) { perror(_("failed to fork for cleanup")); return; }
if (!c1) {
- execlp(RM,"rm","-rf",directory,(char*)0);
+ execlp(RM, "rm", "-rf", directory, NULL);
perror(_("failed to exec rm for cleanup")); _exit(1);
}
if (waitpid(c1,&status,0) != c1) { perror(_("failed to wait for rm cleanup")); return; }
*directoryp= dbuf;
if (!(c1= m_fork())) {
- execlp(RM,"rm","-rf",dbuf,(char*)0); ohshite(_("failed to exec rm -rf"));
+ execlp(RM, "rm", "-rf", dbuf, NULL);
+ ohshite(_("failed to exec rm -rf"));
}
waitsubproc(c1,"rm -rf",0);
push_cleanup(cu_info_prepare,-1, 0,0, 1, (void*)dbuf);
"abort-upgrade",
versiondescribe(&pkg->available.version,
vdew_nonambig),
- (char*)0);
+ NULL);
pkg->status= stat_installed;
pkg->eflag &= ~eflagf_reinstreq;
modstatdb_note(pkg);
"removing", conflictor->name,
versiondescribe(&conflictor->installed.version,
vdew_nonambig),
- (char*)0);
+ NULL);
} else {
maintainer_script_installed(deconf, POSTINSTFILE, "post-installation",
"abort-deconfigure",
"in-favour", infavour->name,
versiondescribe(&infavour->available.version,
vdew_nonambig),
- (char*)0);
+ NULL);
}
deconf->status= stat_installed;
"abort-remove", "in-favour", infavour->name,
versiondescribe(&infavour->available.version,
vdew_nonambig),
- (char*)0);
+ NULL);
conflictor->status= stat_installed;
conflictor->eflag &= ~eflagf_reinstreq;
modstatdb_note(conflictor);
if (cleanup_pkg_failed++) return;
maintainer_script_new(pkg->name, POSTRMFILE,"post-removal",cidir,cidirrest,
- "abort-install",(char*)0);
+ "abort-install", NULL);
pkg->status= stat_notinstalled;
pkg->eflag &= ~eflagf_reinstreq;
blankpackageperfile(&pkg->installed);
maintainer_script_new(pkg->name, POSTRMFILE,"post-removal",cidir,cidirrest,
"abort-install", versiondescribe(&pkg->installed.version,
vdew_nonambig),
- (char*)0);
+ NULL);
pkg->status= stat_configfiles;
pkg->eflag &= ~eflagf_reinstreq;
modstatdb_note(pkg);
"abort-upgrade",
versiondescribe(&pkg->installed.version,
vdew_nonambig),
- (char*)0);
+ NULL);
pkg->status= *oldstatusp;
pkg->eflag &= ~eflagf_reinstreq;
modstatdb_note(pkg);
maintainer_script_installed(pkg,PREINSTFILE,"pre-installation",
"abort-upgrade", versiondescribe(&pkg->available.version,
vdew_nonambig),
- (char*)0);
+ NULL);
cleanup_pkg_failed--;
}
if (cleanup_pkg_failed++) return;
maintainer_script_installed(pkg,POSTINSTFILE,"post-installation",
- "abort-remove", (char*)0);
+ "abort-remove", NULL);
pkg->status= stat_installed;
pkg->eflag &= ~eflagf_reinstreq;
modstatdb_note(pkg);
? versiondescribe(&pkg->configversion,
vdew_nonambig)
: "",
- (char*)0))
+ NULL))
putchar('\n');
pkg->status= stat_installed;
if (!s || !*s)
s=DEFAULTSHELL;
- execlp(s,s,"-i",(char*)0);
+ execlp(s, s, "-i", NULL);
ohshite(_("failed to exec shell (%.250s)"),s);
}
arglist= buildarglist(scriptname,
ifok,versiondescribe(&pkg->available.version,
vdew_nonambig),
- (char*)0);
+ NULL);
sprintf(buf,_("old %s script"),description);
if (stat(oldscriptpath,&stab)) {
if (errno == ENOENT) {
arglist= buildarglist(scriptname,
iffallback,versiondescribe(&pkg->installed.version,
vdew_nonambig),
- (char*)0);
+ NULL);
strcpy(cidirrest,scriptname);
sprintf(buf,_("new %s script"),description);
}
c1= m_fork();
if (!c1) {
- execlp(RM,"rm","-rf","--",pathname,(char*)0);
+ execlp(RM, "rm", "-rf", "--", pathname, NULL);
ohshite(_("failed to exec rm for cleanup"));
}
debug(dbg_eachfile,"ensure_pathname_nonexisting running rm -rf");
push_cleanup(cu_pathname,~0, 0,0, 1,(void*)reasmbuf);
c1= m_fork();
if (!c1) {
- execlp(SPLITTER, SPLITTER,"-Qao",reasmbuf,filename,(char*)0);
+ execlp(SPLITTER, SPLITTER, "-Qao", reasmbuf, filename, NULL);
ohshite(_("failed to exec dpkg-split to see if it's part of a multiparter"));
}
while ((r= waitpid(c1,&status,0)) == -1 && errno == EINTR);
c1= m_fork();
if (!c1) {
cidirrest[-1]= 0;
- execlp(BACKEND, BACKEND,"--control",filename,cidir,(char*)0);
+ execlp(BACKEND, BACKEND, "--control", filename, cidir, NULL);
ohshite(_("failed to exec dpkg-deb to extract control information"));
}
waitsubproc(c1,BACKEND " --control",0);
"removing", removing->name,
versiondescribe(&removing->installed.version,
vdew_nonambig),
- (char*)0);
+ NULL);
} else {
maintainer_script_installed(deconpil->pkg, PRERMFILE, "pre-removal",
"deconfigure", "in-favour", pkg->name,
versiondescribe(&pkg->available.version,
vdew_nonambig),
- (char*)0);
+ NULL);
}
}
"remove", "in-favour", pkg->name,
versiondescribe(&pkg->available.version,
vdew_nonambig),
- (char*)0);
+ NULL);
conflictor[i]->status= stat_halfinstalled;
modstatdb_note(conflictor[i]);
}
push_cleanup(cu_preinstverynew,~ehflag_normaltidy, 0,0,
3,(void*)pkg,(void*)cidir,(void*)cidirrest);
maintainer_script_new(pkg->name, PREINSTFILE, "pre-installation", cidir, cidirrest,
- "install", (char*)0);
+ "install", NULL);
} else if (oldversionstatus == stat_configfiles) {
push_cleanup(cu_preinstnew,~ehflag_normaltidy, 0,0,
3,(void*)pkg,(void*)cidir,(void*)cidirrest);
maintainer_script_new(pkg->name, PREINSTFILE, "pre-installation", cidir, cidirrest,
"install", versiondescribe(&pkg->installed.version,
vdew_nonambig),
- (char*)0);
+ NULL);
} else {
push_cleanup(cu_preinstupgrade,~ehflag_normaltidy, 0,0,
4,(void*)pkg,(void*)cidir,(void*)cidirrest,(void*)&oldversionstatus);
maintainer_script_new(pkg->name, PREINSTFILE, "pre-installation", cidir, cidirrest,
"upgrade", versiondescribe(&pkg->installed.version,
vdew_nonambig),
- (char*)0);
+ NULL);
printf(_("Unpacking replacement %.250s ...\n"),pkg->name);
}
c1= m_fork();
if (!c1) {
m_dup2(p1[1],1); close(p1[0]); close(p1[1]);
- execlp(BACKEND, BACKEND, "--fsys-tarfile", filename, (char*)0);
+ execlp(BACKEND, BACKEND, "--fsys-tarfile", filename, NULL);
ohshite(_("unable to exec dpkg-deb to get filesystem archive"));
}
close(p1[1]);
"disappear", pkg->name,
versiondescribe(&pkg->available.version,
vdew_nonambig),
- (char*)0);
+ NULL);
/* OK, now we delete all the stuff in the `info' directory .. */
varbufreset(&fnvb);
modstatdb_note(pkg);
push_cleanup(cu_prermremove,~ehflag_normaltidy, 0,0, 1,(void*)pkg);
maintainer_script_installed(pkg, PRERMFILE, "pre-removal",
- "remove", (char*)0);
+ "remove", NULL);
}
pkg->status= stat_unpacked; /* Will turn into halfinstalled soon ... */
}
write_filelist_except(pkg,leftover,0);
maintainer_script_installed(pkg, POSTRMFILE, "post-removal",
- "remove", (char*)0);
+ "remove", NULL);
varbufreset(&fnvb);
varbufaddstr(&fnvb,admindir);
varbufaddstr(&fnvb,"/" INFODIR);
modstatdb_note(pkg);
maintainer_script_installed(pkg, POSTRMFILE, "post-removal",
- "purge", (char*)0);
+ "purge", NULL);
}
void removal_bulk(struct pkginfo *pkg) {