- echo "* Removing unnecessary junk"
-
- pushd $vroot
-
- # Save precious files
- [ -n "$precious" ] && tar --ignore-failed-read -cpf precious.tar $precious
-
- # Remove unnecessary junk
- [ -n "$junk" ] && rm -rf $junk
-
- # Restore precious files
- [ -n "$precious" ] && tar -xpf precious.tar && rm -f precious.tar
-
- popd
-
-### # FC2 dev %preinstall checks /proc/mounts to make sure that /dev is
-### # not currently mounted as devfs. If it thinks it is, it will refuse
-### # to install the package. On a modern system running udev that mounts
-### # /dev as tmpfs, this check fails. Since we are installing into a
-### # chroot, whether /dev is mounted on the host system or not doesn't
-### # matter. If dev was explicitly mentioned in the packages list, force
-### # its installation.
-### if [ "$releasever" = "2" ] ; then
-### for package in "${packages[@]}" ; do
-### if [ "$package" = "dev" ] && ! rpm --root $vroot -q dev >/dev/null 2>&1 ; then
-### rpm --root $vroot -Uvh --noscripts $baseurl/Fedora/RPMS/dev-3.3.13-1.i386.rpm
-### break
-### fi
-### done
-### fi
+ if [ -n "$pkgs_junk" ] ; then
+ echo "* Removing unnecessary junk"
+ pushd $vroot
+ # Save precious files
+ [ -n "$pkgs_precious" ] && tar --ignore-failed-read -cpf precious.tar $pkgs_precious
+ # Remove unnecessary junk
+ [ -n "$pkgs_junk" ] && rm -rf $pkgs_junk
+ # Restore precious files
+ [ -n "$pkgs_precious" ] && tar -xpf precious.tar && rm -f precious.tar
+ popd
+ fi