|
From: Pascal B. <pb...@us...> - 2001-11-28 15:29:15
|
Update of /cvsroot/mpkg/mpkg/src
In directory usw-pr-cvs1:/tmp/cvs-serv5092/src
Modified Files:
rpm.c
Log Message:
* src/rpm.c (make_rpm): Only generate tag pre, post preun and postun
when necessary, this generated any dependencies.
Index: rpm.c
===================================================================
RCS file: /cvsroot/mpkg/mpkg/src/rpm.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rpm.c 2001/11/28 14:33:29 1.3
--- rpm.c 2001/11/28 15:29:12 1.4
***************
*** 131,144 ****
fprintf (fp, "%s\n", dist->descriptions[i]);
! fputs ("%pre\n", fp);
! for (i = dist->num_commands, c = dist->commands; i > 0; i--, c++)
! if (c->type == COMMAND_PRE_INSTALL)
! fprintf (fp, "%s\n", c->command);
! fputs ("%post\n", fp);
! for (i = dist->num_commands, c = dist->commands; i > 0; i--, c++)
! if (c->type == COMMAND_POST_INSTALL)
! fprintf (fp, "%s\n", c->command);
for (i = dist->num_files, file = dist->files; i > 0; i--, file++)
if (tolower (file->type) == 'i')
--- 131,157 ----
fprintf (fp, "%s\n", dist->descriptions[i]);
! /* The probleme with tags %pre %post %preun and %postun, it's that
! they automaticly generate dependency with /bin/sh.
! Well if we could try to limit dependency, that's will be good.
! -- Pascal */
! if (dist->num_commands)
! {
! /* Only put `pre', if user asks for script. */
! fputs ("%pre\n", fp);
! for (i = dist->num_commands, c = dist->commands; i > 0; i--, c++)
! if (c->type == COMMAND_PRE_INSTALL)
! fprintf (fp, "%s\n", c->command);
! }
+ if (dist->num_commands)
+ {
+ /* Only put `post', if user asks for script. */
+ fputs ("%post\n", fp);
+ for (i = dist->num_commands, c = dist->commands; i > 0; i--, c++)
+ if (c->type == COMMAND_POST_INSTALL)
+ fprintf (fp, "%s\n", c->command);
+ }
+
for (i = dist->num_files, file = dist->files; i > 0; i--, file++)
if (tolower (file->type) == 'i')
***************
*** 147,151 ****
if (i)
{
! fputs ("echo Setting up init scripts...\n", fp);
/*
--- 160,164 ----
if (i)
{
! fputs ("echo Setting up init scripts.\n", fp);
/*
***************
*** 198,205 ****
}
! fputs ("%preun\n", fp);
! for (i = dist->num_files, file = dist->files; i > 0; i--, file++)
! if (tolower (file->type) == 'i')
! break;
if (i)
--- 211,221 ----
}
! if (dist->num_files && (file = dist->files) && tolower (file->type) == 'i')
! {
! fputs ("%preun\n", fp);
! for (i = dist->num_files; i > 0; i--, file++)
! if (tolower (file->type) == 'i')
! break;
! }
if (i)
***************
*** 242,249 ****
fprintf (fp, "%s\n", c->command);
! fputs ("%postun\n", fp);
! for (i = dist->num_commands, c = dist->commands; i > 0; i--, c++)
! if (c->type == COMMAND_POST_REMOVE)
! fprintf (fp, "%s\n", c->command);
fputs ("%files\n", fp);
--- 258,268 ----
fprintf (fp, "%s\n", c->command);
! if (dist->num_commands)
! {
! fputs ("%postun\n", fp);
! for (i = dist->num_commands, c = dist->commands; i > 0; i--, c++)
! if (c->type == COMMAND_POST_REMOVE)
! fprintf (fp, "%s\n", c->command);
! }
fputs ("%files\n", fp);
|