Skip to content

Commit

Permalink
Merge branch 'release/v1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
giterlizzi committed May 23, 2017
2 parents 35d101b + 01e69f7 commit b3a3871
Show file tree
Hide file tree
Showing 16 changed files with 238 additions and 19 deletions.
5 changes: 5 additions & 0 deletions bin/slackman
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ update Slackware packages from a standard Slackware repository (official and 3th
-c, --config Configuration file
--root Set Slackware root directory
--repo Use specified repo during update or install packages
-f, --force Force action
--download-only Download only
--new-packages Check for new packages
--obsolete-packages Check for obsolete packages
Expand All @@ -104,6 +105,10 @@ Update repository packages and upgrade all packages:

slackman update && slackman upgrade -y

Force update of specific repository:

slackman update packages --repo slackware:packages --force

Install, update and remove obsolete packages from specific repository:

slackman update
Expand Down
34 changes: 34 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SlackMan Examples

Update repository packages and upgrade all packages:

# slackman update && slackman upgrade -y

Install, update and remove obsolete packages from specific repository:

# slackman update
# slackman install --new-packages --repo ktown
# slackman upgrade --repo ktown
# slackman remove --obsolete-packages --repo ktown

Update package excluding kernels packages

# slackman upgrade --exclude kernel-*

Search package:

# slackman search docker

Search file using MANIFEST.bz2 repository file (`slackman update manifest`):

# slackman file-search firefox

Enable a repository:

# slackman repo enable slackware:multilib

Bash Completion:

# slackman repo info sla<TAB><TAB>
slackware:extra slackware:multilib slackware:packages
slackware:pasture slackware:patches slackware:testing
30 changes: 30 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[![Release](https://img.shields.io/github/release/LotarProject/slackman.svg)](https://github.com/LotarProject/slackman/releases) [![Build Status](https://travis-ci.org/LotarProject/slackman.svg)](https://travis-ci.org/LotarProject/slackman) [![License](https://img.shields.io/github/license/LotarProject/slackman.svg)](https://github.com/LotarProject/slackman) [![Starts](https://img.shields.io/github/stars/LotarProject/slackman.svg)](https://github.com/LotarProject/slackman) [![Forks](https://img.shields.io/github/forks/LotarProject/slackman.svg)](https://github.com/LotarProject/slackman) [![Issues](https://img.shields.io/github/issues/LotarProject/slackman.svg)](https://github.com/LotarProject/slackman/issues)

# slackman

SlackMan - Slackware Package Manager

SlackMan is easy-to-use wrapper for Slackware ``pkgtools`` can help to install,
update Slackware packages from a standard Slackware repository (official and 3th party).

## Features

- Multiple repository support
- Dependency resolution
- Bash Completion support
- More configurable
- Flexible configuration via variables
- ... and more

## Read more

- [Install & Build](install.md)
- [Repository](repo.md)
- [Variables](variables.md)


## Copyright

- Copyright 2016-2017 © Giuseppe Di Terlizzi
- Slackware® is a Registered Trademark of Patrick Volkerding
- Linux is a Registered Trademark of Linus Torvalds
19 changes: 19 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SlackMan Install & Build

## Installation

To install SlackMan, run the following commands:

perl Makefile.PL
make
make test
make install

## Create SlackBuild package

To automate a creation of SlackBuild package use `Build.PL`:

# cd slackbuilds
# perl Build.pl
[...]
# upgradepkg --install-new slackman-x.y.z-noarch-1_lotar.tgz
20 changes: 17 additions & 3 deletions docs/REPO.md → docs/repo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Repository Configuration

## Sample
# SlackMan Repository

## Supported Repository

- Slackware stable and **-current**
- SlackOnly
- Slackers (Conraid)
- Slacky (Italian Slackware Community)
- AlienBob
- ktown (KDE5)
- Cinnamon SlackBuilds
- MATE SlackBuilds
- Salix
- Microlinux
- ... and more

## Sample configuration

This is a sample .repo configuration

Expand Down
71 changes: 71 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# SlackMan Usage

Usage:
slackman [options] [commands] [...]

Commands:
install PACKAGE [...] Install one or more packages
upgrade [PACKAGE [...]] Update installed packages
reinstall PACKAGE [...] Reinstall one or more packages
remove PACKAGE [...] Remove one or more packages

check-update Check packages updates
changelog Display repository ChangeLogs
search PATTERN Search packages using PATTERN
file-search PATTERN Search files into packages using PATTERN
info PACKAGE Display information about installed or available packages
history PACKAGE Display package history information
config Display configuration
help COMMAND Display command usage

Repository Commands:
repo list List available repositories
repo enable REPOSITORY Enable repository
repo disable REPOSITORY Disable repository
repo info REPOSITORY Display repository information

List Commands:
list obsolete List obsolete packages
list installed List installed packages
list packages List available packages
list repo List available repositories
list orphan List orphan packages installed from unknown repository
list variables List variables for repos.d/* configurations

Update Commands:
update Update repository and local history packages metadata
update history Update local packages history metadata
update packages Update repository metadata
update changelog Update repository ChangeLog
update manifest Update repository Manifest
update gpg-key Update repository GPG-KEY
update all Update all metadata (packages, gpg-key, changelog, etc.)

Clean Commands:
clean cache Clean cache package download directory
clean metadata Clean database metadata
clean manifest Clean manifest data
clean all Clean metadata and cache directory

Database Commands:
db optimize Optimize slackman database
db info Display information about slackman database

Options:
-h, --help Display help and exit
--man Display man pages
--version Display version information
-c, --config Configuration file
--root Set Slackware root directory
--repo Use specified repo during update or install packages
--download-only Download only
--new-packages Check for new packages
--obsolete-packages Check for obsolete packages
-x, --exclude PACKAGE Exclude package
--show-files Show file lists
--no-priority Disable repository priority check
--no-excludes Disable exclude repo configuration
-y, --yes Assume yes
-n, --no Assume no
--quiet Quiet

File renamed without changes.
2 changes: 1 addition & 1 deletion lib/Slackware/SlackMan.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ BEGIN {

@ISA = qw(Exporter);

$VERSION = 'v1.0.1';
$VERSION = 'v1.0.2';

@EXPORT_OK = (
@Slackware::SlackMan::Utils::EXPORT_OK,
Expand Down
42 changes: 35 additions & 7 deletions lib/Slackware/SlackMan/Command.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BEGIN {

require Exporter;

$VERSION = 'v1.0.1';
$VERSION = 'v1.0.2';
@ISA = qw(Exporter);
@EXPORT_OK = qw(run);
%EXPORT_TAGS = (
Expand Down Expand Up @@ -344,6 +344,7 @@ sub _call_clean_metadata {

db_reindex();
db_compact();

STDOUT->printflush("done\n");

}
Expand All @@ -352,7 +353,14 @@ sub _call_update_repo_packages {

STDOUT->printflush("\nUpdate repository packages metadata:\n");

foreach my $repo (get_enabled_repositories()) {
my @repos = get_enabled_repositories();
my $repo_option = $slackman_opts->{'repo'};

if ($slackman_opts->{'repo'} && grep(/^$repo_option$/, get_enabled_repositories)) {
@repos = ( $slackman_opts->{'repo'} );
}

foreach my $repo (@repos) {

logger->info(qq/Update "$repo" repository packages/);
my $repo_data = get_repository($repo);
Expand All @@ -369,7 +377,14 @@ sub _call_update_repo_gpg_key {

STDOUT->printflush("\nUpdate repository GPG key:\n");

foreach my $repo (get_enabled_repositories()) {
my @repos = get_enabled_repositories();
my $repo_option = $slackman_opts->{'repo'};

if ($slackman_opts->{'repo'} && grep(/^$repo_option$/, get_enabled_repositories)) {
@repos = ( $slackman_opts->{'repo'} );
}

foreach my $repo (@repos) {

logger->info(qq/Update "$repo" repository GPG-KEY/);
my $repo_data = get_repository($repo);
Expand Down Expand Up @@ -399,7 +414,14 @@ sub _call_update_repo_changelog {

STDOUT->printflush("\nUpdate repository ChangeLog:\n");

foreach my $repo (get_enabled_repositories()) {
my @repos = get_enabled_repositories();
my $repo_option = $slackman_opts->{'repo'};

if ($slackman_opts->{'repo'} && grep(/^$repo_option$/, get_enabled_repositories)) {
@repos = ( $slackman_opts->{'repo'} );
}

foreach my $repo (@repos) {

logger->info(qq/Update "$repo" repository ChangeLog/);
my $repo_data = get_repository($repo);
Expand All @@ -416,7 +438,14 @@ sub _call_update_repo_manifest {

STDOUT->printflush("\nUpdate repository Manifest (very slow for big repository ... be patient):\n");

foreach my $repo (get_enabled_repositories()) {
my @repos = get_enabled_repositories();
my $repo_option = $slackman_opts->{'repo'};

if ($slackman_opts->{'repo'} && grep(/^$repo_option$/, get_enabled_repositories)) {
@repos = ( $slackman_opts->{'repo'} );
}

foreach my $repo (@repos) {

my $repo_data = get_repository($repo);

Expand Down Expand Up @@ -725,7 +754,6 @@ sub _call_package_update {
packages.checksum
FROM packages, history
WHERE history.name = packages.name
AND packages.arch = history.arch
AND history.status = "installed"
AND old_version_build != new_version_build
AND version_compare(old_version_build, new_version_build) < 0
Expand Down Expand Up @@ -1028,7 +1056,7 @@ sub _call_changelog {
my $sth = $dbh->prepare(sprintf($query, join(' AND ', @filters), $slackman_opts->{'limit'}));
$sth->execute();

print sprintf("%-60s %-15s %-25s %s\n", "Package", "Status", "Timestamp", "Repository");
print sprintf("%-60s %-10s %-25s %s\n", "Package", "Status", "Timestamp", "Repository");
print sprintf("%s\n", "-"x132);

while (my $row = $sth->fetchrow_hashref()) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Slackware/SlackMan/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BEGIN {

require Exporter;

$VERSION = 'v1.0.1';
$VERSION = 'v1.0.2';
@ISA = qw(Exporter);

@EXPORT_OK = qw{
Expand Down
2 changes: 1 addition & 1 deletion lib/Slackware/SlackMan/DB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BEGIN {

require Exporter;

$VERSION = 'v1.0.1';
$VERSION = 'v1.0.2';
@ISA = qw(Exporter);

@EXPORT_OK = qw{
Expand Down
2 changes: 1 addition & 1 deletion lib/Slackware/SlackMan/Logger.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BEGIN {

require Exporter;

$VERSION = 'v1.0.1';
$VERSION = 'v1.0.2';
@ISA = qw(Exporter);
@EXPORT_OK = qw{}

Expand Down
2 changes: 1 addition & 1 deletion lib/Slackware/SlackMan/Package.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BEGIN {

require Exporter;

$VERSION = 'v1.0.1';
$VERSION = 'v1.0.2';
@ISA = qw(Exporter);

@EXPORT_OK = qw{
Expand Down
20 changes: 19 additions & 1 deletion lib/Slackware/SlackMan/Parser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BEGIN {

require Exporter;

$VERSION = 'v1.0.1';
$VERSION = 'v1.0.2';
@ISA = qw(Exporter);

@EXPORT_OK = qw{
Expand Down Expand Up @@ -59,6 +59,12 @@ sub parse_changelog {
my $meta_last_modified = db_meta_get("changelog-last-update.$repository");
$meta_last_modified = 0 unless($meta_last_modified);

# Force update
if ($slackman_opts->{'force'}) {
$meta_last_modified = 0;
logger->info('Force changelog update');
}

if ($meta_last_modified >= $changelog_last_modified) {
&$callback_status('skip') if ($callback_status);
return(0);
Expand Down Expand Up @@ -228,6 +234,12 @@ sub parse_packages {
my $meta_last_modified = db_meta_get("packages-last-update.$repository");
$meta_last_modified = 0 unless($meta_last_modified);

# Force update
if ($slackman_opts->{'force'}) {
$meta_last_modified = 0;
logger->info('Force packages update');
}

if ($meta_last_modified >= $packages_last_modified) {
&$callback_status('skip') if ($callback_status);
return(0);
Expand Down Expand Up @@ -328,6 +340,12 @@ sub parse_manifest {
my $meta_last_modified = db_meta_get("manifest-last-update.$repository");
$meta_last_modified = 0 unless($meta_last_modified);

# Force update
if ($slackman_opts->{'force'}) {
$meta_last_modified = 0;
logger->info('Force manifest update');
}

if ($meta_last_modified >= $manifest_last_modified) {
&$callback_status('skip') if ($callback_status);
return(0);
Expand Down
Loading

0 comments on commit b3a3871

Please sign in to comment.