Mostrando postagens com marcador rpm. Mostrar todas as postagens
Mostrando postagens com marcador rpm. Mostrar todas as postagens

quarta-feira, 22 de junho de 2011

making a .dot (graphviz) graph of RPM dependencies

http://www.singularity.be/2008/07/making-dot-graphviz-graph-of-rpm.html

nice tool for making .dot graphs with RPM dependecies on installed system:


#!/bin/bash

# deps:
# bash
# rpm
# sed
# cut
# uniq
# sort

installedrpms=$(rpm -qa --queryformat "%{NAME}\n")


function printdeps() {
local package deps dep providedby out

package=$1
out=""
deps=$(rpm -qR $package | cut -d " " -f 1)

for dep in $deps;
do
providedby=$(rpm -q --queryformat "%{NAME}\n" --whatprovides "$dep")
if [ $? -eq 0 ];
then
# packages should not depend on themselves
if [ "$package" != "$providedby" ];
then
out="$out\"$package\" -> \"$providedby\";\n"
fi
fi
done

echo $out
}

alloutput=""

for i in $installedrpms;
do
output=$(printdeps $i)
alloutput="$alloutput$output"
done


echo "digraph deptree {"
echo -e "$alloutput" | sort | uniq
echo "}"

sexta-feira, 5 de março de 2010

chroot with smart

Smart is a package manager tool that can handle many types of repositories. It has packages for all major Linux distributions: Debian, Fedora, Opensuse, Mandriva. Most of the RPM and Deb based distributions.

My problem was that I needed a packager tool that allow different channel configuration using diferent files for the configuration. I used to use zypper, but it only works with SuSE. You can find a package for Fedora Core 12, but didn't work for me.

The developers of YUM didn't like that idea, at least that what i read in the mailing list.

Smart solve my problems. I had to build a chroot system using packages from http repositories.

A combination of two options handle that, every time you call smart for your chroot system you will have to add this option:

smart -o rpm-root=/chroot-system --data-dir=/chroot-system/var/lib/smart/

I think this might help people that need to build chroot systems.