ALT Linux Bugzilla
– Attachment 671 Details for
Bug 5662
Дублирование куска спека в выводе rpm -bE
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Теперь используется ftruncate
rpm.patch (text/plain), 2.12 KB, created by
Kirill A. Shutemov
on 2004-12-15 15:13:49 MSK
(
hide
)
Description:
Теперь используется ftruncate
Filename:
MIME Type:
Creator:
Kirill A. Shutemov
Created:
2004-12-15 15:13:49 MSK
Size:
2.12 KB
patch
obsolete
>--- rpm-4_0-4.0.4-orig/build/parseSpec.c 2002-03-26 01:09:32 +0200 >+++ rpm-4_0-4.0.4/build/parseSpec.c 2004-12-15 13:41:44 +0200 >@@ -16,6 +16,8 @@ > > /*@access FD_t @*/ /* compared with NULL */ > >+static FILE* temp_file;/*temporary file to output preprocessing spec*/ >+ > /** > */ > /*@unchecked@*/ >@@ -362,7 +364,7 @@ > > if ( '\n' == chomped[len-1] ) > chomped[len-1] = '\0'; >- puts( chomped ); >+ fprintf(temp_file, "%s\n", chomped ); > chomped = _free( chomped ); > } > >@@ -396,6 +398,10 @@ > { > rpmParseState parsePart = PART_PREAMBLE; > int initialPackage = 1; >+ char temp_filename_pattern[25]="preprocessed-spec.XXXXXX"; >+ int temp_fd; >+ char line[255]; >+ > #ifdef DYING > const char *saveArch; > #endif >@@ -416,6 +422,35 @@ > spec->fileStack = newOpenFileInfo(); > spec->fileStack->fileName = xstrdup(spec->specFile); > spec->preprocess_mode = preprocess; >+ >+ if (spec->preprocess_mode) >+ if (!recursing){ >+ temp_fd = mkstemp(temp_filename_pattern); >+ if (temp_fd == -1) { >+ rpmError(RPMERR_CREATE, _("Cannot open temporary file")); >+ return RPMERR_CREATE; >+ } >+ if (!(temp_file = fdopen(temp_fd, "w+b"))) { >+ rpmError(RPMERR_CREATE, _("Cannot create temporary file descriptor")); >+ return RPMERR_CREATE; >+ } >+ if (unlink(temp_filename_pattern) == -1) { >+ rpmError(RPMERR_UNLINK, _("Cannot delete temporary file")); >+ return RPMERR_UNLINK; >+ } >+ }else{ >+ if (ftruncate(fileno(temp_file),0)){ >+ /*FIX: witch error code should be use here?*/ >+ rpmError(RPMERR_CREATE, _("Cannot truncate temporary file")); >+ return RPMERR_CREATE; >+ } >+ >+ if (fseek(temp_file,0,SEEK_SET)){ >+ rpmError(RPMERR_FSEEK, _("Cannot seek temporary file")); >+ return RPMERR_FSEEK; >+ } >+ } >+ > if (buildRootURL) { > const char * buildRoot; > (void) urlPath(buildRootURL, &buildRoot); >@@ -636,5 +671,15 @@ > closeSpec(spec); > *specp = spec; > >+ if (spec->preprocess_mode){ >+ if (!fseek(temp_file,0,SEEK_SET)) >+ while(fgets(line,255,temp_file)) >+ printf("%s",line); >+ else{ >+ rpmError(RPMERR_FSEEK, _("Cannot seek temporary file")); >+ return RPMERR_FSEEK; >+ } >+ } >+ > return 0; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 5662
:
664
| 671