Browse Source

Also allows you to install standard priority packages now

tags/debian_version_1_0-8
Randolph Chung 22 years ago
parent
commit
4041b2ebdb
2 changed files with 13 additions and 8 deletions
  1. +2
    -1
      debian/changelog
  2. +11
    -7
      tasksel.c

+ 2
- 1
debian/changelog View File

@@ -1,6 +1,7 @@
tasksel (1.0-7) frozen unstable; urgency=low

* Adds -r, -i switches for installing required and important packages
* Adds -r, -i and -s switches for installing required, important and
standard priority packages
* Adds -n option for non-interactive runs (for use with -r or -i)
* Make data.c read priority settings; made packages_enumerate
reentrant


+ 11
- 7
tasksel.c View File

@@ -1,4 +1,4 @@
/* $Id: tasksel.c,v 1.5 2000/02/06 22:12:32 tausq Exp $ */
/* $Id: tasksel.c,v 1.6 2000/02/07 01:09:53 tausq Exp $ */
#include "tasksel.h"

#include <stdio.h>
@@ -27,11 +27,12 @@ static void signalhandler(int sig)

void help(void)
{
fprintf(stderr, "tasksel [-t]\n");
fprintf(stderr, _("tasksel [options]; where options is any combination of:\n"));
fprintf(stderr, "\t%s\n", _("-t -- test mode; don't actually run apt-get on exit"));
fprintf(stderr, "\t%s\n", _("-q -- queue installs; do not install packages with apt-get;\n\t\tjust queue them in dpkg"));
fprintf(stderr, "\t%s\n", _("-r -- install all required-priority packages"));
fprintf(stderr, "\t%s\n", _("-i -- install all important-priority packages"));
fprintf(stderr, "\t%s\n", _("-s -- install all standard-priority packages"));
fprintf(stderr, "\t%s\n\n", _("-n -- don't show UI; use with -r or -i usually"));
exit(0);
}
@@ -105,7 +106,7 @@ int main(int argc, char * const argv[])
{
int i, c, r = 0;
unsigned char testmode = 0, queueinstalls = 0, installreqd = 0;
unsigned char installimp = 0, noninteractive = 0;
unsigned char installimp = 0, installstd = 0, noninteractive = 0;
struct packages_t taskpkgs, packages;
struct package_t **pkglist, **taskpkglist;
@@ -116,7 +117,7 @@ int main(int argc, char * const argv[])
textdomain(PACKAGE);
while (1) {
c = getopt(argc, argv, "tqrin");
c = getopt(argc, argv, "tqrins");
if (c == -1) break;

switch (c) {
@@ -124,6 +125,7 @@ int main(int argc, char * const argv[])
case 'q': queueinstalls = 1; break;
case 'r': installreqd = 1; break;
case 'i': installimp = 1; break;
case 's': installstd = 1; break;
case 'n': noninteractive = 1; break;
default: help();
}
@@ -146,19 +148,21 @@ int main(int argc, char * const argv[])
taskpkglist = packages_enumerate(&taskpkgs);
pkglist = packages_enumerate(&packages);

if (installreqd || installimp) {
if (installreqd || installimp || installstd) {
for (i = 0; i < packages.count; i++) {
if (installreqd && pkglist[i]->priority == PRIORITY_REQUIRED)
pkglist[i]->selected = 1;
if (installimp && pkglist[i]->priority == PRIORITY_IMPORTANT)
pkglist[i]->selected = 1;
if (installstd && pkglist[i]->priority == PRIORITY_STANDARD)
pkglist[i]->selected = 1;
}
}

if (r == 0) r = doinstall(taskpkglist, taskpkgs.count,
pkglist,
(installreqd || installimp ? packages.count
: 0),
(installreqd || installimp || installstd
? packages.count : 0),
queueinstalls, testmode);

packages_free(&taskpkgs, &packages);


Loading…
Cancel
Save