Commit 980b0a41 authored by firmicus's avatar firmicus
Browse files

small fixes for version 0.2.3

Ignore-this: 6638d1582365258c8a97725cf55bf3c

darcs-hash:20090126152600-df5cb-e9aa1d4dc6a9700c382573d01bd64a46ba2b602f.gz
parent c7cb3635
......@@ -22,7 +22,7 @@ GetOptions( $opts,
use File::Path;
use LWP::Simple;
use YAML::Syck; ##for debugging
#use YAML::Syck; ##for debugging
use Term::ANSIColor qw(:constants);
$Term::ANSIColor::AUTORESET = 1; #
use Term::ShellUI;
......@@ -464,7 +464,7 @@ sub run_status {
sub run_install {
foreach (@_) {
if ( $locallyinstalledpkg_versions{$_} ) {
echo "This pkg is already installed with texlive-local-$_";
echo "$_ is already installed with texlive-local-$_";
if ($locallyinstalledpkg_versions{$_} == $tlpdb->package_revision($_)) {
echo "and it is uptodate"
} else {
......@@ -475,7 +475,7 @@ sub run_install {
}
}
elsif ( $installedpkg_versions{$_} ) {
echo "This pkg is already installed with texlive-$collectionsbypkg{$_}";
echo "$_ is already installed with texlive-$collectionsbypkg{$_}";
if ($installedpkg_versions{$_} == $tlpdb->package_revision($_)) {
echo "and it is uptodate"
} else {
......@@ -498,7 +498,7 @@ sub run_install {
sub run_installdoc {
foreach (@_) {
if ( $locallyinstalleddoc_versions{$_} ) {
echo "This pkg is already installed with texlive-local-$_-doc";
echo "$_ is already installed with texlive-local-$_-doc";
if ($locallyinstalleddoc_versions{$_} == $tlpdb->package_revision($_)) {
echo "and it is uptodate"
} else {
......@@ -525,7 +525,7 @@ sub run_installsrc {
sub run_update {
foreach (@_) {
if ( $locallyinstalledpkg_versions{$_} ) {
echo "This pkg is already installed with texlive-local-$_";
echo "$_ is already installed with texlive-local-$_";
if ($locallyinstalledpkg_versions{$_} == $tlpdb->package_revision($_)) {
echo "and it is uptodate"
} else {
......@@ -536,7 +536,7 @@ sub run_update {
}
}
elsif ( $installedpkg_versions{$_} ) {
echo "This pkg is already installed with texlive-$collectionsbypkg{$_}";
echo "$_ is already installed with texlive-$collectionsbypkg{$_}";
if ($installedpkg_versions{$_} == $tlpdb->package_revision($_)) {
echo "and it is uptodate"
} else {
......@@ -664,6 +664,9 @@ sub makepkg {
my $newver = $tlpdb->package_revision($pkg);
my $col = $collectionsbypkg{$pkg};
my $pkgmd5 = $tlpdb->get_package($pkg)->containermd5;
#TODO download it first and compare the md5sum
# if it differs ask the user if the PKGBUILD
# should be adjusted
print PKGBUILD <<"EOF"
# Generated by tllocalmgr
pkgname=texlive-local-$pkg
......@@ -697,6 +700,7 @@ EOF
print LOG "* Running makepkg -ci on $ROOT/builds/$pkg/PKGBUILD\n";
chdir "$ROOT/builds/$pkg";
system( "test -f $pkg.tar.lzma && rm $pkg.tar.lzma" );
# TODO : catch error if makepkg fails
system( "makepkg -ci" );
}
......@@ -738,6 +742,10 @@ sub makepkgdoc {
mkpath( "$ROOT/builds/$pkg-doc", { mode => 0755 });
open PKGBUILD, "> $ROOT/builds/$pkg-doc/PKGBUILD";
my $newver = $tlpdb->package_revision($pkg);
#TODO check if md5sums are defined in the database
#TODO download it first and compare the md5sums
# if they differ ask the user if the PKGBUILD
# should be adjusted
my $docpkgmd5 = $tlpdb->get_package($pkg)->doccontainermd5;
my $srcpkgmd5 = $tlpdb->get_package($pkg)->srccontainermd5;
print PKGBUILD <<"EOF"
......@@ -751,13 +759,26 @@ arch=('i686' 'x86_64')
depends=('texlive-core')
makedepends=('lzma-utils')
url='http://tug.org/texlive/'
EOF
;
if ($srcpkgmd5) {
print PKGBUILD <<"EOF"
source=('$TLARCHIVE/$pkg.doc.tar.lzma' '$TLARCHIVE/$pkg.source.tar.lzma')
md5sums=('$docpkgmd5' '$srcpkgmd5')
build() {
cd \$startdir/src
lzma --force -dc $pkg.doc.tar.lzma | tar xf - || return 1
lzma --force -dc $pkg.source.tar.lzma | tar xf - || return 1
EOF
} else {
print PKGBUILD <<"EOF"
source=('$TLARCHIVE/$pkg.doc.tar.lzma')
md5sums=('$docpkgmd5')
build() {
cd \$startdir/src
lzma --force -dc $pkg.doc.tar.lzma | tar xf - || return 1
EOF
; print PKGBUILD <<"EOF"
install -m755 -d \$startdir/pkg/usr/local/share || return 1
for d in texmf-dist texmf-doc; do
if [ -d \$d ]; then
......@@ -777,7 +798,9 @@ EOF
print LOG "* Running makepkg -ci on $ROOT/builds/$pkg-doc/PKGBUILD\n";
chdir "$ROOT/builds/$pkg-doc";
system( "test -f $pkg-*.tar.lzma && rm $pkg-*.tar.lzma" );
# TODO : catch error if makepkg fails
system( "makepkg -ci" );
}
}
print "\n>>> Finished. Don't forget to run 'texhash' to update your file database.\n";
......@@ -863,3 +886,4 @@ sub version {
tllocalmgr: version $VERSION
]
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment