Browse code

toybox: fix conflicts with shadow

shadow-tools: new subpackage which has alternatives to toybox
package builder: resolve cyclic dependencies such as
shadow-tools -> shadow -> (shadow-tools or toybox)

Change-Id: I3b56d961280c9b46a22ebed84245368ec03123fb
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4009
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Vinay Kulkarni <kulkarniv@vmware.com>

Alexey Makhalov authored on 2017/10/11 07:43:52
Showing 7 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        NFS client utils
2 2
 Name:           nfs-utils
3 3
 Version:        2.1.1
4
-Release:        6%{?dist}
4
+Release:        7%{?dist}
5 5
 License:        GPLv2+
6 6
 URL:            http://sourceforge.net/projects/nfs
7 7
 Group:          Applications/Nfs-utils-client
... ...
@@ -21,7 +21,7 @@ BuildRequires:  libtirpc-devel
21 21
 BuildRequires:  python3-devel
22 22
 Requires:       libtirpc
23 23
 Requires:       rpcbind
24
-Requires:       (shadow or toybox)
24
+Requires:       shadow
25 25
 Requires:       python3-libs
26 26
 
27 27
 %description
... ...
@@ -80,6 +80,8 @@ make check
80 80
 /lib/systemd/system/*
81 81
 
82 82
 %changelog
83
+*   Tue Oct 10 2017 Alexey Makhalov <amakhalov@vmware.com> 2.1.1-7
84
+-   No direct toybox dependency, shadow depends on toybox
83 85
 *   Mon Sep 18 2017 Alexey Makhalov <amakhalov@vmware.com> 2.1.1-6
84 86
 -   Requires shadow or toybox
85 87
 *   Thu Aug 24 2017 Alexey Makhalov <amakhalov@vmware.com> 2.1.1-5
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        Free version of the SSH connectivity tools
2 2
 Name:           openssh
3 3
 Version:        7.5p1
4
-Release:        7%{?dist}
4
+Release:        8%{?dist}
5 5
 License:        BSD
6 6
 URL:            https://www.openssh.com/
7 7
 Group:          System Environment/Security
... ...
@@ -38,7 +38,7 @@ This provides the ssh client utilities.
38 38
 %package server
39 39
 Summary: openssh server applications
40 40
 Requires:   Linux-PAM
41
-Requires:   (shadow or toybox)
41
+Requires:   shadow
42 42
 Requires:   ncurses-terminfo
43 43
 Requires:   openssh-clients = %{version}-%{release}
44 44
 Requires(post): /bin/chown
... ...
@@ -178,6 +178,8 @@ rm -rf %{buildroot}/*
178 178
 %{_mandir}/man8/ssh-pkcs11-helper.8.gz
179 179
 
180 180
 %changelog
181
+*   Tue Oct 10 2017 Alexey Makhalov <amakhalov@vmware.com> 7.5p1-8
182
+-   No direct toybox dependency, shadow depends on toybox
181 183
 *   Mon Sep 18 2017 Alexey Makhalov <amakhalov@vmware.com> 7.5p1-7
182 184
 -   Requires shadow or toybox
183 185
 *   Thu Sep 14 2017 Alexey Makhalov <amakhalov@vmware.com> 7.5p1-6
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        Programs for handling passwords in a secure way
2 2
 Name:           shadow
3 3
 Version:        4.2.1
4
-Release:        13%{?dist}
4
+Release:        14%{?dist}
5 5
 URL:            http://pkg-shadow.alioth.debian.org/
6 6
 License:        BSD
7 7
 Group:          Applications/System
... ...
@@ -19,11 +19,19 @@ BuildRequires:  cracklib-devel
19 19
 Requires:       cracklib
20 20
 BuildRequires:  Linux-PAM-devel
21 21
 Requires:       Linux-PAM
22
+Requires:       (%{name}-tools = %{version}-%{release} or toybox)
22 23
 
23 24
 %description
24 25
 The Shadow package contains programs for handling passwords
25 26
 in a secure way.
26 27
 
28
+%package tools
29
+Summary: Contains subset of tools which might be replaced by toybox
30
+Group:      Applications/System
31
+Requires: %{name} = %{version}-%{release}
32
+%description tools
33
+Contains subset of tools which might be replaced by toybox
34
+
27 35
 %package lang
28 36
 Summary: Additional language files for shadow
29 37
 Group:      Applications/System
... ...
@@ -110,7 +118,6 @@ make %{?_smp_mflags} check
110 110
 %config(noreplace) /etc/login.access
111 111
 %config(noreplace) /etc/default/useradd
112 112
 %config(noreplace) /etc/limits
113
-/bin/*
114 113
 /sbin/nologin
115 114
 %{_bindir}/*
116 115
 %{_sbindir}/*
... ...
@@ -137,10 +144,17 @@ make %{?_smp_mflags} check
137 137
 %exclude %{_mandir}/zh_TW
138 138
 %config(noreplace) %{_sysconfdir}/pam.d/*
139 139
 
140
+%files tools
141
+%defattr(-,root,root)
142
+/bin/*
143
+
140 144
 %files lang -f %{name}.lang
141 145
 %defattr(-,root,root)
142 146
 
143 147
 %changelog
148
+*   Tue Oct 10 2017 Alexey Makhalov <amakhalov@vmware.com> 4.2.1-14
149
+-   Added -tools subpackage
150
+-   Main package requires -tools or toybox
144 151
 *   Tue Aug 15 2017 Anish Swaminathan <anishs@vmware.com> 4.2.1-13
145 152
 -   Added fix for CVE-2017-12424, CVE-2016-6252
146 153
 *   Thu Apr 27 2017 Divya Thaluru <dthaluru@vmware.com> 4.2.1-12
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        Sudo
2 2
 Name:           sudo
3 3
 Version:        1.8.20p2
4
-Release:        3%{?dist}
4
+Release:        4%{?dist}
5 5
 License:        ISC
6 6
 URL:            https://www.sudo.ws/
7 7
 Group:          System Environment/Security
... ...
@@ -12,7 +12,7 @@ Source0:        http://www.sudo.ws/sudo/dist/%{name}-%{version}.tar.gz
12 12
 BuildRequires:  man-db
13 13
 BuildRequires:  Linux-PAM-devel
14 14
 Requires:       Linux-PAM
15
-Requires:       (shadow or toybox)
15
+Requires:       shadow
16 16
 
17 17
 %description
18 18
 The Sudo package allows a system administrator to give certain users (or groups of users) 
... ...
@@ -90,6 +90,8 @@ rm -rf %{buildroot}/*
90 90
 %exclude  /etc/sudoers.dist
91 91
 
92 92
 %changelog
93
+*   Tue Oct 10 2017 Alexey Makhalov <amakhalov@vmware.com> 1.8.20p2-4
94
+-   No direct toybox dependency, shadow depends on toybox
93 95
 *   Mon Sep 18 2017 Alexey Makhalov <amakhalov@vmware.com> 1.8.20p2-3
94 96
 -   Requires shadow or toybox
95 97
 *   Fri Jul 07 2017 Chang Lee <changlee@vmware.com> 1.8.20p2-2
... ...
@@ -79,6 +79,7 @@ class PackageBuilder(object):
79 79
             # TODO: self.logger might be None
80 80
             self.logger.error(e)
81 81
             outputMap[threadName]=False
82
+            raise e
82 83
 
83 84
     def checkIfPackageIsAlreadyBuilt(self):
84 85
         basePkg=SPECS.getData().getSpecName(self.package)
... ...
@@ -152,6 +153,8 @@ class PackageBuilder(object):
152 152
     def installPackage(self,pkgUtils,package,chrootID,destLogPath,listInstalledPackages):
153 153
         if package in listInstalledPackages:
154 154
             return
155
+        # mark it as installed -  to avoid cyclic recursion
156
+        listInstalledPackages.append(package)
155 157
         self.installDependentRunTimePackages(pkgUtils,package,chrootID,destLogPath,listInstalledPackages)
156 158
         noDeps=False
157 159
         if self.mapPackageToCycles.has_key(package):
... ...
@@ -161,7 +164,6 @@ class PackageBuilder(object):
161 161
         if package in constants.noDepsPackageList:
162 162
             noDeps=True
163 163
         pkgUtils.installRPM(package,chrootID,noDeps,destLogPath)
164
-        listInstalledPackages.append(package)
165 164
 
166 165
     def installDependentRunTimePackages(self,pkgUtils,package,chrootID,destLogPath,listInstalledPackages):
167 166
         listRunTimeDependentPackages=self.findRunTimeRequiredRPMPackages(package)
... ...
@@ -393,6 +393,9 @@ class SerializedSpecObjects(object):
393 393
         specName = self.getSpecName(inPkg)
394 394
         specObj = self.mapSerializableSpecObjects[specName]
395 395
         for depPkg in specObj.installRequiresPackages[inPkg]:
396
+            # ignore circular deps within single spec file
397
+            if (specObj.installRequiresPackages.has_key(depPkg) and inPkg in specObj.installRequiresPackages[depPkg] and self.getSpecName(depPkg) == specName):
398
+                continue
396 399
             if (allDeps.has_key(depPkg) and allDeps[depPkg] < level + 1):
397 400
                 allDeps[depPkg] = level + 1
398 401
                 parent[depPkg] = inPkg
... ...
@@ -8,7 +8,7 @@ class StringUtils(object):
8 8
     # aaa <= 3.1 ccc ddd
9 9
     def getStringInConditionalBrackets(self,inputstring):
10 10
         inputstring=inputstring.strip()
11
-        items = re.findall(r"([(][A-Za-z0-9 _\.\-<>=]+[)])",  inputstring)
11
+        items = re.findall(r"([(][A-Za-z0-9 %{?}_\.\-<>=]+[)])",  inputstring)
12 12
         for m in items:
13 13
             out = m[m.find("(")+1 : m.find(" or ")].strip()
14 14
             inputstring = inputstring.replace(m, out);