libglacier/include/glacier_pkgops.h
2024-10-02 17:30:43 -04:00

73 lines
2.1 KiB
C

/*
* glacier_pkgops.h - Package-related function declarations for libglacier
*
* This file is part of Glacier.
*
* Glacier is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* Glacier is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Glacier. If
* not, see <https://www.gnu.org/licenses/>.
*/
#ifndef GLACIERPKGOPS_H_
#define GLACIERPKGOPS_H_
/*
* mkworkspace
*
* DESCRIPTION: Mkworkspace prepares /tmp/glacier-workspace for an operation
* PARAMETERS:
* None.
* RETURN VAUES:
* 0 on success, 2 on library error
* CAVEATS:
* None.
* EXAMPLE:
* mkworkspace();
*/
int mkworkspace();
/*
* prepare_pkg
*
* DESCRIPTION: Prepare_pkg copies a package archive from the localdb, and untars it
* PARAMETERS:
* char PACKAGE[] -> The package file to prepare
* RETURN VAUES:
* 0 on success, 1 on package does not exist, or error untarring
* CAVEATS:
* The example presented is bad. You should be calling the system profile variable
* rather than manually specifying one.
* EXAMPLE:
* prepare_pkg("/glacier/localdb/epkgs-x86_64-musl/foo.tar");
*/
int prepare_pkg(char PACKAGE[]);
/*
* run_make_task
*
* DESCRIPTION: Run_make_task runs a specified make task in a package's current working directory
* PARAMETERS:
* char TASK[] -> The make task to run
* RETURN VAUES:
* 0 on success, 1 on failure
* CAVEATS:
* MUST be run after prepare_pkg(), or else errors will occur
* Same caveat as above. Do not manually specify the system profile, use its variable.
* EXAMPLE:
* prepare_pkg("/glacier/localdb/epkgs-x86_64-musl/foo.tar");
* run_make_task("installpkg");
*/
int run_make_task(char TASK[]);
#endif