Changeset 124

Show
Ignore:
Timestamp:
11/17/06 20:01:59 (2 years ago)
Author:
Gregor
Message:

sss/main.d, sss/uninstall.d: Added 'dsss installed'

sss/net.d: Use unix2dos on Windows before feeding to patch.exe, which is apparently sensitive.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/sss/main.d

    r123 r124  
    5353            INSTALL, 
    5454            UNINSTALL, 
     55            INSTALLED, 
    5556            NET, 
    5657            GENCONFIG 
     
    128129                command = cmd_t.UNINSTALL; 
    129130                 
     131            } else if (arg == "installed") { 
     132                commandSet = true; 
     133                command = cmd_t.INSTALLED; 
     134                 
    130135            } else if (arg == "net") { 
    131136                commandSet = true; 
     
    153158             
    154159        } else if (command == cmd_t.CLEAN || 
    155                    command == cmd_t.DISTCLEAN) { 
     160                   command == cmd_t.DISTCLEAN || 
     161                   command == cmd_t.INSTALLED) { 
    156162            /* commands that take no options whatsoever */ 
    157163            if (argIsHelp()) { 
     
    236242        case cmd_t.UNINSTALL: 
    237243            return sss.uninstall.uninstall(buildElems); 
     244            break; 
     245             
     246        case cmd_t.INSTALLED: 
     247            return sss.uninstall.installed(); 
    238248            break; 
    239249             
     
    264274    install:   install all or some binaries or libraries 
    265275    uninstall: uninstall a specified tool or library 
     276    installed: list installed software 
    266277    net:       Internet-based installation and package management 
    267278    genconfig: generate a config file 
     
    307318            ); 
    308319         
     320    } else if (command == cmd_t.INSTALLED) { 
     321        writefln( 
     322`Usage: dsss [dsss options] installed` 
     323            ); 
     324         
    309325    } else if (command == cmd_t.NET) { 
    310326        writefln( 
    311327`Usage: dsss [dsss options] net <net command> <package name> 
    312328  Net Commands: 
    313     deps:    Install (from the network source) dependencies of the present 
     329    deps:    install (from the network source) dependencies of the present 
    314330             package 
    315     install: Install a package via the network source 
    316     fetch:   Fetch but do not compile or install a package 
    317     list:    List all installable packages 
    318     search:  Find an installable package by name` 
     331    install: install a package via the network source 
     332    fetch:   fetch but do not compile or install a package 
     333    list:    list all installable packages 
     334    search:  find an installable package by name` 
    319335            ); 
    320336 
  • trunk/sss/net.d

    r123 r124  
    512512                         " -o " ~ pfile); 
    513513             
     514            // convert it to DOS line endings if necessary 
     515            version (Windows) { 
     516                saySystemDie("unix2dos " ~ pfile); 
     517            } 
     518             
    514519            // install the patch 
    515520            system("patch -p0 -i " ~ pfile); 
  • trunk/sss/uninstall.d

    r86 r124  
    6868    return 0; 
    6969} 
     70 
     71/** Entry to the "installed" function */ 
     72int installed() 
     73{ 
     74    foreach (pkg; listdir(manifestPrefix).sort) 
     75    { 
     76        if (pkg.length < 9 || pkg[$-9 .. $]  != ".manifest") continue; 
     77        pkg = pkg[0 .. $-9]; 
     78         
     79        writefln("%s", pkg); 
     80    } 
     81     
     82    return 0; 
     83}