[boinc] 04/09: new apps hierarchy, arbirary package names

Steffen Möller moeller at alioth.debian.org
Tue Nov 5 09:31:24 UTC 2013


This is an automated email from the git hooks/post-receive script.

moeller pushed a commit to branch master
in repository boinc.

commit 5f73ce99d033972d8005f0c307fb6523210084e9
Author: Steffen Moeller <steffen_moeller at gmx.de>
Date:   Wed Oct 2 15:28:13 2013 +0200

    new apps hierarchy, arbirary package names
    
    Christian Beer kindly contributed the update of the
    hierarchy in the apps folder. Steffen made second
    stage inroads towards allowing all package names.
---
 debian/fetch_example_applications.sh |   67 +++++++++++++++++++++++++---------
 1 file changed, 49 insertions(+), 18 deletions(-)

diff --git a/debian/fetch_example_applications.sh b/debian/fetch_example_applications.sh
index 9efea8e..cbb8053 100755
--- a/debian/fetch_example_applications.sh
+++ b/debian/fetch_example_applications.sh
@@ -7,6 +7,7 @@
 # This script is released under the same license
 # as BOINC, created and copyright by
 # Steffen Moeller <moeller at debian.org>
+# with contributions by Christian Beer <djangofett at gmx.net>.
 
 set -e
 
@@ -18,12 +19,18 @@ Usage: $0 [<boinc project root dir>|--help]
   This script collects the binaries for multiple platforms of a Debian
   package.  All parameters are specified by environment variables.
 
-    installroot      path to install directory that together with the
-    fileprojectname  defines the project's root directory.
-    packagename      determines the name of the Debian package to install
+    installroot        path to install directory that together with the
+    projectname        defines the project's root directory.
+    packagename        determines the name of the Debian package to install
 
   Optional:
-    version          what version exactly shall be installed
+    version            what version exactly shall be installed
+    sourcepackagename  name of source package from which binary is produced,
+                       autoretrieved by 'apt-cache show \$packagename'
+    downloaddir        directory into which the Debian packages are downloaded,
+                       defaults to 'collection'
+    appsdir            directory to harbor unpackaged binaries and project
+                       signatures, defaults to '\$projectroot/apps'
 
   If the packagename is not specified, then it defaults to
   boinc-app-examples.
@@ -54,17 +61,29 @@ fi
 
 version=$(apt-cache show $packagename | grep ^Version | tail -1 | cut -f2 -d\  )
 if [ -z "$version" ]; then
-	echo "apt-cache does not know any version for package '$packagename'."
+	echo "E: apt-cache does not know any version for package '$packagename'."
 	exit 1
 fi
 
+if [ -z "$sourcepackagename" ]; then
+	sourcepackagename=$(apt-cache show $packagename|grep ^Source:|sort -u|cut -f2 -d\ |head -n 1)
+	if [ -z "$sourcepackagename" ]; then
+		echo "I: Could not determine source package name of '$packagename'"
+		exit 1
+	else
+		echo "I: Determined source package of '$packagename' as '$sourcepackagename'"
+	fi
+fi
+# first letter or libL to constrain download directory
+spn=$(echo $sourcepackagename|sed -e 's/^\(lib.\|.\).*/\1/')
+
 if [ -n "$1" ]; then
 	projectroot=$1
 elif [ -z "$projectroot" ]; then
-	if [ -n "$installroot" -a -n "$fileprojectname" ]; then
-		projectroot="$installroot/$fileprojectname"
+	if [ -n "$installroot" -a -n "$projectname" ]; then
+		projectroot="$installroot/$projectname"
 	else
-		echo "Please specify the project root directory."
+		echo "E: Please specify the project root directory via the 'projectroot' environment variable."
 		exit 1
 	fi
 fi
@@ -74,11 +93,22 @@ key="$projectroot/keys/code_sign_private"
 
 shortver=$(echo $version|cut -d . -f-2)
 
-appsdir="apps"
-downloaddir="collection"
+if [ -z "$appsdir" ]; then
+	if [ -d "$projectroot/apps" ]; then
+		echo "W: 'appsdir' not specified, chose '\$projectroot/apps'."
+		appsdir="$projectroot/apps"
+	else
+		echo "W: 'appsdir' not specified, and no apps directory in \$projectroot, decided for 'apps'.".
+		appsdir="apps"
+	fi
+fi
 
-if [ -d "$appsdir"]; then
-	echo "Directory '$appsdir' is already existing. Please clean this up first."
+if [ -z "$downloaddir" ]; then
+	downloaddir="collection"
+fi
+
+if [ -d "$appsdir" ]; then
+	echo "E: Directory '$appsdir' is already existing. Please clean this up first."
 	exit
 fi
 
@@ -93,7 +123,7 @@ do
   fi
 
   if [ ! -r $arch.deb ]; then 
-    url="$mirror/pool/main/b/boinc/boinc-app-examples_${version}_${arch}.deb"
+    url="$mirror/pool/main/${spn}/${sourcepackagename}/${packagename}_${version}_${arch}.deb"
     if ! wget --quiet -O - $url > ${arch}.deb ; then
        echo "E: Platform '$arch' failed to download .... skipping."
        rm -f ${arch}.deb
@@ -118,7 +148,7 @@ then
     exit
 fi
 
-echo "Creating directories for all applications in folder '$downloaddir' now in folder '$appsdir'."
+echo "I: Creating directories for all applications in folder '$downloaddir' now in folder '$appsdir'."
 for f in `find collection -type f | xargs -r -l basename| sort -u`
 do
     appname=`echo $f|cut -d / -f3`
@@ -134,14 +164,16 @@ do
     do 
 	archname=$(echo $folder|cut -d / -f2)
         echo -n " $archname"
-	#echo Copying $folder/$appname $appsdir/$appname/${appname}_${shortver}_${deb2boinc[$archname]}
-	cp $folder/$appname $appsdir/$appname/${appname}_${shortver}_${deb2boinc[$archname]}
+	#echo Creating new apps directory structure
+	mkdir -p $appsdir/$appname/${shortver}/${deb2boinc[$archname]}
+	#echo Copying $folder/$appname $appsdir/$appname/${shortver}/${deb2boinc[$archname]}/${appname}_${shortver}_${deb2boinc[$archname]}
+	cp $folder/$appname $appsdir/$appname/${shortver}/${deb2boinc[$archname]}/${appname}_${shortver}_${deb2boinc[$archname]}
     done
     echo
 done
 
 if [ ! -x "$sign" ]; then
-	echo "I: You need to sign the applictions, still. This is to be performed specifically for your project."
+	echo "I: You need to sign the applications, still. This is to be performed specifically for your project."
 	cat <<EOINSTRUCTIONS
    Follow the following scheme:
      sign="\$projectroot/bin/sign_executable"
@@ -158,4 +190,3 @@ else
 	    $sign $binary $key > ${binary}.sig
 	done
 fi
-

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-boinc/boinc.git



More information about the pkg-boinc-commits mailing list