# HG changeset patch # User Robert McIntyre # Date 1357731511 0 # Node ID cd47c42f1d0afdeeb0d6e965465292a7dfd7dbc0 # Parent 48c7c2099978c09d792dc71430824a0644d4cfb1 reorganizing. diff -r 48c7c2099978 -r cd47c42f1d0a .hgignore --- a/.hgignore Wed Jan 09 11:07:14 2013 +0000 +++ b/.hgignore Wed Jan 09 11:38:31 2013 +0000 @@ -1,2 +1,2 @@ syntax:glob -./defaults/hg-wrapper \ No newline at end of file +./src/hg-wrapper \ No newline at end of file diff -r 48c7c2099978 -r cd47c42f1d0a defaults/Makefile --- a/defaults/Makefile Wed Jan 09 11:07:14 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -all: - gcc -I/usr/include -lpipeline hg-wrapper.c -o hg-wrapper -clean: - rm hg-wrapper - - - -# to build the incorrect cpp version. -#all: -# g++ -I/usr/include hg-wrapper.cpp -o hg-wrapper diff -r 48c7c2099978 -r cd47c42f1d0a defaults/create-skeleton.sh --- a/defaults/create-skeleton.sh Wed Jan 09 11:07:14 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -mkdir -pv /pkg/defaults -ln -sfv $(pwd)/profile /pkg/defaults/.profile -ln -sfv $(pwd)/hg-wrapper /pkg/defaults/.hg-wrapper - diff -r 48c7c2099978 -r cd47c42f1d0a defaults/hg-wrapper.c --- a/defaults/hg-wrapper.c Wed Jan 09 11:07:14 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -#include -#include - -main( int argc, char ** argv){ - pipecmd* p = pipecmd_new("hg"); - - int i; - for(i = 1; i < argc; i++){ - pipecmd_arg(p, argv[i]); - } - - setreuid(geteuid(), geteuid()); - setregid(getegid(), getegid()); - - pipecmd_exec(p); -} diff -r 48c7c2099978 -r cd47c42f1d0a defaults/hg-wrapper.cpp --- a/defaults/hg-wrapper.cpp Wed Jan 09 11:07:14 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -#include -#include -#include -#include -#include - -/** This a simple wrapper script to call - mercurial as a semi-privleged user. */ - -main( int argc, char ** argv){ - std::vector input(argv, argv+argc); - input[0] = std::string("hg"); - std::string command = boost::algorithm::join(input, " "); - setreuid(geteuid(), geteuid()); - setregid(getegid(), getegid()); - return system(command.c_str()); -} diff -r 48c7c2099978 -r cd47c42f1d0a defaults/hg-wrapper.pl --- a/defaults/hg-wrapper.pl Wed Jan 09 11:07:14 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -#!/usr/bin/perl -wT - -$ENV{"PATH"} = "/usr/bin"; -delete @ENV{qw(IFS CDPATH ENV BASH_ENV PATH)}; - -unshift(@ARGV, "hg"); -exec(@ARGV); diff -r 48c7c2099978 -r cd47c42f1d0a defaults/profile --- a/defaults/profile Wed Jan 09 11:07:14 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -#!/bin/bash -set +h - -export PATH=\ -"/home/r/system/usr/bin:\ -/sbin/:\ -/bin:\ -/usr/sbin:\ -/usr/bin:\ -/tools/bin" - -alias ls="/usr/bin/env ls --color=auto " -export ls -alias la="ls -la" -export la - -# some personal shortcuts -alias r="reset" -export r -alias sl=ls -export sl -alias l=ls -export l - -colors="/etc/dircolors" -eval $(dircolors -b $colors) -unset colors - -export HGEDITOR="emacs" - -alias hg="~/.hg-wrapper --config ui.username=`whoami`" - -PS1="\[$(tput setaf 3)\][\u \w] % \[$(tput sgr0)\]" diff -r 48c7c2099978 -r cd47c42f1d0a src/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Makefile Wed Jan 09 11:38:31 2013 +0000 @@ -0,0 +1,10 @@ +all: + gcc -I/usr/include -lpipeline hg-wrapper.c -o hg-wrapper +clean: + rm hg-wrapper + + + +# to build the incorrect cpp version. +#all: +# g++ -I/usr/include hg-wrapper.cpp -o hg-wrapper diff -r 48c7c2099978 -r cd47c42f1d0a src/create-skeleton.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/create-skeleton.sh Wed Jan 09 11:38:31 2013 +0000 @@ -0,0 +1,4 @@ +mkdir -pv /pkg/defaults +ln -sfv $(pwd)/profile /pkg/defaults/.profile +ln -sfv $(pwd)/hg-wrapper /pkg/defaults/.hg-wrapper + diff -r 48c7c2099978 -r cd47c42f1d0a src/hg-wrapper.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hg-wrapper.c Wed Jan 09 11:38:31 2013 +0000 @@ -0,0 +1,16 @@ +#include +#include + +main( int argc, char ** argv){ + pipecmd* p = pipecmd_new("hg"); + + int i; + for(i = 1; i < argc; i++){ + pipecmd_arg(p, argv[i]); + } + + setreuid(geteuid(), geteuid()); + setregid(getegid(), getegid()); + + pipecmd_exec(p); +} diff -r 48c7c2099978 -r cd47c42f1d0a src/hg-wrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hg-wrapper.cpp Wed Jan 09 11:38:31 2013 +0000 @@ -0,0 +1,17 @@ +#include +#include +#include +#include +#include + +/** This a simple wrapper script to call + mercurial as a semi-privleged user. */ + +main( int argc, char ** argv){ + std::vector input(argv, argv+argc); + input[0] = std::string("hg"); + std::string command = boost::algorithm::join(input, " "); + setreuid(geteuid(), geteuid()); + setregid(getegid(), getegid()); + return system(command.c_str()); +} diff -r 48c7c2099978 -r cd47c42f1d0a src/hg-wrapper.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hg-wrapper.pl Wed Jan 09 11:38:31 2013 +0000 @@ -0,0 +1,7 @@ +#!/usr/bin/perl -wT + +$ENV{"PATH"} = "/usr/bin"; +delete @ENV{qw(IFS CDPATH ENV BASH_ENV PATH)}; + +unshift(@ARGV, "hg"); +exec(@ARGV); diff -r 48c7c2099978 -r cd47c42f1d0a src/pkg.pl --- a/src/pkg.pl Wed Jan 09 11:07:14 2013 +0000 +++ b/src/pkg.pl Wed Jan 09 11:38:31 2013 +0000 @@ -51,7 +51,6 @@ exit 1; } - $pkg_home = "$pkg_home_root/$pkg_name"; #set default for $pkg_desc. diff -r 48c7c2099978 -r cd47c42f1d0a src/profile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/profile Wed Jan 09 11:38:31 2013 +0000 @@ -0,0 +1,33 @@ +#!/bin/bash +set +h + +export PATH=\ +"/home/r/system/usr/bin:\ +/sbin/:\ +/bin:\ +/usr/sbin:\ +/usr/bin:\ +/tools/bin" + +alias ls="/usr/bin/env ls --color=auto " +export ls +alias la="ls -la" +export la + +# some personal shortcuts +alias r="reset" +export r +alias sl=ls +export sl +alias l=ls +export l + +colors="/etc/dircolors" +eval $(dircolors -b $colors) +unset colors + +export HGEDITOR="emacs" + +alias hg="~/.hg-wrapper --config ui.username=`whoami`" + +PS1="\[$(tput setaf 3)\][\u \w] % \[$(tput sgr0)\]"