48        const char *tmpdir, *version;
 
   49        const char *shells[] = {
 
   55        char pkgname[XBPS_NAME_SIZE], *fpath;
 
   64                    "install/remove action.\n", pkgver, action);
 
   68        if (strcmp(xhp->
rootdir, 
"/") == 0) {
 
   69                tmpdir = getenv(
"TMPDIR");
 
   75                fpath = strdup(
".xbps-script-XXXXXX");
 
   79        if (chdir(xhp->
rootdir) == -1) {
 
   85        if ((fd = mkstemp(fpath)) == -1) {
 
   88                    __func__, strerror(errno));
 
   92        ret = write(fd, blob, blobsiz);
 
   96                    __func__, strerror(errno));
 
  116        for (i = 0; shells[i] != NULL; i++) {
 
  117                if (access(shells[i], X_OK) == 0) {
 
  121        if (shells[i] != NULL) {
 
  122                rv = xbps_file_exec(xhp, shells[i], fpath, action, pkgname, version,
 
  123                                update ? 
"yes" : 
"no",
 
  125        } 
else if (access(
"/bin/busybox", X_OK) == 0) {
 
  126                rv = xbps_file_exec(xhp, 
"/bin/busybox", 
"sh", fpath, action, pkgname, version,
 
  127                                update ? 
"yes" : 
"no",
 
  129        } 
else if (access(
"/bin/busybox.static", X_OK) == 0) {
 
  130                rv = xbps_file_exec(xhp, 
"/bin/busybox.static", 
"sh", fpath, action, pkgname, version,
 
  131                                update ? 
"yes" : 
"no",
 
 
  153        const char *pkgver = NULL;
 
  161        data = xbps_dictionary_get(d, script);
 
  165        xbps_dictionary_get_cstring_nocopy(d, 
"pkgver", &pkgver);
 
  167        buf = xbps_data_data_nocopy(data);
 
  168        buflen = xbps_data_size(data);
 
 
int xbps_pkg_exec_buffer(struct xbps_handle *xhp, const void *blob, const size_t blobsiz, const char *pkgver, const char *action, bool update)