[pacman-dev] abs script changes

Dan McGee dpmcgee at gmail.com
Thu Dec 21 17:37:53 EST 2006


I don't think I can look at a whole lot without wanting to change/fix
the code. Some changes on the abs script:
1. Remove old update function, and patch new one as needed.
2. Remove extra $ABSROOT directory check
3. Remove duplicate (and I believe unnecessary?) block of code to
check for passive mode flag. This double code is actually in the
current abs code, is there a reason? Also added a to-do note, let me
know what you think.

-Dan

Index: abs
===================================================================
RCS file: /home/cvs-pacman/pacman-lib/scripts/abs,v
retrieving revision 1.2
diff -u -r1.2 abs
--- abs 21 Dec 2006 01:53:41 -0000      1.2
+++ abs 21 Dec 2006 22:32:59 -0000
@@ -18,27 +18,17 @@
        for sup in "${SUPFILES[@]}"; do
                if [ "$sup" != "testing" ]; then
                        if [ "$sup" = "${sup#!}" ]; then
-                               cvsup -L 1 -r 0 -g -b $ABSROOT -c .sup
/etc/abs/supfile.$sup
+                               $CVSUP -L 1 -r 0 -g -b $ABSROOT -P
$CONNMODE -c .sup /etc/abs/supfile.$sup
                        fi
                elif [ "$sup" = "testing" ]; then
                        if [ ! -d /var/abs/testing ]; then
                                mkdir /var/abs/testing;
                        fi
                        cd $ABSROOT/testing
-                       cvsup -L 1 -r 0 -g -b $ABSROOT/testing -c .sup
/etc/abs/supfile.testing
+                       $CVSUP -L 1 -r 0 -g -b $ABSROOT/testing -P
$CONNMODE -c .sup /etc/abs/supfile.testing
                        cd $ABSROOT
                fi
        done
-}
-
-
-update() {
-       cd $ABSROOT
-       for sup in "${SUPFILES[@]}"; do
-               if [ "$sup" = "${sup#!}" ]; then
-                       $CVSUP -L 1 -r 0 -g -b $ABSROOT -P $CONNMODE
-c .sup /etc/abs/supfile.$sup
-               fi
-       done
 }

 if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
@@ -46,11 +36,12 @@
        exit 0
 fi

-if [ ! -d $ABSROOT ]; then
+if [ ! -d "$ABSROOT" ]; then
        echo "abs: $ABSROOT does not exist (or is not a directory)"
        exit 1
 fi
-if [ ! -w $ABSROOT ]; then
+
+if [ ! -w "$ABSROOT" ]; then
        echo "abs: no write permissions in $ABSROOT"
        exit 1
 fi
@@ -64,24 +55,12 @@
        exit 1
 fi

-if [ ! -d "$ABSROOT" ]; then
-       echo "abs: directory $ABSROOT does not exist"
-       exit 1
-fi
-
-if [ "$1" = "-p" ] || [ "$1" = "--passive" ]; then
-       CONNMODE="-"
-       shift
-else
-       CONNMODE="m"
-       shift
-fi
-
 if [ "$1" = "-p" ] || [ "$1" = "--passive" ]; then
        CONNMODE="-"
        shift
 else
        CONNMODE="m"
+       #TODO: do we want to shift if this argument was not present?
        shift
 fi




More information about the pacman-dev mailing list