Skip to content

Commit

Permalink
Fix MAKE program detection
Browse files Browse the repository at this point in the history
  • Loading branch information
cirnatdan committed Jun 28, 2021
1 parent acd961f commit f9e88f0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/commands.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "pkgsrc.h"
2 changes: 1 addition & 1 deletion src/flag.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <unistd.h>
#include <string.h>
#include "config.h"
#include "include/commands.h"
#include "commands.h"

static void
usage()
Expand Down
1 change: 0 additions & 1 deletion src/include/commands.h

This file was deleted.

18 changes: 13 additions & 5 deletions src/include/pkgsrc.c → src/pkgsrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ const char * const skip[] = {
"licenses", "mk", "packages", NULL
};

#define QUOTE(s) #s
#define STR(s) QUOTE(s)

#define PKGSRC_INSTALL STR(MAKE) " install clean clean-depends"
#define PKGSRC_REPLACE STR(MAKE) " replace clean clean-depends"
#define PKGSRC_OPTIONS STR(MAKE) " show-options"
#define PKGSRC_DEPENDS STR(MAKE) " show-depends"
#define PKGSRC_REMOVE STR(MAKE) " deinstall"
int (*match)(const char *, const char *, int);


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

chdir(package_dir);
system("MAKE show-options");
system(PKGSRC_OPTIONS);
}

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

chdir(package_dir);
system("MAKE install clean clean-depends");
system(PKGSRC_INSTALL);
}

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

chdir(package_dir);
system("MAKE deinstall");
system(PKGSRC_REMOVE);
}

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

chdir(package_dir);
system("MAKE show-depends");
}
system(PKGSRC_DEPENDS);
}
2 changes: 2 additions & 0 deletions src/include/pkgsrc.h → src/pkgsrc.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "defaults.h"

struct package {
char name[50];
char description[250];
Expand Down

0 comments on commit f9e88f0

Please sign in to comment.