libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1210186 - in /libcloud/trunk: contrib/ contrib/migrate_paths.sh setup.py
Date Sun, 04 Dec 2011 19:33:41 GMT
Author: tomaz
Date: Sun Dec  4 19:33:41 2011
New Revision: 1210186

URL: http://svn.apache.org/viewvc?rev=1210186&view=rev
Log:
Update description in setup.py, add script for migrating from the old style (pre
0.5) paths.

Added:
    libcloud/trunk/contrib/
    libcloud/trunk/contrib/migrate_paths.sh   (with props)
Modified:
    libcloud/trunk/setup.py

Added: libcloud/trunk/contrib/migrate_paths.sh
URL: http://svn.apache.org/viewvc/libcloud/trunk/contrib/migrate_paths.sh?rev=1210186&view=auto
==============================================================================
--- libcloud/trunk/contrib/migrate_paths.sh (added)
+++ libcloud/trunk/contrib/migrate_paths.sh Sun Dec  4 19:33:41 2011
@@ -0,0 +1,65 @@
+#!/bin/bash
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+# Script for migrating from the old style libcloud paths (pre 0.5) to the new
+# ones.
+# THIS SCRIPT WILL MODIFY FILES IN PLACE. BE SURE TO BACKUP THEM BEFORE RUNNING
+# IT. LIBCLOUD TEAM CANNOT BE RESPONSIBLE FOR ANY DAMAGE CAUSED BY THIS SCRIPT.
+# Note: If you are on OS X / FreeBSD, you need to install GNU sed.
+
+DIRECTORY=$1
+
+SED=`which gsed gnused sed`
+
+for value in $SED
+do
+    SED=${value}
+    break
+done
+
+if [ ! $DIRECTORY ]; then
+    echo "Usage: ./migrate_paths.sh <directory with your code>"
+    exit 1
+fi
+
+OLD_PATHS[0]="libcloud.base"
+OLD_PATHS[1]="libcloud.deployment"
+OLD_PATHS[2]="libcloud.drivers"
+OLD_PATHS[3]="libcloud.ssh"
+OLD_PATHS[4]="libcloud.types"
+OLD_PATHS[5]="libcloud.providers"
+
+UPDATED_PATHS[0]="libcloud.compute.base"
+UPDATED_PATHS[1]="libcloud.compute.deployment"
+UPDATED_PATHS[2]="libcloud.compute.drivers"
+UPDATED_PATHS[3]="libcloud.compute.ssh"
+UPDATED_PATHS[4]="libcloud.compute.types"
+UPDATED_PATHS[5]="libcloud.compute.providers"
+
+for (( i = 0 ; i < ${#OLD_PATHS[@]} ; i++ ))
+do
+    old_path=${OLD_PATHS[$i]}
+    new_path=${UPDATED_PATHS[$i]}
+
+    cmd1="find ${DIRECTORY} -name '*.py' -type f -print0 | xargs -0 ${SED} -i -e 's/^from
${old_path} import/from ${new_path} import/g'"
+    cmd2="find ${DIRECTORY} -name '*.py' -type f -print0 | xargs -0 ${SED} -i -e 's/^import
${old_path}/import ${new_path}/g'"
+
+    echo "Migrating: ${old_path} -> ${new_path}"
+    eval "$cmd1"
+    eval "$cmd2"
+done

Propchange: libcloud/trunk/contrib/migrate_paths.sh
------------------------------------------------------------------------------
    svn:executable = *

Modified: libcloud/trunk/setup.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/setup.py?rev=1210186&r1=1210185&r2=1210186&view=diff
==============================================================================
--- libcloud/trunk/setup.py (original)
+++ libcloud/trunk/setup.py Sun Dec  4 19:33:41 2011
@@ -201,7 +201,8 @@ pre_python26 = (sys.version_info[0] == 2
 setup(
     name='apache-libcloud',
     version=read_version_string(),
-    description='A unified interface into many cloud server providers',
+    description='A standard Python library that abstracts away differences' +
+                'among multiple cloud provider APIs',
     author='Apache Software Foundation',
     author_email='dev@libcloud.apache.org',
     requires=([], ['ssl', 'simplejson'],)[pre_python26],



Mime
View raw message