Skip to contentSkip to conversation

rpm: remove redundant removals

PATCH In review Ross Burton 2 participants 3 messages Sep 8, 2016 – Sep 12, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpm: remove redundant removals

These were noticed by the use of bashisms (rm *.{foo,bar}) and lots of these rm commands are deleting files which don't exist in the first place.

---
 meta/recipes-devtools/rpm/rpm_5.4.16.bb | 45 ---------------------------------
 1 file changed, 45 deletions(-)
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -45
index 9f78dee..2b8768c 100644
@@ -554,54 +554,11 @@ do_install_append() {
 	install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh
 	install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
 
-	# Remove unpackaged files (based on list in rpm.spec)
-	rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
-
-	rm -f ${D}/${mandir}/man8/rpmcache.8*
-	rm -f ${D}/${mandir}/man8/rpmgraph.8*
-	rm -f ${D}/${mandir}/*/man8/rpmcache.8*
-	rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
-	rm -rf ${D}/${mandir}/{fr,ko}
-
-	rm -f ${D}/${includedir}/popt.h
-	rm -f ${D}/${libdir}/libpopt.*
-	rm -f ${D}/${libdir}/pkgconfig/popt.pc
-	rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo
-	rm -f ${D}/${mandir}/man3/popt.3
-
-	rm -f ${D}/${mandir}/man1/xar.1*
-	rm -f ${D}/${bindir}/xar
-	rm -rf ${D}/${includedir}/xar
-	rm -f ${D}/${libdir}/libxar*
-
-	rm -f ${D}/${bindir}/lz*
-	rm -f ${D}/${bindir}/unlzma
-	rm -f ${D}/${bindir}/unxz
-	rm -f ${D}/${bindir}/xz*
-	rm -rf ${D}/${includedir}/lzma*
-	rm -f ${D}/${mandir}/man1/lz*.1
-	rm -f ${D}/${libdir}/pkgconfig/liblzma*
-
-	rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/*.a
 	rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/*.la
-	rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/*.a
 	rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/*.la
 
-	#find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \
-	#	-o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';'
-	#find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';'
-
 	rm -f ${D}/${libdir}/rpm/dbconvert.sh
 
-	rm -f ${D}/${libdir}/rpm/libsqldb.*
-
-	# We don't want, nor need the Mandriva multiarch items
-	rm -f ${D}/${bindir}/multiarch-dispatch
-	rm -f ${D}/${bindir}/multiarch-platform
-	rm -f ${D}/${libdir}/rpm/check-multiarch-files
-	rm -f ${D}/${libdir}/rpm/mkmultiarch
-	rm -f ${D}/${includedir}/multiarch-dispatch.h
-
 	rm -f ${D}/${libdir}/rpm/gstreamer.sh
 	rm -f ${D}/${libdir}/rpm/gem_helper.rb
 	rm -f ${D}/${libdir}/rpm/rubygems.rb
@@ -610,12 +567,10 @@ do_install_append() {
 	rm -f ${D}/${libdir}/rpm/macros.d/kernel
 	rm -f ${D}/${libdir}/rpm/macros.d/gstreamer
 	rm -f ${D}/${libdir}/rpm/bin/mgo
-	rm -f ${D}/${libdir}/rpm/bin/dbconvert
 	rm -f ${D}/${libdir}/rpm/bin/pom2spec
 
 	rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj
 	rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl
-
 }
 
 do_install_append_class-target() {
Signature · 1 line
2.8.1
#1 lore raw
Quoted 13 lines · Ross Burton

These were noticed by the use of bashisms (rm *.{foo,bar}) and lots of these rm commands are deleting files which don't exist in the first place.

---
 meta/recipes-devtools/rpm/rpm_5.4.16.bb | 45 ---------------------------------
 1 file changed, 45 deletions(-)
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -0
index 9f78dee..2b8768c 100644

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 558

Quoted 5 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -2
@@ -554,54 +554,11 @@ do_install_append() {
 	install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh
 	install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
 
-	# Remove unpackaged files (based on list in rpm.spec)
-	rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}

The above files can 'appear' in some odd cases. But likely it is safe to remove the 'rm'.

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 564

Quoted 5 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -5
-	rm -f ${D}/${mandir}/man8/rpmcache.8*
-	rm -f ${D}/${mandir}/man8/rpmgraph.8*
-	rm -f ${D}/${mandir}/*/man8/rpmcache.8*
-	rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
-	rm -rf ${D}/${mandir}/{fr,ko}

Above cases need to be removed. We do not support the rpmcache or rpmgraph, and at least for a long time the man pages were being generated for them. (If this is no longer true, and man pages ARE being generated they should be removed.)

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 570

Quoted 5 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -5
-	rm -f ${D}/${includedir}/popt.h
-	rm -f ${D}/${libdir}/libpopt.*
-	rm -f ${D}/${libdir}/pkgconfig/popt.pc
-	rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo
-	rm -f ${D}/${mandir}/man3/popt.3

We can use either an internal or external version of the popt library. If the internal version is used, we MUST remove all of these files. If the external version is used, the RPM won't end up doing anything.

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 583

Quoted 12 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -12
-	rm -f ${D}/${mandir}/man1/xar.1*
-	rm -f ${D}/${bindir}/xar
-	rm -rf ${D}/${includedir}/xar
-	rm -f ${D}/${libdir}/libxar*
-
-	rm -f ${D}/${bindir}/lz*
-	rm -f ${D}/${bindir}/unlzma
-	rm -f ${D}/${bindir}/unxz
-	rm -f ${D}/${bindir}/xz*
-	rm -rf ${D}/${includedir}/lzma*
-	rm -f ${D}/${mandir}/man1/lz*.1
-	rm -f ${D}/${libdir}/pkgconfig/liblzma*

Above files may be generated in some configurations. (Possible that is no longer true.)

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 558

Quoted 4 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -2
-	rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/*.a
 	rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/*.la
-	rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/*.a
 	rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/*.la

The .a files were removed because we didn't want anyone statically linking to python.a, not sure they they were being produced to begin with.. but that is why that was there.

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 593

Quoted 4 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -4
-	#find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \
-	#	-o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';'
-	#find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';'
-

Don't know what the above is.

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 597

Quoted 4 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -2
 	rm -f ${D}/${libdir}/rpm/dbconvert.sh
 
-	rm -f ${D}/${libdir}/rpm/libsqldb.*
-

If 'sqlite' support is enabled in RPM, the above should be removed. It will clash with external components.

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 604

Quoted 7 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -7
-	# We don't want, nor need the Mandriva multiarch items
-	rm -f ${D}/${bindir}/multiarch-dispatch
-	rm -f ${D}/${bindir}/multiarch-platform
-	rm -f ${D}/${libdir}/rpm/check-multiarch-files
-	rm -f ${D}/${libdir}/rpm/mkmultiarch
-	rm -f ${D}/${includedir}/multiarch-dispatch.h
-

Again, some configs may produce these.. if they're not produced in our config we can remove it.

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 613

Quoted 8 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -1
 	rm -f ${D}/${libdir}/rpm/gstreamer.sh
 	rm -f ${D}/${libdir}/rpm/gem_helper.rb
 	rm -f ${D}/${libdir}/rpm/rubygems.rb
@@ -610,12 +567,10 @@ do_install_append() {
 	rm -f ${D}/${libdir}/rpm/macros.d/kernel
 	rm -f ${D}/${libdir}/rpm/macros.d/gstreamer
 	rm -f ${D}/${libdir}/rpm/bin/mgo
-	rm -f ${D}/${libdir}/rpm/bin/dbconvert

dbconvert is not useful for us.. it used to be provided, so we removed it.

Quoted 9 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -1
 	rm -f ${D}/${libdir}/rpm/bin/pom2spec
 
 	rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj
 	rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl
-
 }
 
 do_install_append_class-target() {
#2 lore raw
Quoted 6 lines · Mark Hatle

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 564

Quoted 5 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -5
-     rm -f ${D}/${mandir}/man8/rpmcache.8*
-     rm -f ${D}/${mandir}/man8/rpmgraph.8*
-     rm -f ${D}/${mandir}/*/man8/rpmcache.8*
-     rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
-     rm -rf ${D}/${mandir}/{fr,ko}
Quoted 6 lines

Above cases need to be removed. We do not support the rpmcache or rpmgraph, and
at least for a long time the man pages were being generated for them. (If this
is no longer true, and man pages ARE being generated they should be removed.)

These manpages are not installed in the first place.

Quoted 11 lines

- rm -f ${D}/${includedir}/popt.h

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 570

Quoted 4 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -4
-     rm -f ${D}/${libdir}/libpopt.*
-     rm -f ${D}/${libdir}/pkgconfig/popt.pc
-     rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo
-     rm -f ${D}/${mandir}/man3/popt.3

We can use either an internal or external version of the popt library. If the
internal version is used, we MUST remove all of these files. If the external
version is used, the RPM won't end up doing anything.

Okay, restored.

Quoted 5 lines

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 575

Quoted 4 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -4
-     rm -f ${D}/${mandir}/man1/xar.1*
-     rm -f ${D}/${bindir}/xar
-     rm -rf ${D}/${includedir}/xar
-     rm -f ${D}/${libdir}/libxar*

xar is a PACKAGECONFIG which is disabled by default, so removing the files if it is enabled seems wrong.

Quoted 10 lines

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 583

Quoted 7 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -7
-     rm -f ${D}/${bindir}/lz*
-     rm -f ${D}/${bindir}/unlzma
-     rm -f ${D}/${bindir}/unxz
-     rm -f ${D}/${bindir}/xz*
-     rm -rf ${D}/${includedir}/lzma*
-     rm -f ${D}/${mandir}/man1/lz*.1
-     rm -f ${D}/${libdir}/pkgconfig/liblzma*

Above files may be generated in some configurations. (Possible that is no longer true.

Doesn't appear to be true any more: rpm links to an external xz.

Quoted 11 lines
Quoted 1 line

- rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/*.a

      rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/*.la
Quoted 2 lines

- rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/*.a

      rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/*.la

The .a files were removed because we didn't want anyone statically linking to
python.a, not sure they they were being produced to begin with.. but that is why
that was there.

Nothing is installing these but I suspect this is a side-effect of Poky's no-static-libs change, so I'll remove this.

Quoted 6 lines

- rm -f ${D}/${libdir}/rpm/libsqldb.*

Quoted 1 line

-

If 'sqlite' support is enabled in RPM, the above should be removed. It will
clash with external components.

Done.

Quoted 9 lines

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 604

Quoted 8 lines
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -7
-     # We don't want, nor need the Mandriva multiarch items
-     rm -f ${D}/${bindir}/multiarch-dispatch
-     rm -f ${D}/${bindir}/multiarch-platform
-     rm -f ${D}/${libdir}/rpm/check-multiarch-files
-     rm -f ${D}/${libdir}/rpm/mkmultiarch
-     rm -f ${D}/${includedir}/multiarch-dispatch.h
-
Quoted 3 lines

Again, some configs may produce these.. if they're not produced in our config we
can remove it.

Not anymore apparently:

noinst_SCRIPTS += multiarch-dispatch multiarch-platform noinst_SCRIPTS += check-multiarch-files mkmultiarch noinst_HEADERS = multiarch-dispatch.h

Quoted 10 lines

meta/recipes-devtools/rpm/rpm_5.4.16.bb do_install_append() { · line 613

Quoted 8 lines
      rm -f ${D}/${libdir}/rpm/gstreamer.sh
      rm -f ${D}/${libdir}/rpm/gem_helper.rb
      rm -f ${D}/${libdir}/rpm/rubygems.rb
meta/recipes-devtools/rpm/rpm_5.4.16.bb +0 -1
@@ -610,12 +567,10 @@ do_install_append() {
      rm -f ${D}/${libdir}/rpm/macros.d/kernel
      rm -f ${D}/${libdir}/rpm/macros.d/gstreamer
      rm -f ${D}/${libdir}/rpm/bin/mgo
-     rm -f ${D}/${libdir}/rpm/bin/dbconvert

dbconvert is not useful for us.. it used to be provided, so we removed it.

This doesn't get installed anymore.

V2 incoming.

Ross