#!/bin/bash ################################################## # Imports ################################################## if [ "$goboCrossCompiling" ] then unset goboCrossCompiling unset goboPrefix fi . ScriptFunctions Import OptionParser Import File Import GoboLinux Import Compile ################################################## # Options and configuration ################################################## Parse_Conf Compile.conf helpOnNoArguments=yes scriptDescription="Fetch a recipe and place it in $compileLocalRecipesDir, chopping its revision number. Calls a text editor on the Recipe file afterwards." scriptCredits="(C) 2006 Andre Detsch. Released under the GNU GPL." scriptUsage="[|| [program-version]]" Add_Option_Boolean "E" "no-edit" "Do not edit Recipe file, just place the recipe to $compileLocalRecipesDir." Parse_Options "$@" ################################################## # Prepare Environment ################################################## recipe=`GetRecipe $(Arg 1) $(Arg 2)` || Die "Error while getting recipe." Log_Normal "Got $recipe" if Starts_With "$compileLocalRecipesDir" "$recipe" then localrecipe=$recipe else p=`Get_Token $recipe '/' '-2'` vr=`Get_Token $recipe '/' '-1'` v=`String_Version $vr` localrecipe="$compileLocalRecipesDir/$p/$v" mkdir -p "$compileLocalRecipesDir/$p" [ -e "$localrecipe" ] && Die "$localrecipe already exists. This is a bug." cp -a $recipe "$localrecipe" Log_Normal "Placed recipe at $localrecipe for editing." fi if Boolean "no-edit" then echo $localrecipe else [ "$EDITOR" ] || Die 'Please set your \$EDITOR variable using `export EDITOR='...'`.' $EDITOR "$localrecipe/Recipe" fi