mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
Remove scriptlet START and DONE commands that we don't use
The scriptlet calling had some unneeded complexity for the time being which we aren't using here. Let's get rid of it until we find a good way to implement it correctly. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
1e56e41d63
commit
ad691001e2
@ -287,9 +287,6 @@ typedef enum _pmtransevt_t {
|
||||
PM_TRANS_EVT_EXTRACT_DONE,
|
||||
PM_TRANS_EVT_INTEGRITY_START,
|
||||
PM_TRANS_EVT_INTEGRITY_DONE,
|
||||
PM_TRANS_EVT_SCRIPTLET_INFO,
|
||||
PM_TRANS_EVT_SCRIPTLET_START,
|
||||
PM_TRANS_EVT_SCRIPTLET_DONE,
|
||||
PM_TRANS_EVT_PRINTURI,
|
||||
PM_TRANS_EVT_RETRIEVE_START,
|
||||
} pmtransevt_t;
|
||||
|
@ -642,7 +642,6 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
|
||||
}
|
||||
|
||||
if(pid == 0) {
|
||||
FILE *pp;
|
||||
_alpm_log(PM_LOG_DEBUG, _("chrooting in %s"), root);
|
||||
if(chroot(root) != 0) {
|
||||
_alpm_log(PM_LOG_ERROR, _("could not change the root directory (%s)"), strerror(errno));
|
||||
@ -654,37 +653,7 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
|
||||
}
|
||||
umask(0022);
|
||||
_alpm_log(PM_LOG_DEBUG, _("executing \"%s\""), cmdline);
|
||||
pp = popen(cmdline, "r");
|
||||
if(!pp) {
|
||||
_alpm_log(PM_LOG_ERROR, _("call to popen failed (%s)"), strerror(errno));
|
||||
retval = 1;
|
||||
goto cleanup;
|
||||
}
|
||||
while(!feof(pp)) {
|
||||
char line[1024];
|
||||
if(fgets(line, 1024, pp) == NULL)
|
||||
break;
|
||||
/*TODO clean this code up, remove weird SCRIPTLET_START/DONE,
|
||||
* (void*)atol call, etc. */
|
||||
/* "START <event desc>" */
|
||||
if((strlen(line) > strlen(SCRIPTLET_START))
|
||||
&& !strncmp(line, SCRIPTLET_START, strlen(SCRIPTLET_START))) {
|
||||
EVENT(trans, PM_TRANS_EVT_SCRIPTLET_START,
|
||||
_alpm_strtrim(line + strlen(SCRIPTLET_START)), NULL);
|
||||
/* "DONE <ret code>" */
|
||||
} else if((strlen(line) > strlen(SCRIPTLET_DONE))
|
||||
&& !strncmp(line, SCRIPTLET_DONE, strlen(SCRIPTLET_DONE))) {
|
||||
EVENT(trans, PM_TRANS_EVT_SCRIPTLET_DONE,
|
||||
(void*)atol(_alpm_strtrim(line + strlen(SCRIPTLET_DONE))),
|
||||
NULL);
|
||||
} else {
|
||||
_alpm_strtrim(line);
|
||||
/* log our script output */
|
||||
alpm_logaction(line);
|
||||
EVENT(trans, PM_TRANS_EVT_SCRIPTLET_INFO, line, NULL);
|
||||
}
|
||||
}
|
||||
pclose(pp);
|
||||
execl("/bin/sh", "sh", "-c", cmdline, (char *)NULL);
|
||||
exit(0);
|
||||
} else {
|
||||
if(waitpid(pid, 0, 0) == -1) {
|
||||
|
@ -40,10 +40,6 @@
|
||||
#define _(s) s
|
||||
#endif
|
||||
|
||||
/*TODO wtf? why is this done like this? */
|
||||
#define SCRIPTLET_START "START "
|
||||
#define SCRIPTLET_DONE "DONE "
|
||||
|
||||
int _alpm_makepath(const char *path);
|
||||
int _alpm_copyfile(const char *src, const char *dest);
|
||||
char *_alpm_strtoupper(char *str);
|
||||
|
@ -237,20 +237,6 @@ void cb_trans_evt(pmtransevt_t event, void *data1, void *data2)
|
||||
case PM_TRANS_EVT_INTEGRITY_DONE:
|
||||
printf(_("done.\n"));
|
||||
break;
|
||||
case PM_TRANS_EVT_SCRIPTLET_INFO:
|
||||
printf("%s\n", (char*)data1);
|
||||
break;
|
||||
case PM_TRANS_EVT_SCRIPTLET_START:
|
||||
printf((char*)data1);
|
||||
printf("...");
|
||||
break;
|
||||
case PM_TRANS_EVT_SCRIPTLET_DONE:
|
||||
if(!(long)data1) {
|
||||
printf(_("done.\n"));
|
||||
} else {
|
||||
printf(_("failed.\n"));
|
||||
}
|
||||
break;
|
||||
case PM_TRANS_EVT_PRINTURI:
|
||||
printf("%s/%s\n", (char*)data1, (char*)data2);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user