]> git.pld-linux.org Git - packages/filesystem.git/commitdiff
- check_filesystem_dirs cleanup (sync with FHS.spec) auto/th/filesystem-4.1-1
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 7 Jun 2016 19:22:01 +0000 (21:22 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Tue, 7 Jun 2016 19:22:01 +0000 (21:22 +0200)
filesystem.spec

index 32ac9f7cea603457ca5d224b99d34b1a96c1b02f..90facbae55d4d2384b2108045da05155b2025a67 100644 (file)
@@ -2,12 +2,6 @@
 # - do not use any other user/group than "root", as then we have to depend on "setup" package.
 #   see the gid_xxx macros and post scriptlet
 # FIXME: verify shows changed groups of dirs changed this way
-
-# disable rpm generated debug package, we handle it differently here
-%define                _enable_debug_packages  0
-
-# avoid rpm 4.4.9 adding rm -rf buildroot
-%define                __spec_clean_body       %{nil}
 Summary:       Common directories
 Summary(pl.UTF-8):     Wspólne katalogi
 Name:          filesystem
@@ -41,6 +35,9 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 # Adapter: This file does not like to be adapterized!
 
+# disable rpm generated debug package, we handle it differently here
+%define                _enable_debug_packages  0
+
 %if "%{_lib}" == "lib64"
 %define                with_lib64      1
 %endif
@@ -54,6 +51,9 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %endif
 %endif
 
+# avoid rpm 4.4.9 adding rm -rf buildroot
+%define                __spec_clean_body       %{nil}
+
 # directory for "privilege separation" chroot
 %define                _privsepdir     /usr/share/empty
 # directory for *.idl files (for CORBA implementations)
@@ -136,25 +136,22 @@ install -d \
        $RPM_BUILD_ROOT/usr/lib/debug/lib/security \
        $RPM_BUILD_ROOT/usr/src/debug
 
-# create this for %clean
-tar -cf checkfiles.tar -C $RPM_BUILD_ROOT .
-
 %clean
-mkdir -p $RPM_BUILD_ROOT
-tar -xf checkfiles.tar -C $RPM_BUILD_ROOT
 cd $RPM_BUILD_ROOT
 
 check_filesystem_dirs() {
        RPMFILE=%{_rpmdir}/%{name}-%{version}-%{release}.%{_target_cpu}.rpm
-       RPMFILE2=%{?with_debuginfo:%{_rpmdir}/%{name}-debuginfo-%{version}-%{release}.%{_target_cpu}.rpm}
        TMPFILE=$(mktemp)
        # note: we must exclude from check all existing dirs belonging to FHS
-       find | sed -e 's|^\.||g' -e 's|^$||g' | LC_ALL=C sort | grep -v $TMPFILE | \
+       find | sed -e 's|^\.||g' -e '/^$/d' | LC_ALL=C sort | grep -v $TMPFILE | \
        grep -E -v '^/(boot|etc|etc/X11|home|lib|lib64|libx32|usr|usr/include|usr/lib|usr/lib64|usr/libx32|usr/share|usr/share/man|usr/share/man/pl|usr/src|var|var/lib|var/lock|var/log)$' > $TMPFILE
 
-       # find finds also '.', so use option -B for diff
-       rpm -qpl $RPMFILE $RPMFILE2 | grep -v '^/$' | LC_ALL=C sort | diff -uB - $TMPFILE || :
-
+       if rpm -qpl $RPMFILE | grep -v '^/$' | LC_ALL=C sort | diff -u $TMPFILE - ; then
+               rm -rf $RPM_BUILD_ROOT
+       else
+               echo -e "\nNot so good, some directories are not included in package\n"
+               exit 1
+       fi
        rm -f $TMPFILE
 }
 
This page took 0.112391 seconds and 4 git commands to generate.