Skip to content

Commit f9e88f0

Browse files
committed
Fix MAKE program detection
1 parent acd961f commit f9e88f0

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

src/commands.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "pkgsrc.h"

src/flag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <unistd.h>
44
#include <string.h>
55
#include "config.h"
6-
#include "include/commands.h"
6+
#include "commands.h"
77

88
static void
99
usage()

src/include/commands.h

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ const char * const skip[] = {
5252
"licenses", "mk", "packages", NULL
5353
};
5454

55+
#define QUOTE(s) #s
56+
#define STR(s) QUOTE(s)
57+
58+
#define PKGSRC_INSTALL STR(MAKE) " install clean clean-depends"
59+
#define PKGSRC_REPLACE STR(MAKE) " replace clean clean-depends"
60+
#define PKGSRC_OPTIONS STR(MAKE) " show-options"
61+
#define PKGSRC_DEPENDS STR(MAKE) " show-depends"
62+
#define PKGSRC_REMOVE STR(MAKE) " deinstall"
5563
int (*match)(const char *, const char *, int);
5664

5765

@@ -156,7 +164,7 @@ pkgsrc_options(const char *pkgsrc_path, struct package package)
156164
snprintf(package_dir, sizeof(package_dir), "%s/%s", pkgsrc_path, package.path);
157165

158166
chdir(package_dir);
159-
system("MAKE show-options");
167+
system(PKGSRC_OPTIONS);
160168
}
161169

162170
void
@@ -166,7 +174,7 @@ pkgsrc_install(const char *pkgsrc_path, struct package package)
166174
snprintf(package_dir, sizeof(package_dir), "%s/%s", pkgsrc_path, package.path);
167175

168176
chdir(package_dir);
169-
system("MAKE install clean clean-depends");
177+
system(PKGSRC_INSTALL);
170178
}
171179

172180
void
@@ -176,7 +184,7 @@ pkgsrc_remove(const char *pkgsrc_path, struct package package)
176184
snprintf(package_dir, sizeof(package_dir), "%s/%s", pkgsrc_path, package.path);
177185

178186
chdir(package_dir);
179-
system("MAKE deinstall");
187+
system(PKGSRC_REMOVE);
180188
}
181189

182190
void
@@ -186,5 +194,5 @@ pkgsrc_dependencies(const char *pkgsrc_path, struct package package)
186194
snprintf(package_dir, sizeof(package_dir), "%s/%s", pkgsrc_path, package.path);
187195

188196
chdir(package_dir);
189-
system("MAKE show-depends");
190-
}
197+
system(PKGSRC_DEPENDS);
198+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "defaults.h"
2+
13
struct package {
24
char name[50];
35
char description[250];

0 commit comments

Comments
 (0)