Compare commits
No commits in common. "73df7a5e740b4d4a08b9a9d92907699b993eedee" and "d10dcd190b4bbef3cba85ba68e5e574e4b538b89" have entirely different histories.
73df7a5e74
...
d10dcd190b
@ -1,21 +0,0 @@
|
|||||||
#
|
|
||||||
# make.conf
|
|
||||||
# The settings defined in this file will be loaded when 'make' is called during a Glacier operation.
|
|
||||||
# For more information on this file, see https://www.everestlinux.org/docs/intro-to-glacier
|
|
||||||
#
|
|
||||||
|
|
||||||
# Number of parallel makejobs. By default this is set by nproc and should be optimal for your system.
|
|
||||||
MAKEFLAGS="-j$(nproc)"
|
|
||||||
|
|
||||||
# Build and compile flags for C and C++ programs.
|
|
||||||
# Using too many build flags will break packages. Disable these if packages are breaking.
|
|
||||||
CFLAGS="-O2"
|
|
||||||
CXXFLAGS="${CFLAGS}"
|
|
||||||
|
|
||||||
# Treat all warnings as errors
|
|
||||||
# Not recommended, as many packages with larger codebases may refuse to compile.
|
|
||||||
#CFLAGS="-Werror"
|
|
||||||
|
|
||||||
# Prefix for packages to be installed.
|
|
||||||
# Not all packages will honor this.
|
|
||||||
PREFIX="/usr"
|
|
@ -22,10 +22,6 @@ extern config_t cfg;
|
|||||||
extern config_setting_t *setting;
|
extern config_setting_t *setting;
|
||||||
extern const char str;
|
extern const char str;
|
||||||
|
|
||||||
extern char GLACIER_ALLOWED_LICENSES;
|
|
||||||
extern int GLACIER_DO_INT_CHECK;
|
|
||||||
extern int GLACIER_VERBOSE;
|
|
||||||
|
|
||||||
extern const char *GLACIER_REPO;
|
extern const char *GLACIER_REPO;
|
||||||
extern const char *GLACIER_ARCH;
|
extern const char *GLACIER_ARCH;
|
||||||
extern const char *GLACIER_TARGET;
|
extern const char *GLACIER_TARGET;
|
||||||
@ -34,7 +30,4 @@ extern const char *GLACIER_SYSTEM_PROFILE;
|
|||||||
|
|
||||||
const char *runtime_files[];
|
const char *runtime_files[];
|
||||||
|
|
||||||
extern FILE *expected_hash;
|
|
||||||
extern FILE *pkg;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,6 +33,6 @@
|
|||||||
* compare_file_hash("pkg.sha256sum", "pkg.tar.xz");
|
* compare_file_hash("pkg.sha256sum", "pkg.tar.xz");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* int compare_file_hash(char ORIG_HASH[], char FILE[]); */
|
int compare_file_hash(char ORIG_HASH[], char FILE[]);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
175
libglacier.c
175
libglacier.c
@ -37,63 +37,44 @@
|
|||||||
#define MAX_CHILDREN 64
|
#define MAX_CHILDREN 64
|
||||||
#define MAX_SIZE 256
|
#define MAX_SIZE 256
|
||||||
|
|
||||||
/*
|
/* Global variables */
|
||||||
* Global Variables
|
|
||||||
*
|
|
||||||
* Descriptions are given as comments after the variable declaration.
|
|
||||||
* DEFINED IN: globals.h
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
config_t cfg; /* Context for libconfig */
|
config_t cfg;
|
||||||
config_setting_t *setting; /* Pointer for setting */
|
config_setting_t *setting;
|
||||||
const char str; /* Unsure what this does, will possibly remove later */
|
const char str;
|
||||||
|
|
||||||
int GLACIER_ALLOW_SERVICES; /* Declaration of GLACIER_ALLOW_SERVICES as given in glacier.cfg */
|
int GLACIER_ALLOW_SERVICES;
|
||||||
char GLACIER_ALLOWED_LICENSES; /* Declaration of GLACIER_ALLOWED_LICENSES as given in glacier.cfg */
|
char GLACIER_ALLOWED_LICENSES;
|
||||||
int GLACIER_DO_INT_CHECK; /* Declaration of GLACIER_DO_INT_CHECK as given in glacier.cfg */
|
int GLACIER_DO_INT_CHECK;
|
||||||
int GLACIER_VERBOSE; /* Declaration of GLACIER_VERBOSE as given in glacier.cfg */
|
int GLACIER_VERBOSE;
|
||||||
|
|
||||||
const char *GLACIER_REPO; /* Declaration of GLACIER_REPO as defined in profile.cfg */
|
const char *GLACIER_REPO;
|
||||||
const char *GLACIER_ARCH; /* Declaration of GLACIER_ARCH as defined in profile.cfg */
|
const char *GLACIER_ARCH;
|
||||||
const char *GLACIER_TARGET; /* Declaration of GLACIER_TARGET as defined in profile.cfg */
|
const char *GLACIER_TARGET;
|
||||||
const char *GLACIER_LOCALDB; /* Declaration of GLACIER_LOCALDB as defined in profile.cfg */
|
const char *GLACIER_LOCALDB;
|
||||||
const char *GLACIER_SYSTEM_PROFILE; /* Declaration of GLACIER_SYSTEM_PROFILE as defined in profile.cfg */
|
const char *GLACIER_SYSTEM_PROFILE;
|
||||||
|
|
||||||
/* Required runtime files */
|
|
||||||
const char *runtime_files[] = {
|
const char *runtime_files[] = {
|
||||||
"/etc/glacier.cfg",
|
"/etc/glacier.cfg",
|
||||||
"/etc/glacier/call-hooks",
|
"/etc/glacier/call-hooks",
|
||||||
"/etc/make.conf"
|
"/etc/make.conf"
|
||||||
};
|
};
|
||||||
|
|
||||||
FILE *expected_hash; /* File pointer for expected hash */
|
|
||||||
FILE *pkg; /* File pointer for package hash */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* END GLOBAL VARIABLES
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* node
|
|
||||||
*
|
|
||||||
* DESCRIPTION: Definition of node type.
|
|
||||||
* DEFINED IN: data.h
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct node {
|
struct node {
|
||||||
char *data;
|
char *data;
|
||||||
struct node *children[MAX_CHILDREN];
|
struct node *children[MAX_CHILDREN];
|
||||||
int numChildren;
|
int numChildren;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
FILE *expected_hash;
|
||||||
|
FILE *pkg;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* infolog
|
* infolog
|
||||||
*
|
*
|
||||||
* DESCRIPTION: Output a stylized info message.
|
* DESCRIPTION: Output a stylized info message.
|
||||||
* PARAMETERS: char MSG[]
|
* PARAMETERS: char MSG[]
|
||||||
* DEFINED IN: log.h
|
* DEFINED IN: glacier_log.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -113,7 +94,7 @@ infolog(char MSG[])
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Output a stylized warning message.
|
* DESCRIPTION: Output a stylized warning message.
|
||||||
* Parameters: char MSG[]
|
* Parameters: char MSG[]
|
||||||
* DEFINED IN: log.h
|
* DEFINED IN: glacier_log.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -133,7 +114,7 @@ warnlog(char MSG[])
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Output a stylized error message.
|
* DESCRIPTION: Output a stylized error message.
|
||||||
* PARAMETERS: char MSG[]
|
* PARAMETERS: char MSG[]
|
||||||
* DEFINED IN: log.h
|
* DEFINED IN: glacier_log.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -153,7 +134,7 @@ errlog(char MSG[])
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Output a stylized success message.
|
* DESCRIPTION: Output a stylized success message.
|
||||||
* PARAMETERS: char MSG[]
|
* PARAMETERS: char MSG[]
|
||||||
* DEFINED IN: log.h
|
* DEFINED IN: glacier_log.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -173,7 +154,7 @@ successlog(char MSG[])
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Check if necesary runtime files exist.
|
* DESCRIPTION: Check if necesary runtime files exist.
|
||||||
* PARAMETERS: None.
|
* PARAMETERS: None.
|
||||||
* DEFINED IN: runtime.h
|
* DEFINED IN: glacier_runtime.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -201,7 +182,7 @@ runtime_exists(void)
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Check if process is running as root.
|
* DESCRIPTION: Check if process is running as root.
|
||||||
* PARAMETERS: char MSG[]
|
* PARAMETERS: char MSG[]
|
||||||
* DEFINED IN: runtime.h
|
* DEFINED IN: glacier_runtime.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -221,7 +202,7 @@ is_process_root(void)
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Initialize libconfig.
|
* DESCRIPTION: Initialize libconfig.
|
||||||
* PARAMETERS: None.
|
* PARAMETERS: None.
|
||||||
* DEFINED IN: config.h
|
* DEFINED IN: glacier_config.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -249,7 +230,7 @@ init_config(void)
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Kill libconfig.
|
* DESCRIPTION: Kill libconfig.
|
||||||
* PARAMETERS: None.
|
* PARAMETERS: None.
|
||||||
* DEFINED IN: config.h
|
* DEFINED IN: glacier_config.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -270,46 +251,49 @@ die_config(void)
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Loads all settings from the Glacier config file.
|
* DESCRIPTION: Loads all settings from the Glacier config file.
|
||||||
* PARAMETERS: None.
|
* PARAMETERS: None.
|
||||||
* DEFINED IN: config.h
|
* DEFINED IN: glacier_config.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
load_all_from_config(void)
|
load_all_from_config(void)
|
||||||
{
|
{
|
||||||
/* this is probably really ugly but it works */
|
config_lookup_bool(&cfg, "GLACIER_DO_INT_CHECK", &GLACIER_DO_INT_CHECK);
|
||||||
if (! config_lookup_bool(&cfg, "GLACIER_DO_INT_CHECK", &GLACIER_DO_INT_CHECK)) { return 1; }
|
config_lookup_bool(&cfg, "GLACIER_VERBOSE", &GLACIER_VERBOSE);
|
||||||
if (! config_lookup_bool(&cfg, "GLACIER_VERBOSE", &GLACIER_VERBOSE)) { return 1; }
|
|
||||||
|
|
||||||
return 0;
|
config_lookup_string(&cfg, "GLACIER_REPO", &GLACIER_REPO);
|
||||||
|
config_lookup_string(&cfg, "GLACIER_ARCH", &GLACIER_ARCH);
|
||||||
|
config_lookup_string(&cfg, "GLACIER_TARGET", &GLACIER_TARGET);
|
||||||
|
config_lookup_string(&cfg, "GLACIER_SYSTEM_PROFILE", &GLACIER_SYSTEM_PROFILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* issues with this idk
|
||||||
* load_all_from_profile
|
|
||||||
*
|
|
||||||
* DESCRIPTION: Loads all settings from the Glacier system profile.
|
|
||||||
* PARAMETERS: None.
|
|
||||||
* DEFINED IN: config.h
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
int
|
||||||
load_all_from_profile(void)
|
load_all_from_config()
|
||||||
{
|
{
|
||||||
if (! config_lookup_string(&cfg, "GLACIER_REPO", &GLACIER_REPO)) { return 1; }
|
if(config_lookup_bool(&cfg, "GLACIER_ALLOW_SERVICES", &GLACIER_ALLOW_SERVICES))
|
||||||
if (! config_lookup_string(&cfg, "GLACIER_ARCH", &GLACIER_ARCH)) { return 1; }
|
printf("Services allowed: %s\n", GLACIER_ALLOW_SERVICES ? "true" : "false");
|
||||||
if (! config_lookup_string(&cfg, "GLACIER_TARGET", &GLACIER_TARGET)) { return 1; }
|
else
|
||||||
if (! config_lookup_string(&cfg, "GLACIER_SYSTEM_PROFILE", &GLACIER_SYSTEM_PROFILE)) { return 1; }
|
warnlog("GLACIER_SERVICES_ALLOWED is not defined in glacier.cfg.");
|
||||||
|
|
||||||
return 0;
|
if(config_lookup_bool(&cfg, "GLACIER_DO_INT_CHECK", &GLACIER_DO_INT_CHECK))
|
||||||
|
printf("Integrity checking enabled: %s\n", GLACIER_DO_INT_CHECK ? "true" : "false");
|
||||||
|
else
|
||||||
|
warnlog("GLACIER_DO_INT_CHECK is not defined in glacier.cfg.");
|
||||||
|
|
||||||
|
if(config_lookup_bool(&cfg, "GLACIER_VERBOSE", &GLACIER_VERBOSE))
|
||||||
|
printf("Verbose logging: %s\n", GLACIER_VERBOSE ? "true" : "false");
|
||||||
|
else
|
||||||
|
warnlog("GLACIER_VERBOSE is not defined in glacier.cfg.");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* load_setting_from_config
|
* load_setting_from_config
|
||||||
*
|
*
|
||||||
* DESCRIPTION: Load a specified setting from the Glacier config file.
|
* DESCRIPTION: Load a specified setting from the Glacier config file.
|
||||||
* PARAMETERS: char SETTING[]
|
* PARAMETERS: char SETTING[]
|
||||||
* DEFINED IN: config.h
|
* DEFINED IN: glacier_config.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -322,7 +306,7 @@ load_setting_from_config(char SETTING[])
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Create a dependency tree node.
|
* DESCRIPTION: Create a dependency tree node.
|
||||||
* PARAMETERS: char *data
|
* PARAMETERS: char *data
|
||||||
* DEFINED IN: data.h
|
* DEFINED IN: glacier_data.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -340,7 +324,7 @@ struct node
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Add a child node to a parent node.
|
* DESCRIPTION: Add a child node to a parent node.
|
||||||
* PARAMETERS: struct node *parent, struct node *child
|
* PARAMETERS: struct node *parent, struct node *child
|
||||||
* DEFINED IN: data.h
|
* DEFINED IN: glacier_data.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -360,7 +344,7 @@ add_child(struct node *parent, struct node *child)
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Print a dependency tree.
|
* DESCRIPTION: Print a dependency tree.
|
||||||
* PARAMETERS: struct node *root, int level
|
* PARAMETERS: struct node *root, int level
|
||||||
* DEFINED IN: data.h
|
* DEFINED IN: glacier_data.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -382,14 +366,7 @@ print_tree(struct node *root, int level)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Definition of queue data type */
|
||||||
* queue
|
|
||||||
*
|
|
||||||
* DESCRIPTION: Definition of queue type.
|
|
||||||
* DEFINED IN: data.h
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int items[MAX_SIZE];
|
int items[MAX_SIZE];
|
||||||
int front;
|
int front;
|
||||||
@ -401,7 +378,7 @@ typedef struct {
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Initialize a queue.
|
* DESCRIPTION: Initialize a queue.
|
||||||
* PARAMETERS: queue *q
|
* PARAMETERS: queue *q
|
||||||
* DEFINED IN: data.h
|
* DEFINED IN: glacier_data.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -417,7 +394,7 @@ init_queue(queue *q)
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Check if queue is empty.
|
* DESCRIPTION: Check if queue is empty.
|
||||||
* PARAMETERS: struct node *root, int level
|
* PARAMETERS: struct node *root, int level
|
||||||
* DEFINED IN: data.h
|
* DEFINED IN: glacier_data.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -428,7 +405,7 @@ bool queue_is_empty(queue *q) { return (q -> front == q -> rear -1); }
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Check if queue is full.
|
* DESCRIPTION: Check if queue is full.
|
||||||
* PARAMETERS: queue *q
|
* PARAMETERS: queue *q
|
||||||
* DEFINED IN: data.h
|
* DEFINED IN: glacier_data.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -439,7 +416,7 @@ bool queue_is_full(queue *q) { return (q -> rear == MAX_SIZE); }
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Enqueue an element at the back of the queue.
|
* DESCRIPTION: Enqueue an element at the back of the queue.
|
||||||
* PARAMETERS: queue *q, int value
|
* PARAMETERS: queue *q, int value
|
||||||
* DEFINED IN: data.h
|
* DEFINED IN: glacier_data.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -460,7 +437,7 @@ enqueue (queue *q, int value)
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Dequeue the element at the front of the queue.
|
* DESCRIPTION: Dequeue the element at the front of the queue.
|
||||||
* PARAMETERS: queue *q, int value
|
* PARAMETERS: queue *q, int value
|
||||||
* DEFINED IN: data.h
|
* DEFINED IN: glacier_data.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -480,7 +457,7 @@ dequeue(queue *q)
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: View the element at the front of the queue.
|
* DESCRIPTION: View the element at the front of the queue.
|
||||||
* PARAMETERS: struct node *root, int level
|
* PARAMETERS: struct node *root, int level
|
||||||
* DEFINED IN: data.h
|
* DEFINED IN: glacier_data.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -500,7 +477,7 @@ peek(queue *q)
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Print the queue.
|
* DESCRIPTION: Print the queue.
|
||||||
* PARAMETERS: queue *q
|
* PARAMETERS: queue *q
|
||||||
* DEFINED IN: data.h
|
* DEFINED IN: glacier_data.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -525,7 +502,7 @@ print_queue(queue *q)
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Creates a new Glacier workspace in /tmp.
|
* DESCRIPTION: Creates a new Glacier workspace in /tmp.
|
||||||
* PARAMETERS: None.
|
* PARAMETERS: None.
|
||||||
* DEFINED IN: pkgops.h
|
* DEFINED IN: glacier_pkgops.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -554,10 +531,11 @@ mkworkspace(void)
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Copies a package archive from the localdb to the workspace, and unpacks it.
|
* DESCRIPTION: Copies a package archive from the localdb to the workspace, and unpacks it.
|
||||||
* PARAMETERS: char PACKAGE[]
|
* PARAMETERS: char PACKAGE[]
|
||||||
* DEFINED IN: pkgops.h
|
* DEFINED IN: glacier_pkgops.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
prepare_pkg(char PACKAGE[])
|
prepare_pkg(char PACKAGE[])
|
||||||
{
|
{
|
||||||
@ -609,12 +587,35 @@ prepare_pkg(char PACKAGE[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* download_package_sources() is deprecated and will be removed in a later release. */
|
||||||
|
|
||||||
|
/* int
|
||||||
|
download_package_sources(char PACKAGE[])
|
||||||
|
{
|
||||||
|
printf(COL_BLUE "[i] " COL_RESET "Downloading package archive for %s...\n", PACKAGE);
|
||||||
|
if (GLACIER_SYSTEM_PROFILE == "x86-musl") {
|
||||||
|
execl("/glacier/tools/wget", "https://git.everestlinux.org/EverestLinux/epkgs-x86-musl/", NULL);
|
||||||
|
} else {
|
||||||
|
printf(COL_RED "[x] " COL_RESET "System profile '%s' is not supported.\n", GLACIER_SYSTEM_PROFILE);
|
||||||
|
}
|
||||||
|
} */
|
||||||
|
|
||||||
|
void
|
||||||
|
TEST_chdir(char dir[])
|
||||||
|
{
|
||||||
|
char *buf;
|
||||||
|
chdir(dir);
|
||||||
|
buf = (char *) malloc(100*sizeof(char));
|
||||||
|
getcwd(buf, 100);
|
||||||
|
printf("%s\n", buf);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* run_make_task
|
* run_make_task
|
||||||
*
|
*
|
||||||
* DESCRIPTION: Runs a make task in current working directory
|
* DESCRIPTION: Runs a make task in current working directory
|
||||||
* PARAMETERS: char TASK[]
|
* PARAMETERS: char TASK[]
|
||||||
* DEFINED IN: pkgops.h
|
* DEFINED IN: glacier_pkgops.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -642,11 +643,10 @@ run_make_task(char TASK[])
|
|||||||
*
|
*
|
||||||
* DESCRIPTION: Compare two file hashes
|
* DESCRIPTION: Compare two file hashes
|
||||||
* PARAMETERS: char ORIG_HASH[], char FILE[]
|
* PARAMETERS: char ORIG_HASH[], char FILE[]
|
||||||
* DEFINED IN: security.h
|
* DEFINED IN: glacier_security.h
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
int
|
int
|
||||||
compare_file_hash(char ORIG_HASH[], char FILE[])
|
compare_file_hash(char ORIG_HASH[], char FILE[])
|
||||||
{
|
{
|
||||||
@ -677,4 +677,3 @@ compare_file_hash(char ORIG_HASH[], char FILE[])
|
|||||||
printf("%02x", hash[i]);
|
printf("%02x", hash[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
27
pkg/run-pkg.c
Normal file
27
pkg/run-pkg.c
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#include <errno.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
run_make_task(char task[])
|
||||||
|
{
|
||||||
|
char *build_args[] = {
|
||||||
|
"/bin/make",
|
||||||
|
task,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
execvp(
|
||||||
|
"/bin/make",
|
||||||
|
build_args
|
||||||
|
);
|
||||||
|
if (errno != 0 ) {
|
||||||
|
return errno;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
run_make_task("help");
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user