Browse Source

Clifford Wolf:


			
			
				rocklinux
			
			
		
Clifford Wolf 20 years ago
parent
commit
774490b34f
4 changed files with 102 additions and 16 deletions
  1. +61
    -0
      misc/archive/getdirdeps.pl
  2. +9
    -0
      package/base/00-dirtree/parse-config
  3. +11
    -4
      package/base/man/parse-config
  4. +21
    -12
      scripts/functions

+ 61
- 0
misc/archive/getdirdeps.pl

@ -0,0 +1,61 @@
#!/usr/bin/perl -w
use English;
use strict;
if (not defined $ARGV[0] or not chdir $ARGV[0]) {
print "\nUsage: $0 rootdir\n\n";
print "E.g.: $0 build/ref0818-2.1.0-DEV-x86-reference-expert\n\n";
exit 1;
}
my %baddirs;
my %badcount;
my %badpkgs;
while (<var/adm/dep-debug/*>) {
/.*\/(\S+)/;
my $p = $1;
my %dirdep;
my %filedep;
open P, $_ or die $!;
while (<P>) {
chomp;
my ($d, $f) = split /: /;
next if $d =~ /-dirtree$/;
if (-d $f) {
$dirdep{$d}{$f} = 1;
} else {
$filedep{$d} = 1;
}
}
close P;
foreach (keys %filedep) {
delete $dirdep{$_};
}
foreach my $d (keys %dirdep) {
foreach (keys %{$dirdep{$d}}) {
$baddirs{$d}{$_}++;
$badpkgs{$d}{$p}++;
}
$badcount{$d}++;
}
}
foreach my $d (keys %badcount) {
print "\nFound pure dir dependencies to $d ($badcount{$d}):\n";
foreach (keys %{$badpkgs{$d}}) {
print "\tpkg\t$badpkgs{$d}{$_}\t$_\n";
}
foreach (keys %{$baddirs{$d}}) {
print "\tdir\t$baddirs{$d}{$_}\t$_\n";
}
}
print "\n";
exit 0;

+ 9
- 0
package/base/00-dirtree/parse-config

@ -0,0 +1,9 @@
# never add the .../share/locale/*/ directories to the package file list
# every package creates them if they are not present and its absolutely
# random which package is built first and so gets the directory..
var_append flistdel "|" '.*/share/locale/[a-z][a-z](_[^/]*|)(/[A-Z]*|)'
# the same thing for localized manual pages
var_append flistdel "|" '.*/share/man/[a-z][a-z](_[^/]*|)(/man.|)'

+ 11
- 4
package/base/man/parse-config

@ -21,7 +21,13 @@
# --- ROCK-COPYRIGHT-NOTE-END ---
postflist_man() {
egrep '^usr/share/(man|info)/.*\.gz$' $builddir/flist.txt |
egrep '/share/man/(.*/|)cat./' $builddir/flist.txt |
while read fn ; do
[ -f $root/$fn ] || continue
rm -fv $root/$fn
done
egrep '/share/(man|info)/.*\.gz$' $builddir/flist.txt |
while read fn ; do
[ -f $root/$fn ] || continue
rm -f $root/${fn%.gz}
@ -29,13 +35,14 @@ postflist_man() {
add_flist $root/${fn%.gz}
done
egrep '^usr/share/(man|info)/' $builddir/flist.txt |
egrep '/share/(man|info)/' $builddir/flist.txt |
while read fn ; do
[ -f $root/$fn ] || continue
chmod 0644 $fn
chown root:root $fn
chmod 0644 $root/$fn
chown root:root $root/$fn
done
}
var_append flistdel "|" '.*/share/man/(.*/|)cat.(/.*|)'
hook_add postflist 2 postflist_man

+ 21
- 12
scripts/functions

@ -191,16 +191,16 @@ set_confopt() {
datadir="$root/usr/share"
includedir="$root/usr/include"
docdir="$root/usr/doc/$xpkg"
infodir="$root/usr/info"
mandir="$root/usr/man"
docdir="$root/usr/share/doc/$xpkg"
infodir="$root/usr/share/info"
mandir="$root/usr/share/man"
else
datadir="$root/$prefix/share"
includedir="$root/$prefix/include"
docdir="$root/$prefix/doc/$xpkg"
infodir="$root/$prefix/info"
mandir="$root/$prefix/man"
docdir="$root/$prefix/share/doc/$xpkg"
infodir="$root/$prefix/share/info"
mandir="$root/$prefix/share/man"
fi
confopt="$confopt --datadir=\$datadir"
confopt="$confopt --includedir=\$includedir"
@ -648,14 +648,22 @@ build_this_package() {
if [ "$createprefix" = 1 ]; then
echo "Creating $root/$prefix/<..> if required ..."
for x in $docdir $root/$prefix/bin $root/$prefix/lib \
$root/$prefix/share $sysconfdir $localstatedir
for x in $root/$prefix $bindir $sbindir $libdir $datadir $includedir \
$docdir $infodir $mandir $sysconfdir $localstatedir
do
if [ ! -e $x ]; then
mkdir -p $x
rmemptydir="$rmemptydir $x"
rmemptydir="$x $rmemptydir"
fi
done
if [ ! -e $root/$prefix/man ]; then
ln -s ${mandir#$root} $root/$prefix/man
rmemptydir="$rmemptydir $root/$prefix/man"
fi
if [ ! -e $root/$prefix/info ]; then
ln -s ${infodir#$root} $root/$prefix/info
rmemptydir="$rmemptydir $root/$prefix/info"
fi
fi
if [ ".$custmain" = "." ]
@ -758,9 +766,10 @@ build_this_package() {
patchfiles="$saved_patchfiles"
done
if [ "$rmemptydir" ]; then
rmdir $rmemptydir 2> /dev/null || true
fi
for x in $rmemptydir; do
rmdir $x 2> /dev/null || true
[ -e $x ] || rm $x 2> /dev/null || true
done
return 0
}

Loading…
Cancel
Save