1 | Upgrading Scripts for a new Fedora distribution |
---|
2 | =============================================== |
---|
3 | |
---|
4 | 1. Gather knowledge |
---|
5 | ------------------- |
---|
6 | |
---|
7 | You should read the Release Notes for all of the intervening |
---|
8 | releases. For example, here are the Fedora 13 release notes: |
---|
9 | |
---|
10 | http://docs.fedoraproject.org/en-US/Fedora/13/html/Release_Notes/ |
---|
11 | |
---|
12 | Because we sometimes skip releases, you should read any skipped |
---|
13 | release's report notes. |
---|
14 | |
---|
15 | Example: |
---|
16 | |
---|
17 | In Fedora 12, i586 was deprecated in favor of i686; this meant |
---|
18 | that any parts of Scripts that referenced i586 explicitly had to |
---|
19 | changed to i686. |
---|
20 | |
---|
21 | 2. Update the Scripts build environment |
---|
22 | --------------------------------------- |
---|
23 | |
---|
24 | A large amount of the Scripts source repository is Fedora Release |
---|
25 | specific, so when you are ramping up the new release, you will want |
---|
26 | a new branch to do development on, before merging back upon the |
---|
27 | official release. You can do this with: |
---|
28 | |
---|
29 | svn cp svn://scripts.mit.edu/trunk \ |
---|
30 | svn://scripts.mit.edu/branches/fcXX-dev |
---|
31 | |
---|
32 | On the new branch, there are a number of files you will have to |
---|
33 | update: |
---|
34 | |
---|
35 | 2.1 Mock |
---|
36 | |
---|
37 | Mock needs to be setup for the new environment. The first thing to do |
---|
38 | is to update the Makefile by substituting |
---|
39 | s/scripts-fcOLD/scripts-fcNEW/g on the /usr/bin/mock invocations. |
---|
40 | After that, you need to go to /etc/mock and create the new cfg file |
---|
41 | for the new scripts-fcXX-ARCH configurations (where ARCH is x86_64 and |
---|
42 | i386). You can base the new cfg off of the older version's, however |
---|
43 | you will want to make the following changes: |
---|
44 | |
---|
45 | * Update all references to the old Fedora release to the new |
---|
46 | Fedora release. This includes root, dist, mirrorlist, baseurl |
---|
47 | |
---|
48 | * Temporarily disabling the web.mit.edu Scripts RPM repository |
---|
49 | and the local RPM repository by setting enabled=0 (it's there for |
---|
50 | a reason!) However, the local RPM repository is fairly painless |
---|
51 | to create and will come in handy when you start attempting to |
---|
52 | build packages that have dependencies on other scriptsified |
---|
53 | packages: you can set one up as scripts-build with: |
---|
54 | |
---|
55 | mkdir ~/mock-local |
---|
56 | createrepo ~/mock-local |
---|
57 | |
---|
58 | 3. Rebuild Scripts packages |
---|
59 | --------------------------- |
---|
60 | |
---|
61 | In order to support specific extra functionality, we have scriptsified |
---|
62 | a variety of Fedora packages. When the base packages get upgrades, |
---|
63 | we need to upgrade the scriptsification. Some of the following topics |
---|
64 | are covered in 'package-build-howto', but a new Fedora release tends |
---|
65 | to also result in somewhat rarer situations. |
---|
66 | |
---|
67 | Here are some of the common troubles you'll have to deal with: |
---|
68 | |
---|
69 | 3.1 Spec patches are no longer necessary |
---|
70 | |
---|
71 | When a Fedora release gets EOL'ed, we may continue to backport |
---|
72 | patches for CVE's manually. When we upgrade to a non-EOL'd release, |
---|
73 | those patches will generally become unnecessary and can be dropped. |
---|
74 | |
---|
75 | You can drop a modified specfile from the repository simply by |
---|
76 | `svn rm`ing: |
---|
77 | |
---|
78 | * The spec patch in server/fedora/specs, |
---|
79 | * The source code patch in server/common/patches, and |
---|
80 | * The upstream_yum entry in server/fedora/Makefile |
---|
81 | |
---|
82 | If a specfile merely bumps the version field, there may be no extra |
---|
83 | patch (this indicates that the maintainer rebuilt the package simply |
---|
84 | by manually dropping the new source tarball in rpmbuild/SOURCES, |
---|
85 | which is kind of sketchy but works. See -c 1586 for an example.) |
---|
86 | |
---|
87 | 3.2 Spec patches no longer apply |
---|
88 | |
---|
89 | Symptom: |
---|
90 | |
---|
91 | $ make patch-specs |
---|
92 | patching file openssh.spec |
---|
93 | Hunk #1 succeeded at 74 with fuzz 2 (offset 11 lines). |
---|
94 | Hunk #2 failed at 88. |
---|
95 | Hunk #3 succeeded at 177 (offset 14 lines). |
---|
96 | Hunk #4 succeeded at 270 with fuzz 2 (offset 36 lines). |
---|
97 | 1 out of 4 hunks failed--saving rejects to openssh.spec.rej |
---|
98 | |
---|
99 | Fix: |
---|
100 | |
---|
101 | The main thing to remember is where the generated files live |
---|
102 | they are placed in rpmbuild/SPECS/openssh.spec{.rej,.orig}. |
---|
103 | A workflow for fixing them might look like: |
---|
104 | |
---|
105 | 1. Inspect the rejects file. |
---|
106 | 2. As much as possible, manually fix the original diff |
---|
107 | file in /srv/repository/server/fedora/specs |
---|
108 | 3. If absolutely necessary, edit the rpmbuild/SPECS/openssh.spec |
---|
109 | file with any final changes (this is dangerous because |
---|
110 | this file is blown away on a successive make) |
---|
111 | 4. Generate a new unified diff: |
---|
112 | diff -u openssh.spec.orig openssh.spec > \ |
---|
113 | /srv/repository/server/fedora/specs\openssh.spec.patch |
---|
114 | |
---|
115 | 3.3 Mock fails with no error message |
---|
116 | |
---|
117 | Fix: You forgot to add scripts-build to the mock group. See |
---|
118 | https://bugzilla.redhat.com/show_bug.cgi?id=630791 |
---|
119 | [XXX: remove this entry when this bug is fixed] |
---|
120 | |
---|
121 | 3.4 Source patches no longer apply |
---|
122 | |
---|
123 | Symptoms: |
---|
124 | |
---|
125 | Generally, you will see these error messages after Mock starts |
---|
126 | building (if they occur before Mock, that means it's a bug in the |
---|
127 | spec patch, not a source patch that the spec patch references.) |
---|
128 | |
---|
129 | Fix: |
---|
130 | |
---|
131 | The error message will be from within a schroot that Mock is using. |
---|
132 | As a result, it's not immediately obvious where the files live. |
---|
133 | There are two approaches you can take: |
---|
134 | |
---|
135 | Find the schroot: XXX to write |
---|
136 | |
---|
137 | Manually patch the source dist: Tarballs for the original source can |
---|
138 | be found in ~/rpmbuild/SOURCES, and then you can manually apply the |
---|
139 | failing patches and debug from there. |
---|
140 | |
---|
141 | 4. "Officializing" everything |
---|
142 | ----------------------------- |
---|
143 | |
---|
144 | web.mit.edu scripts repository (/mit/scripts/rpm-fcXX and |
---|
145 | /mit/scripts/rpm-fcXX-testing) needs to be made [XXX: document how to |
---|
146 | make] |
---|
147 | |
---|
148 | 5. Extra stuff |
---|
149 | -------------- |
---|
150 | |
---|
151 | Fedora occasionally updates the architecture name for 32-bit; the last |
---|
152 | such update was in Fedora 12, when i586 became i686. Fixing this |
---|
153 | usually just involves replacing i586 with i686 in the appropriate places |
---|
154 | (Makefile, specfiles, /etc/mock configuration). Note that for |
---|
155 | hysterical raisins we still refer to our 32-bit builds as i386. |
---|
156 | [XXX: Maybe this should change] |
---|