~ubuntubudgie-dev/tasksel/ubuntu-budgie-tasksel-proposal.zesty

« back to all changes in this revision

Viewing changes to makedesc.pl

  • Committer: Joey Hess
  • Date: 2001-05-18 02:02:02 UTC
  • Revision ID: git-v1:9aadd503b5a19ad2c7d4790e7af67660cb60d557
My changes:
  * Added support for task description files.
  * Read in /usr/share/tasksel/debian-tasks.desc as a task description
    file.
  * Added makedesc.pl, a program to generate a task description file from
    a set of task descriptions.
  * Got rid of all the name prettification code since it is no longer used
    anyway.
  * Killed filterdescription, the task packages in woody actually don't
    have that problem anymore.
  * Don't move cursor to the right after a task is selected.
  * Removed unused tasksel.man from source package (keep pod).
  * Fixed an obscure bug if a task package happened to be the last thing in
    the available file.
  * Enable debug mode by default, but turn it off when building from the
    rules file.

Aj's changes:
  * Use "Section:" fields to break tasks into different sections. Have a
    hardcoded list of default sections, with a defined order; remaining
    sections get added to the end, in alphabetical order. Sections that
    don't match "tasks-*" are ignored.
  * "tasksel install foo bar baz" as a replacement for "apt-get install
    task-foo task-bar task-baz"
  * Increase the size of the "apt-get install" command line buffer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
#
 
3
# makedesc directory file
 
4
#
 
5
# Scan the directory for files, and use the files to generate a task
 
6
# description file. The format of the task description file is described in
 
7
# tata.c. The format of the input files is:
 
8
#
 
9
# Task: desktop
 
10
# Section: user
 
11
# Description: Provide a basic GUI system
 
12
#  This task provides functionality for a basic desktop; whether Gnome
 
13
#   based, KDE based or customised. With this task, your system will boot
 
14
#   into a graphical login screen, at which point you can choose which of
 
15
#   these desktops you wish to use on a per-user basis. You can further
 
16
#   customise your desktop once installed.
 
17
# Packages:
 
18
#  kdebase
 
19
#  gdm
 
20
#  ...
 
21
#
 
22
# Hash-comments are allowed in the files, but must be on their own lines.
 
23
 
 
24
my $dir=shift or die "no directory specified\n";
 
25
my $file=shift or die "no file specified\n";
 
26
 
 
27
open (OUT, ">$file") or die ">$file: $!";
 
28
 
 
29
use File::Find;
 
30
find(\&processfile, $dir);
 
31
 
 
32
sub processfile {
 
33
        return unless /^[-_.A-Za-z0-9]+$/ and -f $_;
 
34
        open (IN, $_) or die "$_: $!";
 
35
        my %fields;
 
36
        my $field="";
 
37
        while (<IN>) {
 
38
                chomp;
 
39
                next if /^\s*#/;
 
40
 
 
41
                if (/^\s/) {
 
42
                        $fields{$field}.="\n$_";
 
43
                }
 
44
                else {
 
45
                        ($field, my $value)=split(/:\s*/, $_, 2);
 
46
                        $field=lc($field);
 
47
                        $fields{$field}=$value;
 
48
                }
 
49
        }
 
50
        close IN;
 
51
 
 
52
        print OUT map { ucfirst($_).": ".$fields{$_}."\n" }
 
53
                qw{task section description};
 
54
        print OUT "\n";
 
55
}
 
56
 
 
57
close OUT;