mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-05 12:56:08 +00:00
- pkg_add spawns itself as argv[0] when installing dependent packages, to
enable the use as a port on older systems - use absolute paths in all calls to external programs, to account for strange PATH settings - use INDEX or INDEX-5 depending on FreeBSD version, to enable the use on FreeBSD 4.x as a port. - conditionalize all 4.x/5.x differences on __FreeBSD_version, so that the pkg_install tools can be kept in sync on 4.x and 5.x - Bump PKG_INSTALL_VERSION Reviewed by: portmgr (bento run) MFC after: 4 weeks
This commit is contained in:
parent
3ed1dfa11d
commit
b9ba84598d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=131285
@ -5,7 +5,8 @@ SRCS= main.c perform.c futil.c extract.c
|
||||
|
||||
CFLAGS+= ${DEBUG} -I${.CURDIR}/../lib
|
||||
|
||||
WARNS?= 2
|
||||
WARNS?= 6
|
||||
WFORMAT?= 1
|
||||
|
||||
DPADD= ${LIBINSTALL} ${LIBFETCH} ${LIBMD}
|
||||
LDADD= ${LIBINSTALL} -lfetch -lmd
|
||||
|
@ -28,12 +28,12 @@ typedef enum { NORMAL, MASTER, SLAVE } add_mode_t;
|
||||
extern char *Prefix;
|
||||
extern Boolean NoInstall;
|
||||
extern Boolean NoRecord;
|
||||
extern Boolean Force;
|
||||
extern char *Mode;
|
||||
extern char *Owner;
|
||||
extern char *Group;
|
||||
extern char *Directory;
|
||||
extern char *PkgName;
|
||||
extern char *PkgAddCmd;
|
||||
extern char FirstPen[];
|
||||
extern add_mode_t AddMode;
|
||||
|
||||
|
@ -27,14 +27,14 @@ __FBSDID("$FreeBSD$");
|
||||
#include "add.h"
|
||||
|
||||
|
||||
#define STARTSTRING "tar cf -"
|
||||
#define STARTSTRING "/usr/bin/tar cf -"
|
||||
#define TOOBIG(str) \
|
||||
(((int)strlen(str) + FILENAME_MAX + where_count > maxargs) ||\
|
||||
((int)strlen(str) + FILENAME_MAX + perm_count > maxargs))
|
||||
|
||||
#define PUSHOUT(todir) /* push out string */ \
|
||||
if (where_count > (int)sizeof(STARTSTRING)-1) { \
|
||||
strcat(where_args, "|tar --unlink -xpf - -C "); \
|
||||
strcat(where_args, "|/usr/bin/tar --unlink -xpf - -C "); \
|
||||
strcat(where_args, todir); \
|
||||
if (system(where_args)) { \
|
||||
cleanup(0); \
|
||||
|
@ -50,7 +50,7 @@ make_hierarchy(char *dir)
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (vsystem("mkdir %s", dir)) {
|
||||
if (vsystem("/bin/mkdir %s", dir)) {
|
||||
if (cp2)
|
||||
*cp2 = '/';
|
||||
return FAIL;
|
||||
@ -78,20 +78,20 @@ apply_perms(const char *dir, const char *arg)
|
||||
cd_to = dir;
|
||||
|
||||
if (Mode)
|
||||
if (vsystem("cd %s && chmod -R %s %s", cd_to, Mode, arg))
|
||||
if (vsystem("cd %s && /bin/chmod -R %s %s", cd_to, Mode, arg))
|
||||
warnx("couldn't change modes of '%s' to '%s'", arg, Mode);
|
||||
if (Owner && Group) {
|
||||
if (vsystem("cd %s && chown -R %s:%s %s", cd_to, Owner, Group, arg))
|
||||
if (vsystem("cd %s && /usr/sbin/chown -R %s:%s %s", cd_to, Owner, Group, arg))
|
||||
warnx("couldn't change owner/group of '%s' to '%s:%s'",
|
||||
arg, Owner, Group);
|
||||
return;
|
||||
}
|
||||
if (Owner) {
|
||||
if (vsystem("cd %s && chown -R %s %s", cd_to, Owner, arg))
|
||||
if (vsystem("cd %s && /usr/sbin/chown -R %s %s", cd_to, Owner, arg))
|
||||
warnx("couldn't change owner of '%s' to '%s'", arg, Owner);
|
||||
return;
|
||||
} else if (Group)
|
||||
if (vsystem("cd %s && chgrp -R %s %s", cd_to, Group, arg))
|
||||
if (vsystem("cd %s && /usr/bin/chgrp -R %s %s", cd_to, Group, arg))
|
||||
warnx("couldn't change group of '%s' to '%s'", arg, Group);
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,7 @@ char *Mode = NULL;
|
||||
char *Owner = NULL;
|
||||
char *Group = NULL;
|
||||
char *PkgName = NULL;
|
||||
char *PkgAddCmd = NULL;
|
||||
char *Directory = NULL;
|
||||
char FirstPen[FILENAME_MAX];
|
||||
add_mode_t AddMode = NORMAL;
|
||||
@ -63,10 +64,12 @@ struct {
|
||||
{ 480000, 480099, "/packages-4.8-release" },
|
||||
{ 490000, 490099, "/packages-4.9-release" },
|
||||
{ 491000, 491099, "/packages-4.10-release" },
|
||||
{ 492000, 492099, "/packages-4.11-release" },
|
||||
{ 500000, 500099, "/packages-5.0-release" },
|
||||
{ 501000, 501099, "/packages-5.1-release" },
|
||||
{ 502000, 502009, "/packages-5.2-release" },
|
||||
{ 502010, 502099, "/packages-5.2.1-release" },
|
||||
{ 503000, 503099, "/packages-5.3-release" },
|
||||
{ 300000, 399000, "/packages-3-stable" },
|
||||
{ 400000, 499000, "/packages-4-stable" },
|
||||
{ 502100, 599000, "/packages-5-current" },
|
||||
@ -86,6 +89,12 @@ main(int argc, char **argv)
|
||||
char **start;
|
||||
char *cp, *packagesite = NULL, *remotepkg = NULL, *ptr;
|
||||
static char temppackageroot[MAXPATHLEN];
|
||||
static char pkgaddpath[MAXPATHLEN];
|
||||
|
||||
if (*argv[0] != '/' && strchr(argv[0], '/') != NULL)
|
||||
PkgAddCmd = realpath(argv[0], pkgaddpath);
|
||||
else
|
||||
PkgAddCmd = argv[0];
|
||||
|
||||
start = argv;
|
||||
while ((ch = getopt(argc, argv, Options)) != -1) {
|
||||
@ -168,9 +177,13 @@ main(int argc, char **argv)
|
||||
if (!((ptr = strrchr(remotepkg, '.')) && ptr[1] == 't' &&
|
||||
(ptr[2] == 'b' || ptr[2] == 'g') && ptr[3] == 'z' &&
|
||||
!ptr[4]))
|
||||
/* XXX: need to handle .tgz also */
|
||||
if (strlcat(remotepkg, ".tbz", sizeof(temppackageroot))
|
||||
>= sizeof(temppackageroot))
|
||||
if (strlcat(remotepkg,
|
||||
#if defined(__FreeBSD_version) && __FreeBSD_version >= 500039
|
||||
".tbz",
|
||||
#else
|
||||
".tgz",
|
||||
#endif
|
||||
sizeof(temppackageroot)) >= sizeof(temppackageroot))
|
||||
errx(1, "package name too long");
|
||||
}
|
||||
if (!strcmp(*argv, "-")) /* stdin? */
|
||||
|
@ -167,7 +167,7 @@ pkg_do(char *pkg)
|
||||
if (!isdir(p->name) && !Fake) {
|
||||
if (Verbose)
|
||||
printf("Desired prefix of %s does not exist, creating..\n", p->name);
|
||||
vsystem("mkdir -p %s", p->name);
|
||||
vsystem("/bin/mkdir -p %s", p->name);
|
||||
if (chdir(p->name) == -1) {
|
||||
warn("unable to change directory to '%s'", p->name);
|
||||
goto bomb;
|
||||
@ -302,7 +302,11 @@ pkg_do(char *pkg)
|
||||
|
||||
ext = strrchr(pkg_fullname, '.');
|
||||
if (ext == NULL)
|
||||
#if defined(__FreeBSD_version) && __FreeBSD_version >= 500039
|
||||
ext = ".tbz";
|
||||
#else
|
||||
ext = ".tgz";
|
||||
#endif
|
||||
snprintf(path, FILENAME_MAX, "%s/%s%s", getenv("_TOP"), p->name, ext);
|
||||
if (fexists(path))
|
||||
cp = path;
|
||||
@ -311,7 +315,7 @@ pkg_do(char *pkg)
|
||||
if (cp) {
|
||||
if (Verbose)
|
||||
printf("Loading it from %s.\n", cp);
|
||||
if (vsystem("pkg_add %s'%s'", Verbose ? "-v " : "", cp)) {
|
||||
if (vsystem("%s %s'%s'", PkgAddCmd, Verbose ? "-v " : "", cp)) {
|
||||
warnx("autoload of dependency '%s' failed%s",
|
||||
cp, Force ? " (proceeding anyway)" : "!");
|
||||
if (!Force)
|
||||
@ -334,7 +338,7 @@ pkg_do(char *pkg)
|
||||
if (!Force)
|
||||
++code;
|
||||
}
|
||||
else if (vsystem("(pwd; cat +CONTENTS) | pkg_add %s-S", Verbose ? "-v " : "")) {
|
||||
else if (vsystem("(pwd; /bin/cat +CONTENTS) | %s %s-S", PkgAddCmd, Verbose ? "-v " : "")) {
|
||||
warnx("pkg_add of dependency '%s' failed%s",
|
||||
p->name, Force ? " (proceeding anyway)" : "!");
|
||||
if (!Force)
|
||||
@ -365,7 +369,7 @@ pkg_do(char *pkg)
|
||||
|
||||
/* Look for the requirements file */
|
||||
if (fexists(REQUIRE_FNAME)) {
|
||||
vsystem("chmod +x %s", REQUIRE_FNAME); /* be sure */
|
||||
vsystem("/bin/chmod +x %s", REQUIRE_FNAME); /* be sure */
|
||||
if (Verbose)
|
||||
printf("Running requirements file first for %s..\n", Plist.name);
|
||||
if (!Fake && vsystem("./%s %s INSTALL", REQUIRE_FNAME, Plist.name)) {
|
||||
@ -398,7 +402,7 @@ pkg_do(char *pkg)
|
||||
|
||||
/* If we're really installing, and have an installation file, run it */
|
||||
if (!NoInstall && fexists(pre_script)) {
|
||||
vsystem("chmod +x %s", pre_script); /* make sure */
|
||||
vsystem("/bin/chmod +x %s", pre_script); /* make sure */
|
||||
if (Verbose)
|
||||
printf("Running pre-install for %s..\n", Plist.name);
|
||||
if (!Fake && vsystem("./%s %s %s", pre_script, Plist.name, pre_arg)) {
|
||||
@ -427,7 +431,7 @@ pkg_do(char *pkg)
|
||||
|
||||
/* Run the installation script one last time? */
|
||||
if (!NoInstall && fexists(post_script)) {
|
||||
vsystem("chmod +x %s", post_script); /* make sure */
|
||||
vsystem("/bin/chmod +x %s", post_script); /* make sure */
|
||||
if (Verbose)
|
||||
printf("Running post-install for %s..\n", Plist.name);
|
||||
if (!Fake && vsystem("./%s %s %s", post_script, Plist.name, post_arg)) {
|
||||
@ -457,7 +461,7 @@ pkg_do(char *pkg)
|
||||
goto success; /* close enough for government work */
|
||||
}
|
||||
/* Make sure pkg_info can read the entry */
|
||||
vsystem("chmod a+rx %s", LogDir);
|
||||
vsystem("/bin/chmod a+rx %s", LogDir);
|
||||
move_file(".", DESC_FNAME, LogDir);
|
||||
move_file(".", COMMENT_FNAME, LogDir);
|
||||
if (fexists(INSTALL_FNAME))
|
||||
|
@ -5,7 +5,8 @@ SRCS= main.c perform.c pl.c
|
||||
|
||||
CFLAGS+= ${DEBUG} -I${.CURDIR}/../lib
|
||||
|
||||
WARNS?= 2
|
||||
WARNS?= 6
|
||||
WFORMAT?= 1
|
||||
|
||||
DPADD= ${LIBINSTALL} ${LIBMD}
|
||||
LDADD= ${LIBINSTALL} -lmd
|
||||
|
@ -50,7 +50,6 @@ extern enum zipper Zipper;
|
||||
|
||||
void add_cksum(Package *, PackingList, const char *);
|
||||
void check_list(const char *, Package *);
|
||||
int pkg_perform(char **);
|
||||
void copy_plist(const char *, Package *);
|
||||
|
||||
#endif /* _INST_CREATE_H_INCLUDE */
|
||||
|
@ -103,18 +103,18 @@ trylink(const char *from, const char *to)
|
||||
/* try making the container directory */
|
||||
char *cp = strrchr(to, '/');
|
||||
if (cp)
|
||||
vsystem("mkdir -p %.*s", cp - to,
|
||||
vsystem("/bin/mkdir -p %.*s", cp - to,
|
||||
to);
|
||||
return link(from, to);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
#define STARTSTRING "tar cf -"
|
||||
#define STARTSTRING "/usr/bin/tar cf -"
|
||||
#define TOOBIG(str) (int)strlen(str) + 6 + (int)strlen(home) + where_count > maxargs
|
||||
#define PUSHOUT() /* push out string */ \
|
||||
if (where_count > (int)sizeof(STARTSTRING)-1) { \
|
||||
strcat(where_args, "|tar xpf -"); \
|
||||
strcat(where_args, "|/usr/bin/tar xpf -"); \
|
||||
if (system(where_args)) { \
|
||||
cleanup(0); \
|
||||
errx(2, "%s: can't invoke tar pipeline", __func__); \
|
||||
|
@ -5,7 +5,8 @@ SRCS= main.c perform.c
|
||||
|
||||
CFLAGS+= ${DEBUG} -I${.CURDIR}/../lib
|
||||
|
||||
WARNS?= 4
|
||||
WARNS?= 6
|
||||
WFORMAT?= 1
|
||||
|
||||
DPADD= ${LIBINSTALL} ${LIBMD}
|
||||
LDADD= ${LIBINSTALL} -lmd
|
||||
|
@ -27,7 +27,6 @@ extern char *Prefix;
|
||||
extern Boolean CleanDirs;
|
||||
extern Boolean Interactive;
|
||||
extern Boolean NoDeInstall;
|
||||
extern Boolean Force;
|
||||
extern Boolean Recursive;
|
||||
extern char *Directory;
|
||||
extern char *PkgName;
|
||||
|
@ -224,7 +224,7 @@ pkg_do(char *pkg)
|
||||
if (fexists(REQUIRE_FNAME)) {
|
||||
if (Verbose)
|
||||
printf("Executing 'require' script.\n");
|
||||
vsystem("chmod +x %s", REQUIRE_FNAME); /* be sure */
|
||||
vsystem("/bin/chmod +x %s", REQUIRE_FNAME); /* be sure */
|
||||
if (vsystem("./%s %s DEINSTALL", REQUIRE_FNAME, pkg)) {
|
||||
warnx("package %s fails requirements %s", pkg,
|
||||
Force ? "" : "- not deleted");
|
||||
@ -254,7 +254,7 @@ pkg_do(char *pkg)
|
||||
if (Fake)
|
||||
printf("Would execute de-install script at this point.\n");
|
||||
else {
|
||||
vsystem("chmod +x %s", pre_script); /* make sure */
|
||||
vsystem("/bin/chmod +x %s", pre_script); /* make sure */
|
||||
if (vsystem("./%s %s %s", pre_script, pkg, pre_arg)) {
|
||||
warnx("deinstall script returned error status");
|
||||
if (!Force)
|
||||
@ -311,7 +311,7 @@ pkg_do(char *pkg)
|
||||
if (Fake)
|
||||
printf("Would execute post-deinstall script at this point.\n");
|
||||
else {
|
||||
vsystem("chmod +x %s", post_script); /* make sure */
|
||||
vsystem("/bin/chmod +x %s", post_script); /* make sure */
|
||||
if (vsystem("./%s %s %s", post_script, pkg, post_arg)) {
|
||||
warnx("post-deinstall script returned error status");
|
||||
if (!Force)
|
||||
|
@ -5,7 +5,8 @@ SRCS= main.c perform.c show.c
|
||||
|
||||
CFLAGS+= ${DEBUG} -I${.CURDIR}/../lib
|
||||
|
||||
WARNS?= 2
|
||||
WARNS?= 6
|
||||
WFORMAT?= 1
|
||||
|
||||
DPADD= ${LIBINSTALL} ${LIBFETCH} ${LIBMD}
|
||||
LDADD= ${LIBINSTALL} -lfetch -lmd
|
||||
|
@ -7,6 +7,7 @@ SRCS= file.c msg.c plist.c str.c exec.c global.c pen.c match.c \
|
||||
|
||||
CFLAGS+= ${DEBUG}
|
||||
|
||||
WARNS?= 2
|
||||
WARNS?= 6
|
||||
WFORMAT?= 1
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
|
@ -269,9 +269,9 @@ copy_file(const char *dir, const char *fname, const char *to)
|
||||
char cmd[FILENAME_MAX];
|
||||
|
||||
if (fname[0] == '/')
|
||||
snprintf(cmd, FILENAME_MAX, "cp -r %s %s", fname, to);
|
||||
snprintf(cmd, FILENAME_MAX, "/bin/cp -r %s %s", fname, to);
|
||||
else
|
||||
snprintf(cmd, FILENAME_MAX, "cp -r %s/%s %s", dir, fname, to);
|
||||
snprintf(cmd, FILENAME_MAX, "/bin/cp -r %s/%s %s", dir, fname, to);
|
||||
if (vsystem(cmd)) {
|
||||
cleanup(0);
|
||||
errx(2, "%s: could not perform '%s'", __func__, cmd);
|
||||
@ -284,9 +284,9 @@ move_file(const char *dir, const char *fname, const char *to)
|
||||
char cmd[FILENAME_MAX];
|
||||
|
||||
if (fname[0] == '/')
|
||||
snprintf(cmd, FILENAME_MAX, "mv %s %s", fname, to);
|
||||
snprintf(cmd, FILENAME_MAX, "/bin/mv %s %s", fname, to);
|
||||
else
|
||||
snprintf(cmd, FILENAME_MAX, "mv %s/%s %s", dir, fname, to);
|
||||
snprintf(cmd, FILENAME_MAX, "/bin/mv %s/%s %s", dir, fname, to);
|
||||
if (vsystem(cmd)) {
|
||||
cleanup(0);
|
||||
errx(2, "%s: could not perform '%s'", __func__, cmd);
|
||||
@ -310,11 +310,11 @@ copy_hierarchy(const char *dir, const char *fname, Boolean to)
|
||||
/* If absolute path, use it */
|
||||
if (*fname == '/')
|
||||
dir = "/";
|
||||
snprintf(cmd, FILENAME_MAX * 3, "tar cf - -C %s %s | tar xpf -",
|
||||
snprintf(cmd, FILENAME_MAX * 3, "/usr/bin/tar cf - -C %s %s | /usr/bin/tar xpf -",
|
||||
dir, fname);
|
||||
}
|
||||
else
|
||||
snprintf(cmd, FILENAME_MAX * 3, "tar cf - %s | tar xpf - -C %s",
|
||||
snprintf(cmd, FILENAME_MAX * 3, "/usr/bin/tar cf - %s | /usr/bin/tar xpf - -C %s",
|
||||
fname, dir);
|
||||
#ifdef DEBUG
|
||||
printf("Using '%s' to copy trees.\n", cmd);
|
||||
@ -350,9 +350,12 @@ unpack(const char *pkg, const char *flist)
|
||||
}
|
||||
}
|
||||
else
|
||||
/* XXX: need to handle .tgz also */
|
||||
#if defined(__FreeBSD_version) && __FreeBSD_version >= 500039
|
||||
comp = "-j";
|
||||
if (vsystem("tar -xp %s -f '%s' %s", comp, pkg, flist ? flist : "")) {
|
||||
#else
|
||||
comp = "-z";
|
||||
#endif
|
||||
if (vsystem("/usr/bin/tar -xp %s -f '%s' %s", comp, pkg, flist ? flist : "")) {
|
||||
warnx("tar extract of %s failed!", pkg);
|
||||
return 1;
|
||||
}
|
||||
|
@ -52,10 +52,10 @@
|
||||
#define NO 1
|
||||
|
||||
/* Usually "rm", but often "echo" during debugging! */
|
||||
#define REMOVE_CMD "rm"
|
||||
#define REMOVE_CMD "/bin/rm"
|
||||
|
||||
/* Usually "rm", but often "echo" during debugging! */
|
||||
#define RMDIR_CMD "rmdir"
|
||||
#define RMDIR_CMD "/bin/rmdir"
|
||||
|
||||
/* Where we put logging information by default, else ${PKG_DBDIR} if set */
|
||||
#define DEF_LOG_DIR "/var/db/pkg"
|
||||
@ -77,6 +77,12 @@
|
||||
#define DISPLAY_FNAME "+DISPLAY"
|
||||
#define MTREE_FNAME "+MTREE_DIRS"
|
||||
|
||||
#if defined(__FreeBSD_version) && __FreeBSD_version >= 500036
|
||||
#define INDEX_FNAME "INDEX-5"
|
||||
#else
|
||||
#define INDEX_FNAME "INDEX"
|
||||
#endif
|
||||
|
||||
#define CMD_CHAR '@' /* prefix for extended PLIST cmd */
|
||||
|
||||
/* The name of the "prefix" environment variable given to scripts */
|
||||
@ -86,7 +92,7 @@
|
||||
* Version of the package tools - increase only when some
|
||||
* functionality used by bsd.port.mk is changed, added or removed
|
||||
*/
|
||||
#define PKG_INSTALL_VERSION 20030417
|
||||
#define PKG_INSTALL_VERSION 20040629
|
||||
|
||||
#define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf"
|
||||
#define main(argc, argv) real_main(argc, argv)
|
||||
|
@ -63,7 +63,7 @@ matchinstalled(match_t MatchType, char **patterns, int *retval)
|
||||
static struct store *store = NULL;
|
||||
FTS *ftsp;
|
||||
FTSENT *f;
|
||||
Boolean *lmatched;
|
||||
Boolean *lmatched = NULL;
|
||||
|
||||
store = storecreate(store);
|
||||
if (store == NULL) {
|
||||
|
@ -156,7 +156,7 @@ leave_playpen()
|
||||
Previous[0] = '\0';
|
||||
}
|
||||
if (PenLocation[0]) {
|
||||
if (PenLocation[0] == '/' && vsystem("rm -rf %s", PenLocation))
|
||||
if (PenLocation[0] == '/' && vsystem("/bin/rm -rf %s", PenLocation))
|
||||
warnx("couldn't remove temporary dir '%s'", PenLocation);
|
||||
popPen(PenLocation);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ fileGetURL(const char *base, const char *spec)
|
||||
char buf[8192];
|
||||
FILE *ftp;
|
||||
pid_t tpid;
|
||||
int pfd[2], pstat, r, w;
|
||||
int pfd[2], pstat, r, w = 0;
|
||||
char *hint;
|
||||
int fd;
|
||||
|
||||
@ -69,8 +69,11 @@ fileGetURL(const char *base, const char *spec)
|
||||
*(cp + 1) = '\0';
|
||||
strcat(cp, "All/");
|
||||
strcat(cp, spec);
|
||||
/* XXX: need to handle .tgz also */
|
||||
#if defined(__FreeBSD_version) && __FreeBSD_version >= 500039
|
||||
strcat(cp, ".tbz");
|
||||
#else
|
||||
strcat(cp, ".tgz");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
@ -82,8 +85,11 @@ fileGetURL(const char *base, const char *spec)
|
||||
*/
|
||||
strcpy(fname, hint);
|
||||
strcat(fname, spec);
|
||||
/* XXX: need to handle .tgz also */
|
||||
#if defined(__FreeBSD_version) && __FreeBSD_version >= 500039
|
||||
strcat(fname, ".tbz");
|
||||
#else
|
||||
strcat(fname, ".tgz");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -117,9 +123,13 @@ fileGetURL(const char *base, const char *spec)
|
||||
dup2(pfd[0], 0);
|
||||
for (fd = getdtablesize() - 1; fd >= 3; --fd)
|
||||
close(fd);
|
||||
/* XXX: need to handle .tgz also */
|
||||
execl("/usr/bin/tar", "tar", Verbose ? "-xjvf" : "-xjf", "-",
|
||||
(char *)0);
|
||||
execl("/usr/bin/tar", "tar",
|
||||
#if defined(__FreeBSD_version) && __FreeBSD_version >= 500039
|
||||
Verbose ? "-xjvf" : "-xjf",
|
||||
#else
|
||||
Verbose ? "-xzvf" : "-xzf",
|
||||
#endif
|
||||
"-", (char *)0);
|
||||
_exit(2);
|
||||
}
|
||||
close(pfd[0]);
|
||||
|
@ -9,8 +9,6 @@ SRCS= main.c check.c common.c gzip.c pgp_check.c pgp_sign.c \
|
||||
|
||||
CFLAGS+= ${DEBUG} -I${.CURDIR}/../lib
|
||||
|
||||
WARNS?= 0
|
||||
|
||||
DISTRIBUTION= crypto
|
||||
DPADD= ${LIBINSTALL} ${LIBMD} ${LIBCRYPTO}
|
||||
LDADD= ${LIBINSTALL} -lmd -lcrypto
|
||||
|
@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
@ -170,7 +170,6 @@ retrieve_sha1_marker(filename, sign, userid)
|
||||
char result[BUFSIZE];
|
||||
ssize_t length = -1;
|
||||
struct sha1_checker *checker;
|
||||
struct signature *old;
|
||||
|
||||
*sign = NULL;
|
||||
if (userid == NULL)
|
||||
|
@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
@ -18,10 +18,10 @@
|
||||
#if defined(BSD4_4)
|
||||
#include <err.h>
|
||||
#else
|
||||
extern void set_program_name __P((const char * name));
|
||||
extern void warn __P((const char *fmt, ...));
|
||||
extern void warnx __P((const char *fmt, ...));
|
||||
#endif
|
||||
extern void set_program_name __P((const char * name));
|
||||
|
||||
#ifndef __GNUC__
|
||||
#define __attribute__(x)
|
||||
|
@ -89,7 +89,6 @@ new_x509_checker(h, sign, userid, envp, filename)
|
||||
FILE * fp;
|
||||
struct x509_checker * me;
|
||||
char certfile[PATH_MAX + 1] = CERTFILE;
|
||||
char * cp;
|
||||
X509 * x509;
|
||||
|
||||
assert(sign->type == TAG_X509);
|
||||
@ -139,7 +138,7 @@ new_x509_checker(h, sign, userid, envp, filename)
|
||||
if (verbose)
|
||||
printf("Loading certificates from %s:\n", certfile);
|
||||
|
||||
while (x509 = PEM_read_X509(fp, NULL, NULL, 0)) {
|
||||
while ((x509 = PEM_read_X509(fp, NULL, NULL, 0))) {
|
||||
sk_X509_push(me->certs, x509);
|
||||
|
||||
switch (EVP_PKEY_type(X509_get_pubkey(x509)->type))
|
||||
@ -287,7 +286,6 @@ retrieve_x509_marker(filename, sign, userid)
|
||||
EVP_PKEY * pkey;
|
||||
|
||||
char keyfile[PATH_MAX + 1] = KEYFILE;
|
||||
char * kp;
|
||||
|
||||
key_from_name(keyfile, userkey);
|
||||
|
||||
|
@ -5,7 +5,8 @@ SRCS= main.c perform.c
|
||||
|
||||
CFLAGS+= ${DEBUG} -I${.CURDIR}/../lib
|
||||
|
||||
WARNS?= 2
|
||||
WARNS?= 6
|
||||
WFORMAT?= 1
|
||||
|
||||
DPADD= ${LIBINSTALL} ${LIBFETCH} ${LIBMD}
|
||||
LDADD= ${LIBINSTALL} -lfetch -lmd
|
||||
|
@ -52,10 +52,9 @@ pkg_perform(char **indexarg)
|
||||
/*
|
||||
* Try to find and open the INDEX. We only check IndexFile != NULL
|
||||
* later, if we actually need the INDEX.
|
||||
* XXX This should not be hard-coded to INDEX-5.
|
||||
*/
|
||||
if (*indexarg == NULL)
|
||||
snprintf(tmp, PATH_MAX, "%s/INDEX-5", PORTS_DIR);
|
||||
snprintf(tmp, PATH_MAX, "%s/%s", PORTS_DIR, INDEX_FNAME);
|
||||
else
|
||||
strlcpy(tmp, *indexarg, PATH_MAX);
|
||||
if (isURL(tmp))
|
||||
@ -151,7 +150,7 @@ pkg_do(char *pkg)
|
||||
if (plist.origin != NULL) {
|
||||
snprintf(tmp, PATH_MAX, "%s/%s", PORTS_DIR, plist.origin);
|
||||
if (isdir(tmp) && chdir(tmp) != FAIL && isfile("Makefile")) {
|
||||
if ((latest = vpipe("make -V PKGNAME", tmp)) == NULL)
|
||||
if ((latest = vpipe("/usr/bin/make -V PKGNAME", tmp)) == NULL)
|
||||
warnx("Failed to get PKGNAME from %s/Makefile!", tmp);
|
||||
else
|
||||
show_version(plist.name, latest, "port");
|
||||
|
Loading…
Reference in New Issue
Block a user