[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Fedora-packaging] Directory ownership guidelines



Hi!

It was suggested to me to bring this issue to this list.

The packaging guidelines says that a package should not own a directory
that is owned by a package on which it depends.

The packaging guidelines also says that packages should own all
directories needed in order not to leave orphaned directories after a
package de-installation.

The way rpm/yum currently works these guidelines are contradicting and
you must choose which one to implement in your packaging.

My question is - is this a bug in yum/rpm, or a flaw in the packaging
guidelines?

Here is an example that implements the first guideline - and violates
the second - spec file attached.

The spec builds a main package, 8 packages (A-H) that depend on the main
package and 8 devel packages that each depends on one of the packages
(A-H).

If I install all 17 packages and then do "yum remove mytest", all
packages should be removed cleanly if the Requires are influencing the
order the packages are uninstalled, which it must do if both guidelines
is supposed to be implementable simultaneously.

This is not what happens:

[root localhost ~]# rpm -ivh /home/ellert/rpmbuild/RPMS/i386/mytest-*
Förbereder...              ########################################### [100%]
   1:mytest                 ########################################### [  6%]
   2:mytest-A               ########################################### [ 12%]
   3:mytest-B               ########################################### [ 18%]
   4:mytest-C               ########################################### [ 24%]
   5:mytest-D               ########################################### [ 29%]
   6:mytest-E               ########################################### [ 35%]
   7:mytest-F               ########################################### [ 41%]
   8:mytest-G               ########################################### [ 47%]
   9:mytest-H               ########################################### [ 53%]
  10:mytest-A-devel         ########################################### [ 59%]
  11:mytest-B-devel         ########################################### [ 65%]
  12:mytest-C-devel         ########################################### [ 71%]
  13:mytest-D-devel         ########################################### [ 76%]
  14:mytest-E-devel         ########################################### [ 82%]
  15:mytest-F-devel         ########################################### [ 88%]
  16:mytest-G-devel         ########################################### [ 94%]
  17:mytest-H-devel         ########################################### [100%]
[root localhost ~]# yum remove mytest
Loaded plugins: refresh-packagekit
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package mytest.i386 0:1.0-1.fc10 set to be erased
--> Processing Dependency: mytest for package: mytest-A
--> Processing Dependency: mytest for package: mytest-E
--> Processing Dependency: mytest for package: mytest-G
--> Processing Dependency: mytest for package: mytest-B
--> Processing Dependency: mytest for package: mytest-F
--> Processing Dependency: mytest for package: mytest-C
--> Processing Dependency: mytest for package: mytest-D
--> Processing Dependency: mytest for package: mytest-H
--> Running transaction check
---> Package mytest-A.i386 0:1.0-1.fc10 set to be erased
--> Processing Dependency: mytest-A = 1.0-1.fc10 for package: mytest-A-devel
---> Package mytest-B.i386 0:1.0-1.fc10 set to be erased
--> Processing Dependency: mytest-B = 1.0-1.fc10 for package: mytest-B-devel
---> Package mytest-C.i386 0:1.0-1.fc10 set to be erased
--> Processing Dependency: mytest-C = 1.0-1.fc10 for package: mytest-C-devel
---> Package mytest-D.i386 0:1.0-1.fc10 set to be erased
--> Processing Dependency: mytest-D = 1.0-1.fc10 for package: mytest-D-devel
---> Package mytest-E.i386 0:1.0-1.fc10 set to be erased
--> Processing Dependency: mytest-E = 1.0-1.fc10 for package: mytest-E-devel
---> Package mytest-F.i386 0:1.0-1.fc10 set to be erased
--> Processing Dependency: mytest-F = 1.0-1.fc10 for package: mytest-F-devel
---> Package mytest-G.i386 0:1.0-1.fc10 set to be erased
--> Processing Dependency: mytest-G = 1.0-1.fc10 for package: mytest-G-devel
---> Package mytest-H.i386 0:1.0-1.fc10 set to be erased
--> Processing Dependency: mytest-H = 1.0-1.fc10 for package: mytest-H-devel
--> Running transaction check
---> Package mytest-A-devel.i386 0:1.0-1.fc10 set to be erased
---> Package mytest-B-devel.i386 0:1.0-1.fc10 set to be erased
---> Package mytest-C-devel.i386 0:1.0-1.fc10 set to be erased
---> Package mytest-D-devel.i386 0:1.0-1.fc10 set to be erased
---> Package mytest-E-devel.i386 0:1.0-1.fc10 set to be erased
---> Package mytest-F-devel.i386 0:1.0-1.fc10 set to be erased
---> Package mytest-G-devel.i386 0:1.0-1.fc10 set to be erased
---> Package mytest-H-devel.i386 0:1.0-1.fc10 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                Arch         Version            Repository         Size
================================================================================
Removing:
 mytest                 i386         1.0-1.fc10         installed          0.0 
Removing for dependencies:
 mytest-A               i386         1.0-1.fc10         installed          6.0 
 mytest-A-devel         i386         1.0-1.fc10         installed          7.0 
 mytest-B               i386         1.0-1.fc10         installed          6.0 
 mytest-B-devel         i386         1.0-1.fc10         installed          7.0 
 mytest-C               i386         1.0-1.fc10         installed          6.0 
 mytest-C-devel         i386         1.0-1.fc10         installed          7.0 
 mytest-D               i386         1.0-1.fc10         installed          6.0 
 mytest-D-devel         i386         1.0-1.fc10         installed          7.0 
 mytest-E               i386         1.0-1.fc10         installed          6.0 
 mytest-E-devel         i386         1.0-1.fc10         installed          7.0 
 mytest-F               i386         1.0-1.fc10         installed          6.0 
 mytest-F-devel         i386         1.0-1.fc10         installed          7.0 
 mytest-G               i386         1.0-1.fc10         installed          6.0 
 mytest-G-devel         i386         1.0-1.fc10         installed          7.0 
 mytest-H               i386         1.0-1.fc10         installed          6.0 
 mytest-H-devel         i386         1.0-1.fc10         installed          7.0 

Transaction Summary
================================================================================
Install      0 Package(s)         
Update       0 Package(s)         
Remove      17 Package(s)         

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing        : mytest-E-devel                                          1/17 
  Erasing        : mytest-H-devel                                          2/17 
  Erasing        : mytest-A                                                3/17 
  Erasing        : mytest-C                                                4/17 
  Erasing        : mytest-D                                                5/17 
  Erasing        : mytest-E                                                6/17 
  Erasing        : mytest-G                                                7/17 
  Erasing        : mytest-H                                                8/17 
  Erasing        : mytest-C-devel                                          9/17 
  Erasing        : mytest-F-devel                                         10/17 
  Erasing        : mytest-F                                               11/17 
  Erasing        : mytest-A-devel                                         12/17 
  Erasing        : mytest-D-devel                                         13/17 
  Erasing        : mytest                                                 14/17 
  Erasing        : mytest-G-devel                                         15/17 
  Erasing        : mytest-B                                               16/17 
  Erasing        : mytest-B-devel                                         17/17 

Removed:
  mytest.i386 0:1.0-1.fc10                                                      

Dependency Removed:
  mytest-A.i386 0:1.0-1.fc10          mytest-A-devel.i386 0:1.0-1.fc10         
  mytest-B.i386 0:1.0-1.fc10          mytest-B-devel.i386 0:1.0-1.fc10         
  mytest-C.i386 0:1.0-1.fc10          mytest-C-devel.i386 0:1.0-1.fc10         
  mytest-D.i386 0:1.0-1.fc10          mytest-D-devel.i386 0:1.0-1.fc10         
  mytest-E.i386 0:1.0-1.fc10          mytest-E-devel.i386 0:1.0-1.fc10         
  mytest-F.i386 0:1.0-1.fc10          mytest-F-devel.i386 0:1.0-1.fc10         
  mytest-G.i386 0:1.0-1.fc10          mytest-G-devel.i386 0:1.0-1.fc10         
  mytest-H.i386 0:1.0-1.fc10          mytest-H-devel.i386 0:1.0-1.fc10         

Complete!


After the removal there are orphaned directories:

[root localhost ~]# find /usr/share/mytest
/usr/share/mytest
/usr/share/mytest/C
/usr/share/mytest/G
/usr/share/mytest/B
/usr/share/mytest/D
/usr/share/mytest/A
[root localhost ~]# rpm -q --whatprovides `find /usr/share/mytest`
filen /usr/share/mytest tillhör inget paket
filen /usr/share/mytest/C tillhör inget paket
filen /usr/share/mytest/G tillhör inget paket
filen /usr/share/mytest/B tillhör inget paket
filen /usr/share/mytest/D tillhör inget paket
filen /usr/share/mytest/A tillhör inget paket


Name:		mytest
Version:	1.0
Release:	1%{?dist}
Summary:	RPM dependency remove test

Group:		Development Tools
License:	GPLv2+
URL:		http://
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%description
RPM dependency remove test

%package A
Summary:	RPM dependency remove test A
Requires:	%{name}

%description A
RPM dependency remove test

%package A-devel
Summary:	RPM dependency remove test A devel
Requires:	%{name}-A = %{version}-%{release}

%description A-devel
RPM dependency remove test

%package B
Summary:	RPM dependency remove test B
Requires:	%{name}

%description B
RPM dependency remove test

%package B-devel
Summary:	RPM dependency remove test B devel
Requires:	%{name}-B = %{version}-%{release}

%description B-devel
RPM dependency remove test

%package C
Summary:	RPM dependency remove test C
Requires:	%{name}

%description C
RPM dependency remove test

%package C-devel
Summary:	RPM dependency remove test C devel
Requires:	%{name}-C = %{version}-%{release}

%description C-devel
RPM dependency remove test

%package D
Summary:	RPM dependency remove test D
Requires:	%{name}

%description D
RPM dependency remove test

%package D-devel
Summary:	RPM dependency remove test D devel
Requires:	%{name}-D = %{version}-%{release}

%description D-devel
RPM dependency remove test

%package E
Summary:	RPM dependency remove test E
Requires:	%{name}

%description E
RPM dependency remove test

%package E-devel
Summary:	RPM dependency remove test E devel
Requires:	%{name}-E = %{version}-%{release}

%description E-devel
RPM dependency remove test

%package F
Summary:	RPM dependency remove test F
Requires:	%{name}

%description F
RPM dependency remove test

%package F-devel
Summary:	RPM dependency remove test F devel
Requires:	%{name}-F = %{version}-%{release}

%description F-devel
RPM dependency remove test

%package G
Summary:	RPM dependency remove test G
Requires:	%{name}

%description G
RPM dependency remove test

%package G-devel
Summary:	RPM dependency remove test G devel
Requires:	%{name}-G = %{version}-%{release}

%description G-devel
RPM dependency remove test

%package H
Summary:	RPM dependency remove test H
Requires:	%{name}

%description H
RPM dependency remove test

%package H-devel
Summary:	RPM dependency remove test H devel
Requires:	%{name}-H = %{version}-%{release}

%description H-devel
RPM dependency remove test

%prep

%build

%install
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT/usr/share/mytest

mkdir -p $RPM_BUILD_ROOT/usr/share/mytest/A
echo fileA > $RPM_BUILD_ROOT/usr/share/mytest/A/file
echo develA > $RPM_BUILD_ROOT/usr/share/mytest/A/devel

mkdir -p $RPM_BUILD_ROOT/usr/share/mytest/B
echo fileB > $RPM_BUILD_ROOT/usr/share/mytest/B/file
echo develB > $RPM_BUILD_ROOT/usr/share/mytest/B/devel

mkdir -p $RPM_BUILD_ROOT/usr/share/mytest/C
echo fileC > $RPM_BUILD_ROOT/usr/share/mytest/C/file
echo develC > $RPM_BUILD_ROOT/usr/share/mytest/C/devel

mkdir -p $RPM_BUILD_ROOT/usr/share/mytest/D
echo fileD > $RPM_BUILD_ROOT/usr/share/mytest/D/file
echo develD > $RPM_BUILD_ROOT/usr/share/mytest/D/devel

mkdir -p $RPM_BUILD_ROOT/usr/share/mytest/E
echo fileE > $RPM_BUILD_ROOT/usr/share/mytest/E/file
echo develE > $RPM_BUILD_ROOT/usr/share/mytest/E/devel

mkdir -p $RPM_BUILD_ROOT/usr/share/mytest/F
echo fileF > $RPM_BUILD_ROOT/usr/share/mytest/F/file
echo develF > $RPM_BUILD_ROOT/usr/share/mytest/F/devel

mkdir -p $RPM_BUILD_ROOT/usr/share/mytest/G
echo fileG > $RPM_BUILD_ROOT/usr/share/mytest/G/file
echo develG > $RPM_BUILD_ROOT/usr/share/mytest/G/devel

mkdir -p $RPM_BUILD_ROOT/usr/share/mytest/H
echo fileH > $RPM_BUILD_ROOT/usr/share/mytest/H/file
echo develH > $RPM_BUILD_ROOT/usr/share/mytest/H/devel

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%dir /usr/share/mytest

%files A
%defattr(-,root,root,-)
%dir /usr/share/mytest/A
/usr/share/mytest/A/file

%files A-devel
%defattr(-,root,root,-)
/usr/share/mytest/A/devel

%files B
%defattr(-,root,root,-)
%dir /usr/share/mytest/B
/usr/share/mytest/B/file

%files B-devel
%defattr(-,root,root,-)
/usr/share/mytest/B/devel

%files C
%defattr(-,root,root,-)
%dir /usr/share/mytest/C
/usr/share/mytest/C/file

%files C-devel
%defattr(-,root,root,-)
/usr/share/mytest/C/devel

%files D
%defattr(-,root,root,-)
%dir /usr/share/mytest/D
/usr/share/mytest/D/file

%files D-devel
%defattr(-,root,root,-)
/usr/share/mytest/D/devel

%files E
%defattr(-,root,root,-)
%dir /usr/share/mytest/E
/usr/share/mytest/E/file

%files E-devel
%defattr(-,root,root,-)
/usr/share/mytest/E/devel

%files F
%defattr(-,root,root,-)
%dir /usr/share/mytest/F
/usr/share/mytest/F/file

%files F-devel
%defattr(-,root,root,-)
/usr/share/mytest/F/devel

%files G
%defattr(-,root,root,-)
%dir /usr/share/mytest/G
/usr/share/mytest/G/file

%files G-devel
%defattr(-,root,root,-)
/usr/share/mytest/G/devel

%files H
%defattr(-,root,root,-)
%dir /usr/share/mytest/H
/usr/share/mytest/H/file

%files H-devel
%defattr(-,root,root,-)
/usr/share/mytest/H/devel

%changelog

Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]