~fredg/twapake

4dec22f446cccf3d36316476792042c94440fff1 — Fred. Galusik 1 year, 2 months ago a2401fc
add -d for list deinstall pkgs and update
1 files changed, 21 insertions(+), 10 deletions(-)

M twapake
M twapake => twapake +21 -10
@@ 28,6 28,7 @@ sub usage {
    print "Options:\n";
    print " -l | --logfile\t\tprint snapshot logfile to /var/log/twapake/\n";
    print " -i | --installed\tprint a sorted list of packages\n";
    print " -d | --deinstalled\tprint a sorted list of last removed packages\n";
    print " -n | --nlpkg\t\tused with -i or -r, choose the last N installed packages\n";
    print " -r | --remove\t\tremove the last N installed packages\n";
    print " -s | --since\t\tprint today installed packages\n";


@@ 68,34 69,44 @@ if ($version) {
    exit 0;
    }
if ($logfile) {
    $Twapake::dir = $Twapake::pkgdir;
    Twapake::get_files($Twapake::pkgdir);
    Twapake->twalog();
    print "Writing $Twapake::twa_path/${Twapake::nowfile}_twapake.log ...\n";
    exit 0;
    }
if ($installed) {
    Twapake->sortmtimelist();
    $Twapake::dir = $Twapake::pkgdir;
    Twapake::get_files($Twapake::dir);
    Twapake::sortmtimelist();
    exit 0;
    }
if ($deinstalled) {
    print "nlpkg: $Twapake::nlpkg\n";
    $Twapake::dir = $Twapake::rmpkgdir;
    print "dir: $Twapake::dir\n";
    #Twapake->get_files();
    Twapake->sortmtimelist();
    Twapake::get_files($Twapake::dir);
    Twapake::sortmtimelist();
    exit 0;
}
if ($remove) {
    Twapake->rmpkg();
    $Twapake::dir = $Twapake::pkgdir;
    Twapake::get_files($Twapake::pkgdir);
    Twapake::checknpkg();
    Twapake::rmpkg();
    exit 0;
    }
if ($since) {
    Twapake->checkdate();
    Twapake->installedsince();
    $Twapake::dir = $Twapake::pkgdir;
    Twapake::get_files($Twapake::pkgdir);
    Twapake::checkdate();
    Twapake::installedsince();
    exit 0;
    }
if ($ui) {
    Twapake->checkrm();
    Twacurse->uic();
    $Twapake::dir = $Twapake::pkgdir;
    Twapake::get_files($Twapake::pkgdir);
    Twapake::checkrm();
    Twapake::checknpkg();
    Twacurse::uic();
    }
else {
    die "Wrong usage, run twapake --help for information.\n";