Commits

Shlomi Fish committed 5be0aa0

Add the common aliases

  • Participants
  • Parent commits ebfd40e

Comments (0)

Files changed (5)

shlomif-settings/bash-aliases/common_aliases.bash

+alias screen='screen -e "^^6"'
+
+_sys()
+{
+    echo "$@"
+    "$@"
+}
+
+u()
+{
+    local common_args
+    common_args="--auto --keep --resume --noclean"
+    if test -n "$PROZ" ; then
+        common_args+=" --downloader prozilla --prozilla-options '-k=${PROZ_N:-15} -r'"
+    else
+        common_args+=" --downloader wget --wget-options -c"
+    fi
+    cmd="_sys sudo urpmi"
+    ( cd $HOME ;
+    if test "$#" -eq 0 ; then
+        eval "$cmd $common_args --auto-select";
+    else
+        eval "$cmd $common_args $@";
+    fi
+    )
+}
+
+uu()
+{
+    (cd $HOME ; sudo urpmi.update -a)
+}
+
+up()
+{
+    sudo urpmi --auto $(perlmf as_rpm_colon "$@")
+}
+
+function _cpan_d_format()
+{
+    (
+    if test -e /etc/mageia-release ; then
+        echo "CPANPLUS::Dist::Mageia"
+    else
+        echo "CPANPLUS::Dist::Mdv"
+    fi
+    )
+}
+
+function c()
+{
+    sudo cpan2dist --verbose --format="$(_cpan_d_format)" \
+        --defaults --install --timeout 0 $(perlmf as_colon "$@")
+}
+
+function qp()
+{
+    local pm="$1"
+    shift
+
+    urpmq --whatprovides "$(perlmf as_rpm_colon "$pm")" ;
+}
+
+function pap()
+{
+    sudo apt-get install $(perlmf as_deb "$@");
+}
+
+e()
+{
+    sudo urpme "$@"
+}
+
+# urpme orphans.
+eo()
+{
+    e --auto-orphans
+}
+
+alias q='urpmq --fuzzy -a'
+alias qv='q --sources'
+

shlomif-settings/bash-aliases/install-by-root

 #!/bin/bash
 cp -f "$(dirname "$0")"/root_aliases ~/.shlomif_root_aliases
+cp -f "$(dirname "$0")"/common_aliases.bash ~/.common_aliases.bash
 if ! grep -q -F 'source ~/.shlomif_root_aliases' ~/.aliases; then
     echo $'\nsource ~/.shlomif_root_aliases' >> ~/.aliases
 fi

shlomif-settings/bash-aliases/root_aliases

 #!/bin/bash
 
-# For GNU screen to use a different key-binding
-alias screen='screen -e "^^6"'
-
-_sys()
-{
-    echo "$@"
-    "$@"
-}
-
-u()
-{
-    local common_args
-    common_args="--auto --keep --resume --noclean"
-    if test -n "$PROZ" ; then
-        common_args+=" --downloader prozilla --prozilla-options '-k=${PROZ_N:-15} -r'"
-    else
-        common_args+=" --downloader wget --wget-options -c"
-    fi
-    ( cd $HOME ;
-    if test "$#" -eq 0 ; then
-        eval "_sys urpmi $common_args --auto-select";
-    else
-        eval "_sys urpmi $common_args $@";
-    fi
-    )
-}
-
-uu()
-{
-    (cd $HOME ; urpmi.update -a)
-}
-
-wu()
-{
-    while ! u ; do true ; done
-}
-
-up()
-{
-    urpmi --auto $(perlmf as_rpm_colon "$@")
-}
-
-function _cpan_d_format()
-{
-    (
-    if test -e /etc/mageia-release ; then
-        echo "CPANPLUS::Dist::Mageia"
-    else
-        echo "CPANPLUS::Dist::Mdv"
-    fi
-    )
-}
-
-function c()
-{
-    cpan2dist --verbose --format="$(_cpan_d_format)" \
-        --defaults --install --timeout 0 $(perlmf as_colon "$@")
-}
-
-function qp()
-{
-    local pm="$1"
-    shift
-
-    urpmq --whatprovides "$(perlmf as_rpm_colon "$pm")" ;
-}
-
+source "$HOME/.common_aliases.bash"
 function cp_to_shlomif()
 {
     local dest src
     done
 }
 
-function pap()
-{
-    apt-get install $(perlmf as_deb "$@");
-}
-
-e()
-{
-    urpme "$@"
-}
-
-# urpme orphans.
-eo()
-{
-    e --auto-orphans
-}
-
-alias q='urpmq --fuzzy -a'
-alias qv='q --sources'
-
 clear_rpm_cache()
 {
     rm -f /var/cache/urpmi/{partial,rpms}/*

shlomif-settings/bash-aliases/user_aliases.bash

-alias q='urpmq --fuzzy -a'
+source "$HOME/.common_aliases.bash"
 alias myrsync='rsync -a --progress -v --inplace'
 
 dc()

shlomif-settings/bash-aliases/user_aliases_bootstrap.bash

 _reread_aliases()
 {
+    if ! test -f ~/.common_aliases.bash ; then
+        cp -f ~/conf/trunk/shlomif-settings/bash-aliases/common_aliases.bash ~/.common_aliases.bash
+    fi
     source ~/conf/trunk/shlomif-settings/bash-aliases/user_aliases.bash
 }
 _reread_aliases