Changeset 214 for trunk/dasscm


Ignore:
Timestamp:
Jul 3, 2007, 2:10:55 PM (17 years ago)
Author:
joergs
Message:

improvements, bugfixes

Location:
trunk/dasscm
Files:
1 deleted
7 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/dasscm

    • Property svn:ignore set to
      Changes
      ChangeLog

  • trunk/dasscm/SOURCES

    r211 r214  
    11dasscm
    22dasscm_dumpperm
    3 README
    43Changes
    54servers.dass-it
    65dasscm.conf
     6doc
  • trunk/dasscm/dasscm

    r209 r214  
    88  qw($DASSCM_PROD $DASSCM_REPO $USER $DASSCM_USERNAME $DASSCM_USER $DASSCM_PASSWORD);
    99use Cwd;
    10 use POSIX qw/getpgrp tcgetpgrp/;
    11 use Term::ReadKey;
     10use Getopt::Long;
    1211use File::Basename;
    1312use File::Compare;
     
    1615use File::stat;
    1716use File::Path;
    18 use Getopt::Long;
     17use Term::ReadKey;
    1918
    2019#
     
    3029
    3130my $config_file = "/etc/dasscm.conf";
    32 
    33 # my $config = SmartClient::Config->( $config_file );
    34 my $config = ConfigFile::read_config_file($config_file);
     31my $config      = ConfigFile::read_config_file($config_file);
    3532my $DASSCM_LOCAL_REPOSITORY_BASE;
    3633my $DASSCM_REPOSITORY_NAME;
     
    6966    print "   add <filename>\n";
    7067    print "   commit <filename>\n";
     68    print "   status <filename>\n";
    7169    print "   diff <filename>\n";
    7270    print "   help <subcommand>\n";
     
    7674    print
    7775      "svn checkout --no-auth-cache --username USERNAME https://dass-it.de/svn/dasscm/HOSTNAME\n";
    78     print "environment variables\n", "    DASSCM_REPO\n", "    DASSCM_PROD¸n",
     76    print "environment variables\n", "    DASSCM_REPO\n", "    DASSCM_PROD\n",
    7977      "    DASSCM_USERNAME\n", "    DASSCM_PASSWORD\n", "are evaluated.\n";
    8078    print "\n";
     
    174172    my $basename = basename($filename_prod);
    175173
    176     print "dir: " . $dirname_prod . "\n";
    177     print "fn: " . $basename . "\n";
     174    if ($verbose) {
     175        print "dir: " . $dirname_prod . "\n";
     176        print "fn: " . $basename . "\n";
     177    }
    178178
    179179    my $dirname_repo  = $DASSCM_REPO . "/" . $dirname_prod;
     
    301301    } else {
    302302        print "help for @_: ...\n";
     303        usage();
    303304    }
    304305}
     
    309310    check_env();
    310311
    311     my $output_username = "";
    312     if ($DASSCM_USERNAME) {
    313         $output_username = " ($DASSCM_USERNAME)";
    314     }
    315 
    316     print "Enter DASSCM user name", $output_username, ": ";
    317     my $input_username = <STDIN>;
    318     chomp($input_username);
     312    my $input_username = $1;
     313
     314    if ( not $input_username ) {
     315        my $output_username = "";
     316        if ($DASSCM_USERNAME) {
     317            $output_username = " ($DASSCM_USERNAME)";
     318        }
     319
     320        print "Enter DASSCM user name", $output_username, ": ";
     321        $input_username = <STDIN>;
     322        chomp($input_username);
     323    }
    319324
    320325    # hidden password input
     
    530535
    531536    # get command line options and store them in options hash
    532     my $result = GetOptions( \%options, 'message=s' );
     537    my $result = GetOptions( \%options, 'verbose', 'message=s' );
    533538
    534539    # print options
     
    537542    }
    538543
     544    # set verbose to command line option
     545    $verbose = $options{'verbose'};
     546
     547    #
     548    # action accordinly to command are taken
     549    # $command is rewritten in standard format,
     550    # so we can test for it later on more simply
     551    #
    539552    $_ = $command;
    540553    if (m/help/i) {
     
    547560        init(@ARGV);
    548561    } elsif (m/add/i) {
    549         ## rewrite command
    550562        $command = "add";
    551563        add(@ARGV);
     
    562574        $command = "status";
    563575        status(@ARGV);
    564     } elsif (m/activate/i) {
    565         ## TODO
    566         activate(@ARGV);
     576
     577        #     } elsif (m/activate/i) {
     578        #         ## TODO
     579        #         activate(@ARGV);
    567580    } else {
    568581        usage();
     
    574587    # commitall
    575588    # revert
    576     # status (chkconf)
    577 }
     589}
  • trunk/dasscm/dasscm.conf

    • Property svn:keywords set to Id
  • trunk/dasscm/dasscm.spec

    • Property svn:keywords set to Id
    r210 r214  
    66# package are under the same license as the package itself.
    77#
    8 # $Id: sc_base.spec 2323 2004-08-15 09:59:15Z joergs $
     8# $Id$
    99
    10 # neededforbuild 
    11 # usedforbuild gzip pam-modules tar
    12 
    13 Name:         dasscm
    14 URL:          http://www.dass-it.de/
    15 License:      GPL
    16 Group:        Development/Tools/Version Control
    17 Autoreqprov:  on
    18 Summary:      dass configuration file management tool
    19 Version:      0.7
    20 Release:      0
    21 Requires:     subversion perl perl-TermReadKey perl-libconfigfile
    22 Source:       %{name}-%{version}.tar.bz2
    23 BuildRoot:    /var/tmp/%{name}-build
    24 BuildArch:    noarch
     10Name:           dasscm
     11URL:            http://www.dass-it.de/
     12License:        GPL
     13Group:          Development/Tools/Version Control
     14Autoreqprov:    on
     15Summary:        dass configuration file management tool
     16Version:        0.7
     17Release:        0
     18Requires:       subversion perl perl-TermReadKey perl-libconfigfile
     19Source:         %{name}-%{version}.tar.bz2
     20BuildRoot:      /var/tmp/%{name}-build
     21BuildArch:      noarch
     22BuildRequires:  gzip pam-modules tar
    2523
    2624
    2725%description
    28 tools for handling configurations file with subversion
     26tools for handling configuration files with subversion
    2927
    3028Authors:
     
    4644install servers.dass-it $RPM_BUILD_ROOT/etc/subversion/
    4745install -m 640 dasscm.conf $RPM_BUILD_ROOT/etc/
     46mkdir -p $RPM_BUILD_ROOT/var/lib/dasscm/
    4847
    4948
     
    5554%files
    5655%defattr(-,root,root)
     56%dir /var/lib/dasscm/
    5757/usr/bin/dasscm*
    5858/etc/subversion/servers.dass-it
    5959%config(noreplace) /etc/dasscm.conf
    60 %doc Changes README
     60%doc Changes doc/
  • trunk/dasscm/doc/dasscm_howto.txt

    • Property svn:keywords set to Id
    r207 r214  
    1 Beispiel:
    2 - Benutzer: joergs
    3 - arbeiten als Benutzer: root
    4 - Subversion Read-Only Benutzer: lvermgeo
    5 - neuer Rechner: lxkatest
    61
    72
    8 *** neuen Rechner hinzufügen (einmalig pro Rechner):
    9 ggf. dasscm RPM installieren
     3dasscm:
     4Kurzbeschreibung der Einrichtung und Nutzung von dasscm
     5
     6$Id$
     7
     8*** neuen Rechner hinzufügen (einmalig pro Rechner)
     9
     10dasscm RPM installieren
    1011cd /etc/subversion/
    11 ln -s servers.dass-it servers  ; # oder Einstellungen manuell übertragen
    12 mkdir /root/svn/joergs
    13 cd /root/svn/joergs
    14 svn checkout --username lvermgeo https://dass-it.de/svn/lvermgeo/technical/config
    15 (ggf. Abzeptieren des Subversion Servers und Eingabe des Passwortes für lvermgeo)
    16 cd /root/svn/joergs/config/server
    17 svn mkdir lxkatest
    18 svn commit --no-auth-cache --username joergs -m "Konfigurationsverzeichnis für den Rechner lxkatest"
     12ln -s servers.dass-it servers  ; # oder /etc/subversion/servers manuell anpassen
     13Unique Client Namen ermitteln, normalerweise `hostname -f`
     14/etc/dasscm.conf anpassen
     15# Subversion Verzeichnis auf dem Server erstellen, z.B.
     16svn mkdir --no-auth-cache https://dass-it.de/svn/dasscm/config/<FQHOSTNAME>
     17dasscm init
    1918
    2019
    2120
    2221*** Vorbereitung (pro Login)
    23 export DASSCM_USER=joergs
    24 export DASSCM_REPO=/root/svn/joergs
    2522
    26 ggf. Festlegung, welche Editor für die Angabe von Checkin Kommentaren verwendet werden soll. Standard ist vi
    27 export EDITOR=joe
     23dasscm login
    2824
    2925
    3026
    3127*** Datei erstmalig anpassen und einpflegen
     28
    3229cd /etc/sysconfig
    3330cp -a cups cups.orig ; #(falls cups.orig nicht schon existiert)
     
    3835
    3936
    40 *** modifizierte Datei einpflegen:
     37*** modifizierte Datei einpflegen
     38
    4139dasscm commit -m "Kommentar zu meinen Anpassungen" /etc/sysconfig/cups
     40
     41
     42
     43*** Status überprüfen
     44# ermittelt, welche Dateien sich zwischenzeitlich auf dem System verändert haben
     45dasscm status
  • trunk/dasscm/servers.dass-it

    • Property svn:keywords set to Id
Note: See TracChangeset for help on using the changeset viewer.