]> gitweb.fluxo.info Git - stowpkg.git/commitdiff
Distinguish between version and source_version
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 18 Sep 2017 20:10:44 +0000 (17:10 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 18 Sep 2017 20:10:44 +0000 (17:10 -0300)
stowpkg

diff --git a/stowpkg b/stowpkg
index 33e5eb63a21c64ed08b9c9ce8a3813ced96989a5..1263045192e28d8c6dab6240c031a177a1eda2d8 100755 (executable)
--- a/stowpkg
+++ b/stowpkg
@@ -123,6 +123,12 @@ stowpkg_install () {
     version="latest"
   fi
 
+  if [ "$source_format" = "git" ]; then
+    source_version="git"
+  else
+    source_version="$version"
+  fi
+
   # Resolve default dependencies
   if [ ! -z "$dependencies_stowpkg" ]; then
     for dependency in $dependencies_stowpkg; do
@@ -141,19 +147,20 @@ stowpkg_install () {
   cd $SOURCES
 
   # Download sources if needed
-  if [ ! -d "${package}-${version}" ]; then
+  if [ ! -d "${package}-${source_version}" ]; then
     if [ "$source_format" = "git" ]; then
-      git clone $url ${package}-${version}
+      git clone $url ${package}-${source_version}
     fi
   fi
 
-  # Go to source folder
-  if [ ! -d "${package}-${version}" ]; then
+  # Check source
+  if [ ! -d "${package}-${source_version}" ]; then
     echo "$BASENAME: source not found for package $package"
     exit 1
   fi
 
-  cd ${package}-${version}
+  # Go to source folder
+  cd ${package}-${source_version}
 
   if [ "$source_format" = "git" ]; then
     git fetch --all