aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2006-10-17 13:55:27 +0000
committerFlorent Villard <warly@mandriva.com>2006-10-17 13:55:27 +0000
commit722eee9d03fb1933fed011a215b71b2c7603e442 (patch)
tree45a45361149df904184e4d94003b019406720f49
parent9e9f23d79d3149806c627ed395ce8278ff1ce3f9 (diff)
downloadmga-youri-core-722eee9d03fb1933fed011a215b71b2c7603e442.tar
mga-youri-core-722eee9d03fb1933fed011a215b71b2c7603e442.tar.gz
mga-youri-core-722eee9d03fb1933fed011a215b71b2c7603e442.tar.bz2
mga-youri-core-722eee9d03fb1933fed011a215b71b2c7603e442.tar.xz
mga-youri-core-722eee9d03fb1933fed011a215b71b2c7603e442.zip
merge with upstream
-rw-r--r--Makefile.PL58
-rw-r--r--README24
-rw-r--r--TODO17
-rwxr-xr-xt/package.t39
4 files changed, 31 insertions, 107 deletions
diff --git a/Makefile.PL b/Makefile.PL
index a8666ea..7204f9b 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -2,32 +2,22 @@
use ExtUtils::MakeMaker;
WriteMakefile(
- NAME => 'youri',
+ NAME => 'youri-core',
VERSION => 0.9,
AUTHOR => 'Youri project <youri@zarb.org>',
- EXE_FILES => [ 'bin/youri-check', 'bin/youri-upload' ],
PREREQ_PM => {
'AppConfig' => 0,
'YAML' => 0,
- 'DateTime' => 0,
- 'Pod::Simple::HTMLBatch' => 0
+ 'Pod::Simple::HTMLBatch' => 0,
+ 'Test::Exception' => 0,
+ 'Exception' => 0,
+ 'RPM4' => 0,
+ 'URPM' => 0
}
);
package MY;
-sub post_constants {
- my ($self) = @_;
- my $sysconfdir =
- $self->{ARGS}->{SYSCONFDIR} ||
- ($self->{INSTALLDIRS} eq 'site' ?
- '/usr/local/etc' :
- '/usr/etc');
- return <<EOF;
-SYSCONFDIR = $sysconfdir
-EOF
-}
-
sub top_targets {
my ($self) = @_;
my $top_targets = $self->SUPER::top_targets(@_);
@@ -36,42 +26,6 @@ sub top_targets {
htmlifypods : $(TO_INST_PM)
if [ ! -d blib/html ]; then mkdir blib/html; fi
perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go lib blib/html
- -perl -MPod::Simple::HTML -e Pod::Simple::HTML::go bin/youri-check blib/html/youri-check.html
- -perl -MPod::Simple::HTML -e Pod::Simple::HTML::go bin/youri-upload blib/html/youri-upload.html
EOF
return $top_targets;
}
-
-sub install {
- my ($self) = @_;
- my $install = $self->SUPER::install(@_);
- $install =~ s/install :: all pure_install doc_install/install :: all pure_install doc_install config_install completion_install/;
- $install .= <<'EOF';
-config_install :
- install -d -m 755 $(DESTDIR)$(SYSCONFDIR)/youri
- install -m 644 etc/check.conf $(DESTDIR)$(SYSCONFDIR)/youri
- install -m 644 etc/upload.conf $(DESTDIR)$(SYSCONFDIR)/youri
-
-completion_install :
- install -d -m 755 $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
- install -m 644 etc/bash_completion.d/youri $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
-EOF
- return $install;
-}
-
-sub installbin {
- my ($self) = @_;
- my $installbin = $self->SUPER::installbin(@_);
- $installbin .= <<'EOF';
-bin/youri-check : bin/youri-check.in Makefile
- perl -p \
- -e 's|\@sysconfdir\@|$(SYSCONFDIR)|;' \
- < $< > $@
-
-bin/youri-upload : bin/youri-upload.in Makefile
- perl -p \
- -e 's|\@sysconfdir\@|$(SYSCONFDIR)|;' \
- < $< > $@
-EOF
- return $installbin;
-}
diff --git a/README b/README
index 0b7a53f..8049cde 100644
--- a/README
+++ b/README
@@ -1,22 +1,14 @@
-YOURI project
--------------
+youri-core
+----------
-YOURI stands for "Youri Offers an Upload & Repository Infrastucture". It aims
-to build tools making management of a coherent set of packages easier.
+Youri core libraries.
Description
-----------
-Managing a package repository involves many tasks, such as keeping packages
-tree tidy, generating packages indexes, synchronising bug report system,
-running coherency checks, checking for available updates, etc...
-
-Instead of a gazillion project-specific scripts, we aim to provide a generic package-format independant framework, so as to build coherent and robust tools.
+YOURI stands for "Youri Offers an Upload & Repository Infrastucture". It aims
+to build tools making management of a coherent set of packages easier.
-Components
-----------
-Available software in this release
-- youri-check allows to check packages
-- youri-upload allows to upload packages
+This package provides basic components used by other youri programs.
Installation
------------
@@ -25,9 +17,6 @@ perl Makefile.PL
make
make test
-All standard MakeMaker variables are usable, with the addition of SYSCONFDIR to
-specify configuration files destination.
-
Copyright and License
---------------------
Copyright (C) 2002-2006, YOURI project
@@ -42,4 +31,3 @@ Pascal Terjan <pterjan@zarb.org>
Damien Krotkine <dams@zarb.org>
Olivier Thauvin <nanardon@zarb.org>
Ville Skyttä <ville.skytta@iki.fi>
-
diff --git a/TODO b/TODO
index ddaf4ec..d6500d5 100644
--- a/TODO
+++ b/TODO
@@ -1,23 +1,6 @@
1.0 Goals
=========
-youri-check:
-- cumulative results aggregation
-- build bot specific information exploitation
-- results filtering and sorting facilities
-- maintainer customisable report mail format
-- additional update sources:
- - Ubuntu : using Debian on ubuntu mirror should be OK, have to test
- - kdelook
- - pld
-- alternative dependency input based on rpmcheck
-- circular dependency input based on smart
-
-youri-upload:
-- svn support
-- automatic bugzilla ticket closing on upload
-- more customizable (template based ?) mail notification
-
library:
- API-based bugzilla interface, instead of SQL-based one
- more generic check-specific options handling in medias (don't use a
diff --git a/t/package.t b/t/package.t
index 6a6d4b2..25e7798 100755
--- a/t/package.t
+++ b/t/package.t
@@ -5,22 +5,27 @@ use Test::More;
use Test::Exception;
use Youri::Utils;
use File::Temp qw/tempdir/;
+use File::Basename;
use strict;
my @classes = qw/
Youri::Package::URPM
Youri::Package::RPM4
/;
-my $file = 't/cowsay-3.03-11mdv2007.0.noarch.rpm';
-my $fake_file = 'foobar.rpm';
-plan(tests => 36 * scalar @classes);
+my $dir = dirname($0);
+my $rpm = 'cowsay-3.03-11mdv2007.0.noarch.rpm';
+my $fake_rpm = 'foobar.rpm';
+plan(tests => 37 * scalar @classes);
foreach my $class (@classes) {
- load($class);
+ load_class($class);
+
+ my $temp_dir = tempdir(CLEANUP => 1);
+ my $file = "$dir/$rpm";
+ my $fake_file = "$temp_dir/$fake_rpm";
# instanciation errors
dies_ok { $class->new(file => undef) } 'undefined file';
- unlink $fake_file;
dies_ok { $class->new(file => $fake_file) } 'non-existant file';
system('touch', $fake_file);
chmod 0000, $fake_file;
@@ -46,11 +51,12 @@ foreach my $class (@classes) {
is($package->get_tag('url'), 'http://www.nog.net/~tony/warez/cowsay.shtml', 'get url indirectly');
is($package->get_packager(), 'Guillaume Rousse <guillomovitch@mandriva.org>', 'get packager directly');
is($package->get_tag('packager'), 'Guillaume Rousse <guillomovitch@mandriva.org>', 'get packager indirectly');
+ is($package->get_file_name(), 'cowsay-3.03-11mdv2007.0.noarch.rpm', 'file name');
+ is($package->get_revision(), '3.03-11mdv2007.0', 'revision');
# name formating
- is($package->get_revision_name(), 'cowsay-3.03-11mdv2007.0', 'revision name');
- is($package->get_full_name(), 'cowsay-3.03-11mdv2007.0.noarch', 'full name');
- is($package->get_file_name(), 'cowsay-3.03-11mdv2007.0.noarch.rpm', 'file name');
+ is($package->as_formated_string('%{name}-%{version}-%{release}'), 'cowsay-3.03-11mdv2007.0', 'formated string name');
+ is($package->as_string(), 'cowsay-3.03-11mdv2007.0.noarch', 'default string');
is($package, 'cowsay-3.03-11mdv2007.0.noarch', 'stringification');
# type
@@ -478,20 +484,13 @@ foreach my $class (@classes) {
'last change'
);
is($package->compare($package), 0, 'compare');
-}
-
-foreach my $class (@classes) {
- load($class);
-
- my $tempdir = tempdir(CLEANUP => 1);
- system('cp', $file, $tempdir);
- my $package = $class->new(file => "$tempdir/cowsay-3.03-11mdv2007.0.noarch.rpm");
+ # signature test
+ system('cp', $file, $temp_dir);
+ $package = $class->new(file => "$temp_dir/$rpm");
$package->sign('Youri', 't/gpghome', 'Youri rulez');
- my $resigned_package = $class->new(file => "$tempdir/cowsay-3.03-11mdv2007.0.noarch.rpm");
- is($resigned_package->get_gpg_key(), '2333e817', 'get gpg key');
-
- system('rm', '-fr', '--', $tempdir);
+ $package = $class->new(file => "$temp_dir/$rpm");
+ is($package->get_gpg_key(), '2333e817', 'get gpg key');
}