fix problem with trailing slashes on dir files

OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=133
This commit is contained in:
Michael Schröder 2011-07-20 11:43:02 +00:00 committed by Git OBS Bridge
parent edbd0dd1bd
commit 09d5a8ee67
3 changed files with 102 additions and 66 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Jul 20 13:42:16 CEST 2011 - mls@suse.de
- fix problem with trailing slashes on dir files
-------------------------------------------------------------------
Mon Jul 18 19:43:34 CEST 2011 - mls@suse.de

132
rpm.spec
View File

@ -49,68 +49,69 @@ Patch11: debugedit.diff
Patch12: localetag.diff
Patch13: missingok.diff
Patch14: nameversioncompare.diff
Patch16: dbfsync.diff
Patch17: dbrointerruptable.diff
Patch18: extcond.diff
Patch19: refreshtestarch.diff
Patch20: rpmrctests.diff
Patch21: waitlock.diff
Patch22: suspendlock.diff
Patch23: weakdeps.diff
Patch24: autodeps.diff
Patch25: brp.diff
Patch26: brpcompress.diff
Patch27: checkfilesnoinfodir.diff
Patch28: finddebuginfo.diff
Patch29: findksyms.diff
Patch30: findlang.diff
Patch31: macrosin.diff
Patch32: modalias.diff
Patch33: platformin.diff
Patch34: rpmpopt.diff
Patch35: rpmrc.diff
Patch36: taggedfileindex.diff
Patch37: rpmqpack.diff
Patch38: convertdb1static.diff
Patch39: build.diff
Patch40: modalias-kernel_module.diff
Patch41: files.diff
Patch42: debugedit-comp-dir.diff
Patch43: perlprov.diff
Patch44: rpm-shorten-changelog.diff
Patch45: debugsource-package.diff
Patch46: whatrequires-doc.diff
Patch47: remove-brp-strips.diff
Patch48: requires-ge-macro.diff
Patch50: debugedit-canon-fix.diff
Patch51: finddebuginfo-absolute-links.diff
Patch52: firmware.diff
Patch53: specfilemacro.diff
Patch54: modalias-encode.diff
Patch55: disttag-macro.diff
Patch56: buildidprov.diff
Patch57: debugsubpkg.diff
Patch58: debuglink.diff
Patch59: debuginfo-mono.patch
Patch60: lazystatfs.diff
Patch61: repackage-nomd5.diff
Patch62: safeugid.diff
Patch63: noprereqdeprec.diff
Patch64: pythondeps.diff
Patch65: fontprovides.diff
Patch66: rpm-gst-provides.patch
Patch67: langnoc.diff
Patch68: initscriptsprov.diff
Patch69: remove-translations.diff
Patch70: no_rep_autop.diff
Patch71: headeradddb.diff
Patch74: dbprivate.diff
Patch75: nobuildcolor.diff
Patch76: fileattrs.diff
Patch78: nomagiccheck.diff
Patch79: findsupplements.diff
Patch83: assumeexec.diff
Patch84: buildpipe.diff
Patch15: dbfsync.diff
Patch16: dbrointerruptable.diff
Patch17: extcond.diff
Patch18: refreshtestarch.diff
Patch19: rpmrctests.diff
Patch20: waitlock.diff
Patch21: suspendlock.diff
Patch22: weakdeps.diff
Patch23: autodeps.diff
Patch24: brp.diff
Patch25: brpcompress.diff
Patch26: checkfilesnoinfodir.diff
Patch27: finddebuginfo.diff
Patch28: findksyms.diff
Patch29: findlang.diff
Patch30: macrosin.diff
Patch31: modalias.diff
Patch32: platformin.diff
Patch33: rpmpopt.diff
Patch34: rpmrc.diff
Patch35: taggedfileindex.diff
Patch36: rpmqpack.diff
Patch37: convertdb1static.diff
Patch38: build.diff
Patch39: modalias-kernel_module.diff
Patch40: files.diff
Patch41: debugedit-comp-dir.diff
Patch42: perlprov.diff
Patch43: rpm-shorten-changelog.diff
Patch44: debugsource-package.diff
Patch45: whatrequires-doc.diff
Patch46: remove-brp-strips.diff
Patch47: requires-ge-macro.diff
Patch48: debugedit-canon-fix.diff
Patch49: finddebuginfo-absolute-links.diff
Patch50: firmware.diff
Patch51: specfilemacro.diff
Patch52: modalias-encode.diff
Patch53: disttag-macro.diff
Patch54: buildidprov.diff
Patch55: debugsubpkg.diff
Patch56: debuglink.diff
Patch57: debuginfo-mono.patch
Patch58: lazystatfs.diff
Patch59: repackage-nomd5.diff
Patch60: safeugid.diff
Patch61: noprereqdeprec.diff
Patch62: pythondeps.diff
Patch63: fontprovides.diff
Patch64: rpm-gst-provides.patch
Patch65: langnoc.diff
Patch66: initscriptsprov.diff
Patch67: remove-translations.diff
Patch68: no_rep_autop.diff
Patch69: headeradddb.diff
Patch70: dbprivate.diff
Patch71: nobuildcolor.diff
Patch72: fileattrs.diff
Patch73: nomagiccheck.diff
Patch74: findsupplements.diff
Patch75: assumeexec.diff
Patch76: buildpipe.diff
Patch77: trailslash.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#
# avoid bootstrapping problem
@ -167,14 +168,13 @@ chmod -R u+w db/*
# will get linked from db3
rm -f rpmdb/db.h
%patch -P 1 -P 2
%patch -P 10 -P 11 -P 12 -P 13 -P 14 -P 16 -P 17 -P 18 -P 19
%patch -P 10 -P 11 -P 12 -P 13 -P 14 -P 15 -P 16 -P 17 -P 18 -P 19
%patch -P 20 -P 21 -P 22 -P 23 -P 24 -P 25 -P 26 -P 27 -P 28 -P 29
%patch -P 30 -P 31 -P 32 -P 33 -P 34 -P 35 -P 36 -P 37 -P 38 -P 39
%patch -P 40 -P 41 -P 42 -P 43 -P 44 -P 45 -P 46 -P 47 -P 48
%patch -P 40 -P 41 -P 42 -P 43 -P 44 -P 45 -P 46 -P 47 -P 48 -P 49
%patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58 -P 59
%patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69
%patch -P 70 -P 71 -P 74 -P 75 -P 76 -P 78 -P 79
%patch -P 83 -P 84
%patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77
#chmod 755 scripts/find-supplements{,.ksyms}
#chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms
#chmod 755 scripts/firmware.prov

31
trailslash.diff Normal file
View File

@ -0,0 +1,31 @@
--- ./build/files.c.orig 2011-07-20 11:37:45.000000000 +0000
+++ ./build/files.c 2011-07-20 11:39:20.000000000 +0000
@@ -1678,9 +1678,6 @@ static rpmRC processBinaryFile(Package p
* /.././../usr/../bin//./sh
*/
diskPath = rpmGenPath(fl->buildRoot, NULL, fileName);
- /* Arrange trailing slash on directories */
- if (fl->isDir)
- diskPath = rstrcat(&diskPath, "/");
if (doGlob) {
ARGV_t argv = NULL;
@@ -1694,8 +1691,18 @@ static rpmRC processBinaryFile(Package p
goto exit;
}
+ /* Arrange trailing slash on directories */
+ if (fl->isDir)
+ diskPath = rstrcat(&diskPath, "/");
+
if (rpmGlob(diskPath, &argc, &argv) == 0 && argc >= 1) {
for (i = 0; i < argc; i++) {
+ if (fl->isDir) {
+ /* strip trailing slash again */
+ int l = strlen(argv[i]);
+ if (l > 1 && argv[i][l - 1] == '/')
+ argv[i][l - 1] = 0;
+ }
rc = addFile(fl, argv[i], NULL);
}
argvFree(argv);