changeset 16:cd47c42f1d0a

reorganizing.
author Robert McIntyre <rlm@mit.edu>
date Wed, 09 Jan 2013 11:38:31 +0000
parents 48c7c2099978
children cb1a44d080db
files .hgignore defaults/Makefile defaults/create-skeleton.sh defaults/hg-wrapper.c defaults/hg-wrapper.cpp defaults/hg-wrapper.pl defaults/profile src/Makefile src/create-skeleton.sh src/hg-wrapper.c src/hg-wrapper.cpp src/hg-wrapper.pl src/pkg.pl src/profile
diffstat 14 files changed, 88 insertions(+), 89 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/.hgignore	Wed Jan 09 11:07:14 2013 +0000
     1.2 +++ b/.hgignore	Wed Jan 09 11:38:31 2013 +0000
     1.3 @@ -1,2 +1,2 @@
     1.4  syntax:glob
     1.5 -./defaults/hg-wrapper
     1.6 \ No newline at end of file
     1.7 +./src/hg-wrapper
     1.8 \ No newline at end of file
     2.1 --- a/defaults/Makefile	Wed Jan 09 11:07:14 2013 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,10 +0,0 @@
     2.4 -all:
     2.5 -	gcc -I/usr/include -lpipeline hg-wrapper.c -o hg-wrapper
     2.6 -clean:
     2.7 -	rm hg-wrapper
     2.8 -
     2.9 -
    2.10 -
    2.11 -# to build the incorrect cpp version.
    2.12 -#all:
    2.13 -#	g++ -I/usr/include hg-wrapper.cpp -o hg-wrapper
     3.1 --- a/defaults/create-skeleton.sh	Wed Jan 09 11:07:14 2013 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,4 +0,0 @@
     3.4 -mkdir -pv /pkg/defaults
     3.5 -ln -sfv $(pwd)/profile  /pkg/defaults/.profile
     3.6 -ln -sfv $(pwd)/hg-wrapper /pkg/defaults/.hg-wrapper
     3.7 -
     4.1 --- a/defaults/hg-wrapper.c	Wed Jan 09 11:07:14 2013 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,16 +0,0 @@
     4.4 -#include <pipeline.h>
     4.5 -#include <unistd.h>
     4.6 -
     4.7 -main( int argc, char ** argv){
     4.8 -  pipecmd* p = pipecmd_new("hg");
     4.9 -
    4.10 -  int i;
    4.11 -  for(i = 1; i < argc; i++){
    4.12 -    pipecmd_arg(p, argv[i]);
    4.13 -  }
    4.14 -
    4.15 -  setreuid(geteuid(), geteuid());
    4.16 -  setregid(getegid(), getegid());
    4.17 -
    4.18 -  pipecmd_exec(p);
    4.19 -}
     5.1 --- a/defaults/hg-wrapper.cpp	Wed Jan 09 11:07:14 2013 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,17 +0,0 @@
     5.4 -#include <cstdlib>
     5.5 -#include <vector>
     5.6 -#include <string>
     5.7 -#include <unistd.h>
     5.8 -#include <boost/algorithm/string/join.hpp>
     5.9 -
    5.10 -/** This a simple wrapper script to call 
    5.11 -    mercurial as a semi-privleged user. */
    5.12 -
    5.13 -main( int argc, char ** argv){
    5.14 -  std::vector<std::string> input(argv, argv+argc);
    5.15 -  input[0] = std::string("hg");
    5.16 -  std::string command = boost::algorithm::join(input, " ");
    5.17 -  setreuid(geteuid(), geteuid());
    5.18 -  setregid(getegid(), getegid());
    5.19 -  return system(command.c_str());
    5.20 -}
     6.1 --- a/defaults/hg-wrapper.pl	Wed Jan 09 11:07:14 2013 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,7 +0,0 @@
     6.4 -#!/usr/bin/perl -wT
     6.5 -
     6.6 -$ENV{"PATH"} = "/usr/bin";
     6.7 -delete @ENV{qw(IFS CDPATH ENV BASH_ENV PATH)};
     6.8 -
     6.9 -unshift(@ARGV, "hg");
    6.10 -exec(@ARGV);
     7.1 --- a/defaults/profile	Wed Jan 09 11:07:14 2013 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,33 +0,0 @@
     7.4 -#!/bin/bash
     7.5 -set +h
     7.6 -
     7.7 -export PATH=\
     7.8 -"/home/r/system/usr/bin:\
     7.9 -/sbin/:\
    7.10 -/bin:\
    7.11 -/usr/sbin:\
    7.12 -/usr/bin:\
    7.13 -/tools/bin"
    7.14 -
    7.15 -alias ls="/usr/bin/env ls --color=auto "
    7.16 -export ls
    7.17 -alias la="ls -la"
    7.18 -export la
    7.19 -
    7.20 -# some personal shortcuts
    7.21 -alias r="reset"
    7.22 -export r
    7.23 -alias sl=ls
    7.24 -export sl
    7.25 -alias l=ls
    7.26 -export l
    7.27 -
    7.28 -colors="/etc/dircolors"
    7.29 -eval $(dircolors -b $colors)
    7.30 -unset colors
    7.31 -
    7.32 -export HGEDITOR="emacs"
    7.33 -
    7.34 -alias hg="~/.hg-wrapper --config ui.username=`whoami`"
    7.35 -
    7.36 -PS1="\[$(tput setaf 3)\][\u \w] % \[$(tput sgr0)\]"
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/src/Makefile	Wed Jan 09 11:38:31 2013 +0000
     8.3 @@ -0,0 +1,10 @@
     8.4 +all:
     8.5 +	gcc -I/usr/include -lpipeline hg-wrapper.c -o hg-wrapper
     8.6 +clean:
     8.7 +	rm hg-wrapper
     8.8 +
     8.9 +
    8.10 +
    8.11 +# to build the incorrect cpp version.
    8.12 +#all:
    8.13 +#	g++ -I/usr/include hg-wrapper.cpp -o hg-wrapper
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/src/create-skeleton.sh	Wed Jan 09 11:38:31 2013 +0000
     9.3 @@ -0,0 +1,4 @@
     9.4 +mkdir -pv /pkg/defaults
     9.5 +ln -sfv $(pwd)/profile  /pkg/defaults/.profile
     9.6 +ln -sfv $(pwd)/hg-wrapper /pkg/defaults/.hg-wrapper
     9.7 +
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/src/hg-wrapper.c	Wed Jan 09 11:38:31 2013 +0000
    10.3 @@ -0,0 +1,16 @@
    10.4 +#include <pipeline.h>
    10.5 +#include <unistd.h>
    10.6 +
    10.7 +main( int argc, char ** argv){
    10.8 +  pipecmd* p = pipecmd_new("hg");
    10.9 +
   10.10 +  int i;
   10.11 +  for(i = 1; i < argc; i++){
   10.12 +    pipecmd_arg(p, argv[i]);
   10.13 +  }
   10.14 +
   10.15 +  setreuid(geteuid(), geteuid());
   10.16 +  setregid(getegid(), getegid());
   10.17 +
   10.18 +  pipecmd_exec(p);
   10.19 +}
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/src/hg-wrapper.cpp	Wed Jan 09 11:38:31 2013 +0000
    11.3 @@ -0,0 +1,17 @@
    11.4 +#include <cstdlib>
    11.5 +#include <vector>
    11.6 +#include <string>
    11.7 +#include <unistd.h>
    11.8 +#include <boost/algorithm/string/join.hpp>
    11.9 +
   11.10 +/** This a simple wrapper script to call 
   11.11 +    mercurial as a semi-privleged user. */
   11.12 +
   11.13 +main( int argc, char ** argv){
   11.14 +  std::vector<std::string> input(argv, argv+argc);
   11.15 +  input[0] = std::string("hg");
   11.16 +  std::string command = boost::algorithm::join(input, " ");
   11.17 +  setreuid(geteuid(), geteuid());
   11.18 +  setregid(getegid(), getegid());
   11.19 +  return system(command.c_str());
   11.20 +}
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/src/hg-wrapper.pl	Wed Jan 09 11:38:31 2013 +0000
    12.3 @@ -0,0 +1,7 @@
    12.4 +#!/usr/bin/perl -wT
    12.5 +
    12.6 +$ENV{"PATH"} = "/usr/bin";
    12.7 +delete @ENV{qw(IFS CDPATH ENV BASH_ENV PATH)};
    12.8 +
    12.9 +unshift(@ARGV, "hg");
   12.10 +exec(@ARGV);
    13.1 --- a/src/pkg.pl	Wed Jan 09 11:07:14 2013 +0000
    13.2 +++ b/src/pkg.pl	Wed Jan 09 11:38:31 2013 +0000
    13.3 @@ -51,7 +51,6 @@
    13.4    exit 1;
    13.5  }
    13.6  
    13.7 -
    13.8  $pkg_home = "$pkg_home_root/$pkg_name";
    13.9  
   13.10  #set default for $pkg_desc.
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/src/profile	Wed Jan 09 11:38:31 2013 +0000
    14.3 @@ -0,0 +1,33 @@
    14.4 +#!/bin/bash
    14.5 +set +h
    14.6 +
    14.7 +export PATH=\
    14.8 +"/home/r/system/usr/bin:\
    14.9 +/sbin/:\
   14.10 +/bin:\
   14.11 +/usr/sbin:\
   14.12 +/usr/bin:\
   14.13 +/tools/bin"
   14.14 +
   14.15 +alias ls="/usr/bin/env ls --color=auto "
   14.16 +export ls
   14.17 +alias la="ls -la"
   14.18 +export la
   14.19 +
   14.20 +# some personal shortcuts
   14.21 +alias r="reset"
   14.22 +export r
   14.23 +alias sl=ls
   14.24 +export sl
   14.25 +alias l=ls
   14.26 +export l
   14.27 +
   14.28 +colors="/etc/dircolors"
   14.29 +eval $(dircolors -b $colors)
   14.30 +unset colors
   14.31 +
   14.32 +export HGEDITOR="emacs"
   14.33 +
   14.34 +alias hg="~/.hg-wrapper --config ui.username=`whoami`"
   14.35 +
   14.36 +PS1="\[$(tput setaf 3)\][\u \w] % \[$(tput sgr0)\]"