]> git.pld-linux.org Git - packages/rpm.git/blame - rpm-hardlink-fixes.patch
- first step to upcomming 4.0.4
[packages/rpm.git] / rpm-hardlink-fixes.patch
CommitLineData
8c79f830
JB
1diff -Nur rpm-4.0.2.orig/build/files.c rpm-4.0.2/build/files.c
2--- rpm-4.0.2.orig/build/files.c Fri Jan 19 02:47:25 2001
3+++ rpm-4.0.2/build/files.c Tue Dec 25 21:17:42 2001
4@@ -911,6 +911,37 @@
5 ilp = fl->fileList + i;
6 ilp->flags &= ~RPMFILE_SPECFILE;
7 }
8+
9+ /* try to fix lang marks for lang-marked dirs that contain lang-marked
10+ * hardlinks */
11+ for (i = 0; i < fl->fileListRecsUsed; i++) {
12+ char *te;
13+
14+ ilp = fl->fileList + i;
15+ if(!S_ISDIR(ilp->fl_mode) || !ilp->langs[0])
16+ continue;
17+ te = nlangs;
18+ *te = '\0';
19+ for (j = i + 1; j < fl->fileListRecsUsed; j++) {
20+ jlp = fl->fileList + j;
21+ if (!S_ISREG(jlp->fl_mode) || jlp->fl_nlink <= 1)
22+ continue;
23+ if (strncmp(jlp->fileURL, ilp->fileURL, strlen(ilp->fileURL)))
24+ continue;
25+ if (!strcmp(ilp->langs, jlp->langs))
26+ continue;
27+ if (te == nlangs)
28+ te = stpcpy(te, ilp->langs);
29+ *te++ = '|';
30+ te = stpcpy(te, jlp->langs);
31+ }
32+
33+ if (te == nlangs)
34+ continue;
35+
36+ free((void *)ilp->langs);
37+ ilp->langs = xstrdup(nlangs);
38+ }
39 }
40
41 /**
42diff -Nur rpm-4.0.2.orig/lib/cpio.c rpm-4.0.2/lib/cpio.c
43--- rpm-4.0.2.orig/lib/cpio.c Wed Jan 3 20:29:11 2001
44+++ rpm-4.0.2/lib/cpio.c Tue Dec 25 20:52:41 2001
45@@ -670,7 +670,7 @@
46 static int createLinks(struct hardLink * li, /*@out@*/ const char ** failedFile)
47 /*@modifies fileSystem, *failedFile, li->files, li->linksLeft @*/
48 {
49- int i;
50+ int i,rc;
51 struct stat sb;
52
53 for (i = 0; i < li->nlink; i++) {
54@@ -685,6 +685,13 @@
55 }
56 }
57
58+ rc = checkDirectory(li->files[i]);
59+ if (rc) {
60+ if (failedFile)
61+ *failedFile = xstrdup(li->files[i]);
62+ return rc;
63+ }
64+
65 if (link(li->files[li->createdPath], li->files[i])) {
66 if (failedFile)
67 *failedFile = xstrdup(li->files[i]);
This page took 0.035804 seconds and 4 git commands to generate.