% !TEX root = BuildWithGBP.nw% ===> this file was generated automatically by noweave --- better not edit it
\part{Publishing} \chapter{Preparation to upload the package} \label{chap:Uploading} 

So far, we have been busy building a \texttt{Debian} package on our machine, as also provided by the \texttt{Debian} project.  

Nun geht es darum, dass dieses Paket auch hochgeladen \index{Uploading} und damit dem \texttt{Debian}-Projekt zur Verfügung gestellt werden kann. 

Die Vorbereitung erfolgt durch die Funktion \textit{PrepareUploading}. 

\section{Does \textit{debian/changelog} exist?} 

To be on the safe side, it checks if a file \textit{debian/changelog} already exists.  

If this file exists, it is displayed for checking whether it is ready for publication.  

\nwfilename{Part4.nw}\nwbegincode{1}\sublabel{NW4N9Oy2-2h4AeG-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-2h4AeG-1}}}\moddef{PrepareUploading~{\nwtagstyle{}\subpageref{NW4N9Oy2-2h4AeG-1}}}\endmoddef\nwstartdeflinemarkup\nwenddeflinemarkup 
function PrepareUploading \{ 
    # Called by TaskSelect  

    cd $\{GitPath\} 

    # Check debian/changelog 
    if [ -f debian/changelog ] 
    then 
        less --LINE-NUMBERS debian/changelog 
    else 
\LA{}PrepareUploading1~{\nwtagstyle{}\subpageref{NW4N9Oy2-4J30By-1}}\RA{} \nwnotused{PrepareUploading}\nwendcode{}\nwbegindocs{2}\nwdocspar 

If this file does not exist, the program script terminates at this point with a corresponding message.  

\nwenddocs{}\nwbegincode{3}\sublabel{NW4N9Oy2-4J30By-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-4J30By-1}}}\moddef{PrepareUploading1~{\nwtagstyle{}\subpageref{NW4N9Oy2-4J30By-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-2h4AeG-1}}\nwenddeflinemarkup 
        whiptail --title "This is the end" \\ 
        --msgbox "No changelog - no upload!" 15 60 
        exit 
    fi 
 

\LA{}PrepareUploading2~{\nwtagstyle{}\subpageref{NW4N9Oy2-1qKoDG-1}}\RA{} \nwused{\\{NW4N9Oy2-2h4AeG-1}}\nwendcode{}\nwbegindocs{4}\nwdocspar 

\begin{figure}[h] \centering

\includegraphics[width=30em,height=30ex]{Pictures/NoChangelog.png} \caption{No Changelog - No upload} \end{figure} 

If this file does not exist, the program script terminates at this point with a corresponding message.  

\nwenddocs{}\nwbegincode{5}\sublabel{NW4N9Oy2-1qKoDG-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-1qKoDG-1}}}\moddef{PrepareUploading2~{\nwtagstyle{}\subpageref{NW4N9Oy2-1qKoDG-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-4J30By-1}}\nwenddeflinemarkup 
    if ! whiptail --title "Changelog fit for publishing?" --defaultno \\ 
    --yesno "Is the changelog fit for publishing?" --yes-button "Yes" \\ 
    --no-button "No" 15 60 
\LA{}PrepareUploading3~{\nwtagstyle{}\subpageref{NW4N9Oy2-2fQbcs-1}}\RA{} \nwused{\\{NW4N9Oy2-4J30By-1}}\nwendcode{}\nwbegindocs{6}\nwdocspar 

\begin{figure}[h] \centering

\includegraphics[width=30em,height=30ex]{Pictures/ChangelogFitForPublishing.png} \caption{Changelog fir for uploading?} \end{figure} 

If the answer is yes, the option to build the package again is opened (chapter \ref{sec:BuildAgain}, page \pageref{sec:BuildAgain}).  

\section{\textit{debian/changelog} finisg} 

If the \textit{debian/changelog} file is not ready for release, it is improved.  

To do this, it first prompts to check if you are in the correct \texttt{Git} branch. The \textit{AskDist} function (chapter \ref{subsec:IdentifyDist}, page \pageref{subsec:IdentifyDist}) is used to determine which is the current \texttt{Git} branch and which distribution is assigned to it.  

After that, the result is displayed. If necessary, the branch can be changed in another terminal.  

\nwenddocs{}\nwbegincode{7}\sublabel{NW4N9Oy2-2fQbcs-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-2fQbcs-1}}}\moddef{PrepareUploading3~{\nwtagstyle{}\subpageref{NW4N9Oy2-2fQbcs-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-1qKoDG-1}}\nwenddeflinemarkup 
    then 
        AskDist 
        echo -e "Notice from PrepareUploading: The branch is "$\{RecentBranch\}"\\n \\ 
        The distribution is "$\{RecentBranchD\} >> $\{log\} 
        whiptail --title "Please check! (U)" \\ 
        --msgbox "The branch is $\{RecentBranch\}" 15 60
\LA{}PrepareUploading4~{\nwtagstyle{}\subpageref{NW4N9Oy2-eFVGQ-1}}\RA{} \nwused{\\{NW4N9Oy2-1qKoDG-1}}\nwendcode{}\nwbegindocs{8}\nwdocspar 

\begin{figure}[h] \centering

\includegraphics[width=30em,height=30ex]{Pictures/CheckBranch.png} \caption{Check branch} \end{figure} 

Then, if necessary, specify the name of the distribution where the built \texttt{Debian} package should be uploaded. Usually this is the \textit{unstable} distribution.   

\nwenddocs{}\nwbegincode{9}\sublabel{NW4N9Oy2-eFVGQ-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-eFVGQ-1}}}\moddef{PrepareUploading4~{\nwtagstyle{}\subpageref{NW4N9Oy2-eFVGQ-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-2fQbcs-1}}\nwenddeflinemarkup 

        if [ "$\{RecentBranchD\}" = "sid" ] 
        then 
            distName="unstable" 
        elif [ "$\{RecentBranchD\}" = "experimental" ] 
        then 
            distName="experimental" 
        else 
            distName=$(whiptail --title "Name of the distribution" \\ 
            --inputbox "Please insert the name of the distribution\\n \\ 
            specified in the changelog" \\ 
            --cancel-button "Cancel" 15 60 3>&2 2>&1 1>&3) 
        fi 
\LA{}PrepareUploading5~{\nwtagstyle{}\subpageref{NW4N9Oy2-3vUIOc-1}}\RA{} \nwused{\\{NW4N9Oy2-2fQbcs-1}}\nwendcode{}\nwbegindocs{10}\nwdocspar 

\begin{figure}[h] \centering

\includegraphics[width=30em,height=30ex]{Pictures/NameOfDistribution.png} \caption{Enter the name of the distribution} \end{figure} 


If no name is entered, \textit{unstable} is assumed to be the distribution. .  

Then the name of the distribution is displayed again with the request to check.   

\nwenddocs{}\nwbegincode{11}\sublabel{NW4N9Oy2-3vUIOc-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-3vUIOc-1}}}\moddef{PrepareUploading5~{\nwtagstyle{}\subpageref{NW4N9Oy2-3vUIOc-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-eFVGQ-1}}\nwenddeflinemarkup 
        if [ -z "$\{distName\}" ] 
        then 
            distName="unstable" 
        fi
 

        echo -e "Another notice from PrepareUploading:\\n \\ 
        The distribution is now "$\{distName\} >> $\{log\} 
        whiptail --title "Please check! (U)" \\ 
        --msgbox "The distribution is $\{distName\}" 15 60
 \LA{}PrepareUploading6~{\nwtagstyle{}\subpageref{NW4N9Oy2-1e83cU-1}}\RA{} \nwused{\\{NW4N9Oy2-eFVGQ-1}}\nwendcode{}\nwbegindocs{12}\nwdocspar 

\begin{figure}[h] \centering

\includegraphics[width=30em,height=30ex]{Pictures/CheckDistName.png} \caption{Check distribution name} \end{figure} 

Especially for new packages, authors like to use an upload to \textit{experimental}. This is because a \textit{binary} upload is required for new packages.  

\nwenddocs{}\nwbegincode{13}\sublabel{NW4N9Oy2-1e83cU-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-1e83cU-1}}}\moddef{PrepareUploading6~{\nwtagstyle{}\subpageref{NW4N9Oy2-1e83cU-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-3vUIOc-1}}\nwenddeflinemarkup 

        # making debian/changelog fit for publishing 
        gbp dch --release --verbose --debian-branch=$\{RecentBranch\} \\ 
        --distribution=$\{distName\} #--commit
\LA{}PrepareUploading8~{\nwtagstyle{}\subpageref{NW4N9Oy2-eScQ-1}}\RA{} \nwused{\\{NW4N9Oy2-3vUIOc-1}}\nwendcode{}\nwbegindocs{14}\nwdocspar 

After creating the changelog for the release, the standard editor is automatically opened for checking. This cannot be influenced by the script.  

This display is also useful. Often there are duplicate commit entries to be deleted.   

\nwenddocs{}\nwbegincode{15}\sublabel{NW4N9Oy2-eScQ-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-eScQ-1}}}\moddef{PrepareUploading8~{\nwtagstyle{}\subpageref{NW4N9Oy2-eScQ-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-1e83cU-1}}\nwenddeflinemarkup 
        git add . 
        git commit -a  

        whiptail --title "Build again" \\ 
        --msgbox "Now the release will be built another time." 15 60 
 

\LA{}PrepareUploading10~{\nwtagstyle{}\subpageref{NW4N9Oy2-1eblsS-1}}\RA{} \nwused{\\{NW4N9Oy2-1e83cU-1}}\nwendcode{}\nwbegindocs{16}\nwdocspar 

\begin{figure}[h] \centering

\includegraphics[width=30em,height=30ex]{Pictures/BuildAgain.png} \caption{Building for release} \end{figure} 

Now the package is built for upload to the \texttt{Debian} repository.  

To do this, the \textit{PBuilder}Chroot is updated again (chapter \ref{subsec:GitPBuilderUpdate}, page \pageref{subsec:GitPBuilderUpdate}).  

\nwenddocs{}\nwbegincode{17}\sublabel{NW4N9Oy2-1eblsS-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-1eblsS-1}}}\moddef{PrepareUploading10~{\nwtagstyle{}\subpageref{NW4N9Oy2-1eblsS-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-eScQ-1}}\nwenddeflinemarkup 
        # Building revision 
        DIST=$\{RecentBranchD\} git-pbuilder update 
        GpgKeyAvailable 
 

\LA{}PrepareUploading11~{\nwtagstyle{}\subpageref{NW4N9Oy2-3D7O6O-1}}\RA{} \nwused{\\{NW4N9Oy2-eScQ-1}}\nwendcode{}\nwbegindocs{18}\nwdocspar 

The first step is to make sure that the options from the \textit{ForceOrig} function (chapter \ref{subsec: PBuilderOptions}, page \pageref{subsec: PBuilderOptions}) are set.  

\nwenddocs{}\nwbegincode{19}\sublabel{NW4N9Oy2-3D7O6O-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-3D7O6O-1}}}\moddef{PrepareUploading11~{\nwtagstyle{}\subpageref{NW4N9Oy2-3D7O6O-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-1eblsS-1}}\nwenddeflinemarkup 
        if [ $\{OptFlag\} -ne 1 ] 
        then 
            ForceOrig  

\LA{}PrepareUploading12~{\nwtagstyle{}\subpageref{NW4N9Oy2-bK1xc-1}}\RA{} \nwused{\\{NW4N9Oy2-1eblsS-1}}\nwendcode{}\nwbegindocs{20}\nwdocspar 

Also, the user is given the opportunity to add more options for \textit{gbp buildpackage.} 

\nwenddocs{}\nwbegincode{21}\sublabel{NW4N9Oy2-bK1xc-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-bK1xc-1}}}\moddef{PrepareUploading12~{\nwtagstyle{}\subpageref{NW4N9Oy2-bK1xc-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-3D7O6O-1}}\nwenddeflinemarkup 
            normalOpts="--git-debian-branch="$\{RecentBranch\}" \\ 
            --git-dist="$\{RecentBranchD\}" --git-verbose --git-tag \\ 
            --git-sign-tags"$\{pbuilderOpt\} MoreOptions fi  

\LA{}PrepareUploading15~{\nwtagstyle{}\subpageref{NW4N9Oy2-2fuJsq-1}}\RA{} \nwused{\\{NW4N9Oy2-3D7O6O-1}}\nwendcode{}\nwbegindocs{22}\nwdocspar 

Now the actual build process takes place. This is necessary because the \textit{debian/changelog} file has been changed and must therefore be integrated again.  

\nwenddocs{}\nwbegincode{23}\sublabel{NW4N9Oy2-2fuJsq-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-2fuJsq-1}}}\moddef{PrepareUploading15~{\nwtagstyle{}\subpageref{NW4N9Oy2-2fuJsq-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-bK1xc-1}}\nwenddeflinemarkup 
        gbp buildpackage --git-debian-branch=$\{RecentBranch\} \\ 
        --git-dist=$\{RecentBranchD\} --git-verbose --git-tag \\ 
        --git-sign-tags$\{pbuilderOpt\}$\{moreOpts\} 
        echo "Package $\{SourceName\} was built using gbp buildpackage." >> $\{log\}
\LA{}PrepareUploading16~{\nwtagstyle{}\subpageref{NW4N9Oy2-XdFGm-1}}\RA{} \nwused{\\{NW4N9Oy2-bK1xc-1}}\nwendcode{}\nwbegindocs{24}\nwdocspar 

\section{Building again?} \label{sec:BuildAgain} 

Here it continues if the question is answered in the affirmative whether the file \textit{debian/changelog} is ready for release. Then the option is opened to build the package again.  

Building is then done in the manner just described.  

\nwenddocs{}\nwbegincode{25}\sublabel{NW4N9Oy2-XdFGm-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-XdFGm-1}}}\moddef{PrepareUploading16~{\nwtagstyle{}\subpageref{NW4N9Oy2-XdFGm-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-2fuJsq-1}}\nwenddeflinemarkup 
    else 
        if whiptail --title "Building another time?" \\ 
        --yesno "Should the release be build another time?\\n(Without tagging)" \\ 
        --yes-button "Yes" --no-button "No" 15 60
\LA{}PrepareUploading20~{\nwtagstyle{}\subpageref{NW4N9Oy2-1f6yvc-1}}\RA{} \nwused{\\{NW4N9Oy2-2fuJsq-1}}\nwendcode{}\nwbegindocs{26}\nwdocspar 

\begin{figure}[h] \centering

\includegraphics[width=30em,height=30ex]{Pictures/BuildAgain.png} \caption{Building for release} \end{figure} 

\nwenddocs{}\nwbegincode{27}\sublabel{NW4N9Oy2-1f6yvc-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-1f6yvc-1}}}\moddef{PrepareUploading20~{\nwtagstyle{}\subpageref{NW4N9Oy2-1f6yvc-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-XdFGm-1}}\nwenddeflinemarkup 
        then 
            # Building revision DIST=$\{RecentBranchD\} git-pbuilder update  

            if [ $\{OptFlag\} -ne 1 ] 
            then 
                ForceOrig  

                normalOpts="--git-debian-branch="$\{RecentBranch\}" \\ 
                --git-dist="$\{RecentBranchD\}" --git-verbose"$\{pbuilderOpt\} 
                MoreOptions
            fi  

            gbp buildpackage --git-debian-branch=$\{RecentBranch\} \\ 
            --git-dist=$\{RecentBranchD\} --git-verbose$\{pbuilderOpt\}$\{moreOpts\} 
            echo "Package $\{SourceName\} was built using gbp buildpackage." >> $\{log\} 
       fi 
    fi
 \} 

\LA{}SelectUploadTarget~{\nwtagstyle{}\subpageref{NW4N9Oy2-44n7uC-1}}\RA{} \nwused{\\{NW4N9Oy2-XdFGm-1}}\nwendcode{}\nwbegindocs{28}\nwdocspar 

\chapter{Upload to Git repositories} 

The following section from the task selection first calls the functions to upload to the Git repositories.  

\nwenddocs{}\nwbegincode{29}\sublabel{NW4N9Oy2-47oStO-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-47oStO-1}}}\moddef{TaskSelect9~{\nwtagstyle{}\subpageref{NW4N9Oy2-47oStO-1}}}\endmoddef\nwstartdeflinemarkup\nwenddeflinemarkup 
    if [ $\{rcts\} -eq 0 ] 
    then 
        ##############  

        # Pushing git repo  

        ##############  

    Upload2OwnServer 
    Upload2Salsa 

\LA{}TaskSelect10~{\nwtagstyle{}\subpageref{NW4N9Oy2-1qX7nC-1}}\RA{} \nwnotused{TaskSelect9}\nwendcode{}\nwbegindocs{30}\nwdocspar 

\section{Upload to salsa.debian.org} \label{sec:SalsaHochladen} 

Before uploading to \textit{salsa.debian.org}, the program script checks whether there is already an appropriate repository there.  

\nwenddocs{}\nwbegincode{31}\sublabel{NW4N9Oy2-3M9mGy-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-3M9mGy-1}}}\moddef{Upload2Salsa~{\nwtagstyle{}\subpageref{NW4N9Oy2-3M9mGy-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-1xqyce-1}}\nwenddeflinemarkup 
function Upload2Salsa \{ 
    # Called by TaskSelect and itself  

    # Uploading to Salsa 

     if whiptail --title "Upload to salsa.debian.org?" \\ 
     --yesno "Should $\{SourceName\} be uploaded to Salsa?" \\ 
     --yes-button "Yes" --no-button "No" 15 60 
     then 
         BrowserName=$(echo $\{SalsaName\} | sed --expression='s/.git$//g') 
         BrowserName="https://salsa.debian.org/"$\{BrowserName\} 
         wget --spider --verbose --max-redirect=0 \\ 
         --append-output=$\{log\} $\{BrowserName\} 
         if [ $? -ne 0 ] 
         then 
             whiptail --title "No project found at salsa.debian.org" \\ 
             --msgbox "Please create $\{BrowserName\} first" 15 60 
             echo "No project "$\{BrowserName\}" found at salsa.debian.org" \\ 
             >> $\{log\} 

            if whiptail --title "Done?" \\ 
            --yesno "Created $\{BrowserName\} on salsa.debian.org?" \\ 
            --yes-button "Yes" --no-button "No" 15 60 
            then 
                  Upload2Salsa 
            else 
                exit 
            fi
        else 
\LA{}Upload2Salsa5~{\nwtagstyle{}\subpageref{NW4N9Oy2-4SzZ52-1}}\RA{} \nwused{\\{NW4N9Oy2-1xqyce-1}}\nwendcode{}\nwbegindocs{32}\nwdocspar 

If patch queue branches exist, they can be deleted before uploading to \textit{salsa.debian.org}. 

\nwenddocs{}\nwbegincode{33}\sublabel{NW4N9Oy2-4SzZ52-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-4SzZ52-1}}}\moddef{Upload2Salsa5~{\nwtagstyle{}\subpageref{NW4N9Oy2-4SzZ52-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-3M9mGy-1}}\nwenddeflinemarkup 
             if echo $(git branch) | grep --quiet 'patch-queue/' 
             then
                 if whiptail --title "Patch queue branches found:" \\ 
                 --yesno "$(git branch | grep 'patch-queue')\\n \\ 
                 Delete all patch-queue branches?" \\ 
                 --yes-button "Yes" --no-button "No" 15 60 
                 then 
                     git branch --delete --force \\ 
                     $(git branch | grep 'patch-queue') 
                 fi 
             fi 
             if ! whiptail --title "Last stop before upload!" \\ 
             --yesno "Anything all right?" \\ 
             --yes-button "Yes" --no-button "No" 15 60 
             then
                 exit 
             fi 
             if git remote | grep 'salsa' > /dev/null 
             then 
                 RepoName="salsa" 
             else 
                 RepoA=($(git remote))  

                 i=0; slct='' 
                 for element in $\{RepoA[*]\} 
                 do 
                    slct=$slct' '$i' '$\{element\}' off ' 
                    i=$(expr $i + 1) 
                 done  

                 RepoNr=$(whiptail --title "Select repository" \\ 
                 --radiolist "Select one of these repositories" \\ 
                 --cancel-button "Exit" 15 60 8 \\ 
                 $slct 3>&2 2>&1 1>&3) 

                if [ -z "$\{RepoNr\}" ] 
                then 
                    exit 
                else 
                     RepoName=$\{RepoA[$\{RepoNr\}]\} 
                fi 
            fi 
            git push --set-upstream $\{RepoName\} --all >> $\{log\} 
            git push --set-upstream $\{RepoName\} --tags >> $\{log \} 

            echo $\{SourceName\}" was uploaded to salsa.debian.org." >> $\{log\} 
         fi 
    fi
 \} 

\LA  {}GettingFingerprint~{\nwtagstyle{}\subpageref{NW4N9Oy2-3stkYg-1}}\RA{} \nwused{\\{NW4N9Oy2-3M9mGy-1}}\nwendcode{}\nwbegindocs{34}\nwdocspar 

\section{Upload to the own Git-Server} \label{sec:HochladenEigenerGitServer} 

Uploading to your own Git server requires that one has been set up (chapter \ref{subsec:EigenerGitServer}, page \pageref{subsec:EigenerGitServer}). Furthermore, its name or IP address must be entered beforehand (chapter \ref{sec:NameEigenerGitServer}, page \pageref{sec:NameEigenerGitServer}).  

\nwenddocs{}\nwbegincode{35}\sublabel{NW4N9Oy2-1xqyce-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-1xqyce-1}}}\moddef{Upload2OwnServer~{\nwtagstyle{}\subpageref{NW4N9Oy2-1xqyce-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-4XRSRb-1}}\nwenddeflinemarkup 
function Upload2OwnServer \{ 
    # Called by TaskSelect  

    # Uploading to own git server 
    if [ -n "$ServerName" ] 
    then 
        if whiptail --title "Upload to own git server?" \\ 
        --yesno "Should $\{SourceName\} be uploaded to your own git server?" \\ 
        --yes-button "Yes" --no-button "No" 15 60 
        then 
            git push --set-upstream home --all >> $\{log\} 
            git push --set-upstream home --tags >> $\{log\} 

            echo $\{SourceName\}" was uploaded to your git server." >> $\{log\} 
        fi
    fi \} 

\LA{}Upload2Salsa~{\nwtagstyle{}\subpageref{NW4N9Oy2-3M9mGy-1}}\RA{} \nwused{\\{NW4N9Oy2-4XRSRb-1}}\nwendcode{}\nwbegindocs{36}\nwdocspar 

\chapter{Upload package} \label{chap:UploadPackage} 

In the \textit{TaskSelect} (task selection) function, the functions for uploading the packages are also called.  

\nwenddocs{}\nwbegincode{37}\sublabel{NW4N9Oy2-1qX7nC-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-1qX7nC-1}}}\moddef{TaskSelect10~{\nwtagstyle{}\subpageref{NW4N9Oy2-1qX7nC-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-47oStO-1}}\nwenddeflinemarkup 
        ############## 

        # Uploading packages 

        ##############  

        SelectUploadTarget 
        CreateSignature 
        UploadUsingDput 
        Upload2PeopleDO 
        UploadLocal 
\LA{}TaskSelect11~{\nwtagstyle{}\subpageref{NW4N9Oy2-2fcvCo-1}}\RA{} \nwused{\\{NW4N9Oy2-47oStO-1}}\nwendcode{}\nwbegindocs{38}\nwdocspar 

If the \textit{CreateNewBranch} (chapter \ref{sec:NeuenBranchErstellen}, page \pageref{sec:NeuenBranchErstellen}), \textit{SelectBranch} (chapter \ref{sec:AuswahlGitBranch}, page \pageref{sec:AuswahlGitBranch}), or \textit{OwnServer} (chapter \ref{sec:NameEigenerGitServer}, page \pageref{sec:NameEigenerGitServer}) functions were called, the configuration file will be displayed again for editing (chapter \ref{sec:ConfigFileLaden}, page \pageref{sec:ConfigFileLaden} and then the task selection will be called again.  

\nwenddocs{}\nwbegincode{39}\sublabel{NW4N9Oy2-2fcvCo-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-2fcvCo-1}}}\moddef{TaskSelect11~{\nwtagstyle{}\subpageref{NW4N9Oy2-2fcvCo-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-1qX7nC-1}}\nwenddeflinemarkup 
    else 
        ConfigFileLEC 
        CommonTasks 
    fi
 \} 

\LA{}StartTasks~{\nwtagstyle{}\subpageref{nw@notdef}}\RA{} \nwused{\\{NW4N9Oy2-1qX7nC-1}}\nwendcode{}\nwbegindocs{40}\nwdocspar 

\section{Selection of the target repository} 

\nwenddocs{}\nwbegincode{41}\sublabel{NW4N9Oy2-44n7uC-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-44n7uC-1}}}\moddef{SelectUploadTarget~{\nwtagstyle{}\subpageref{NW4N9Oy2-44n7uC-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-1f6yvc-1}}\nwenddeflinemarkup 
function SelectUploadTarget \{ 
    # Called by TaskSelect Upload2FtpMaster  

    # Select upload target 
    Upl=$(whiptail --title "Uploading?" \\ 
    --radiolist "Should the package be uploaded to ftp-master,\\n \\ 
    people.d.o or mentors.debian.net?" 15 60 6\\ 
    "0" "No" off \\ 
    "1" "ftp-master" on \\ 
    "2" "people.d.o" off \\ 
    "3" "Mentors" off \\ 
    "4" "Non-Maintainer-Upload" off \\ 
    "5" "Local repository" off --cancel-button "Exit" 3>&2 2>&1 1>&3) 

\LA{}SelectUploadTarget1~{\nwtagstyle{}\subpageref{NW4N9Oy2-4XRSRb-1}}\RA{} \nwused{\\{NW4N9Oy2-1f6yvc-1}}\nwendcode{}\nwbegindocs{42}\nwdocspar 

\begin{figure}[h] \centering

\includegraphics[width=30em,height=30ex]{Pictures/UploadTarget.png} \caption{Upload target} \end{figure} 

\nwenddocs{}\nwbegincode{43}\sublabel{NW4N9Oy2-4XRSRb-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-4XRSRb-1}}}\moddef{SelectUploadTarget1~{\nwtagstyle{}\subpageref{NW4N9Oy2-4XRSRb-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-44n7uC-1}}\nwenddeflinemarkup 
    # The order of the conditions is important! 
    # 'Cancel' results an empty variable 
    if [ -z $\{Upl\} ] || [ $\{Upl\} -eq 0 ] 
    then 
        exit 
    fi  

    case "$\{Upl\}" in 
    1) Upltext="ftp-master";; 
    2) Upltext="people.d.o";; 
    3) Upltext="Mentors";; 
    4) Upltext="delayed";; 
    5) Upltext="local repository";; 
    esac  

    cd $\{PrjPath\} 

     # Select package 
     SelectChangesFile "Upload" # String will be found in $\{1\} 
     UplPaket=$\{changesa[$paket]\} 

    Version2=$(echo $\{UplPaket\} | sed --expression="s/^[a-z\\-]*_//" | \\ 
    sed --expression="s/-.*$//") 
    SourceName1=$(echo $\{UplPaket\} | sed --expression="s/_.*//1")
    OrigPaket=$\{SourceName1\}"_"$\{Version2\}".orig"  

     # Final question before uploading starts 
     if ! whiptail --title "Upload to $\{Upltext\}?" \\ 
     --yesno "You want $\{UplPaket\} upload to $\{Upltext\}." \\ 
     --yes-button "Yes" --no-button "No" 15 60 
     then 
         whiptail --title "Bye" --msgbox "Exit" 15 60 
         exit 
     fi  

     echo "$\{UplPaket\} should be uploaded to $\{Upltext\}." >> $\{log
\} \} 

\LA{}Upload2OwnServer~{\nwtagstyle{}\subpageref{NW4N9Oy2-1xqyce-1}}\RA{} \nwused{\\{NW4N9Oy2-44n7uC-1}}\nwendcode{}\nwbegindocs{44}\nwdocspar 

\section{Preparation - Create signature} 

The \textit{CreateSignature} function creates the required signatures using \textit{debsign}. \textit{debsign} signs a Debian .changes and .dsc file pair using GnuPG. For this, the \texttt{GnuPG} key must be available (chapter \ref{sec:KeyAvailable}, page \pageref{sec:KeyAvailable}).  

In case of failure a retry is provided.  

\nwenddocs{}\nwbegincode{45}\sublabel{NW4N9Oy2-fT69x-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-fT69x-1}}}\moddef{CreateSignature~{\nwtagstyle{}\subpageref{NW4N9Oy2-fT69x-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-3stkYg-1}}\nwenddeflinemarkup 
function CreateSignature \{ 
    # Called by TaskSelect Upload2FtpMaster and itself  

    # Signature using debsign  

    GettingFingerprint GpgKeyAvailable  

    # Signature 
    debsign -k$\{fipr\} $\{UplPaket\} 
    if [ $? -ne 0 ] 
    then 
        if whiptail --title "Signing failed!" \\ 
        --yesno "Signature failed - Retry?" \\ 
        --yes-button "Yes" --no-button "Exit" 15 60 
        then 
            CreateSignature 
        else 
            exit 
        fi 
    fi  

    echo "$\{UplPaket\} was signed" >> $\{log
\} \} 

\LA{}Upload2Mentors~{\nwtagstyle{}\subpageref{NW4N9Oy2-3qFEIZ-1}}\RA{} \nwused{\\{NW4N9Oy2-3stkYg-1}}\nwendcode{}\nwbegindocs{46}\nwdocspar 

\subsection{Use fingerprint} \label{subsec:GettingFingerprint} 

To sign the packages to be uploaded we need the fingerprint\index{Fingerprint} of the maintainer key. This is the fingerprint of the key that is also stored in the \texttt{Debian keyring}\index{Debian Keyring}.  

If there is no corresponding file in the configuration files\index{Configuration file} directory, a corresponding file is created.  

\nwenddocs{}\nwbegincode{47}\sublabel{NW4N9Oy2-3stkYg-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-3stkYg-1}}}\moddef{GettingFingerprint~{\nwtagstyle{}\subpageref{NW4N9Oy2-3stkYg-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-4SzZ52-1}}\nwenddeflinemarkup 
function GettingFingerprint \{ 
    # Called by CreateSignature  

    finchflag=0  

    # getting the fingerprint of the key to sign 
    if [ -f $\{ConfigPath\}/fingerprint ] 
    then 
        . $\{ConfigPath\}/fingerprint 
    else 
        mkdir --parents $\{ConfigPath\} 
        finchflag=1 
    fi  

    if [ -z "$\{fipr\}" ] 
    then 
        fipr=$(whiptail --title "Your fingerprint" \\ 
        --inputbox "Please insert fingerprint of your key for signing!" \\ 
        --cancel-button "Cancel" 15 60 3>&2 2>&1 1>&3) 
        if [ -z "$\{fipr\}" ] 
        then 
            echo "Please insert fingerprint of your key for signing!" 
            read fipr 
        fi 
        finchflag=1 
    fi  

    if ! whiptail --title "Fingerprint" \\ 
    --yesno "Is $\{fipr\} the right fingerprint of the key for signing?" \\ 
    --yes-button "Yes" --no-button "No" 15 60 
    then 
        fipr=$(whiptail --title "Key for signing" \\ 
        --inputbox "Real fingerprint of the key for signing:" \\ 
        --cancel-button "Cancel" 15 60 3>&2 2>&1 1>&3) 
        if [ -z "$\{fipr\}" ] 
        then 
            echo "Please insert fingerprint of your key for signing!" 
            read fipr 
        fi 
        finchflag=1 
    fi  

    if [ $finchflag -eq 1 ] 
    then 
        if [ -f $\{ConfigPath\}/fingerprint ] 
        then 
            mv $\{ConfigPath\}/fingerprint $\{ConfigPath\}/fingerprint.backup 
            whiptail --title "Fingerprint file" \\ 
            --msgbox "You can find the old fingerprint file as\\n \\ 
            $\{ConfigPath\}/fingerprint.backup" 15 60 
        fi 
        touch $\{ConfigPath\}/fingerprint 
        echo "#!/usr/bin/bash" >> $\{ConfigPath\}/fingerprint 
        echo "fipr="$\{fipr\} >> $\{ConfigPath\}/fingerprint 
        . $\{ConfigPath\}/fingerprint 
    fi
 \} 

\LA{}CreateSignature~{\nwtagstyle{}\subpageref{NW4N9Oy2-fT69x-1}}\RA{} \nwused{\\{NW4N9Oy2-4SzZ52-1}}\nwendcode{}\nwbegindocs{48}\nwdocspar 

\section{Upload with dput} \label{sec:DputHochladen} 

\nwenddocs{}\nwbegincode{49}\sublabel{NW4N9Oy2-38Lz4Y-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-38Lz4Y-1}}}\moddef{UploadUsingDput~{\nwtagstyle{}\subpageref{NW4N9Oy2-38Lz4Y-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-3Wp8zk-1}}\nwenddeflinemarkup 
function UploadUsingDput \{ 
    # Called by TaskSelect Upload2FtpMaster  

    # Uploading using dput  

    cd $\{PrjPath\}/ 
    if [ $\{Upl\} -eq 3 ] 
    then 
        Upload2Mentors 
    elif [ $\{Upl\} -eq 1 ] || [ $\{Upl\} -eq 4 ] 
    then 
        Upload2FtpMaster 
    fi
 \} 

\LA{}UploadFilesSelect~{\nwtagstyle{}\subpageref{NW4N9Oy2-1Zg9xf-1}}\RA{} \nwused{\\{NW4N9Oy2-3Wp8zk-1}}\nwendcode{}\nwbegindocs{50}\nwdocspar 

\section{Upload to FTP-Master } 

\nwenddocs{}\nwbegincode{51}\sublabel{NW4N9Oy2-2XJq8-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-2XJq8-1}}}\moddef{Upload2FtpMaster~{\nwtagstyle{}\subpageref{NW4N9Oy2-2XJq8-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-2eHzlG-1}}\nwenddeflinemarkup 
function Upload2FtpMaster \{ 
    # Called by UploadUsingDput  

    # repeat question 
    if whiptail --title "Last exit" \\ 
    --yesno "Should the package be uploaded to ftp-master?" \\ 
    --yes-button "Yes" --no-button "No" 15 60
 \LA{}Upload2FtpMaster1~{\nwtagstyle{}\subpageref{NW4N9Oy2-3Wp8zk-1}}\RA{} \nwused{\\{NW4N9Oy2-2eHzlG-1}}\nwendcode{}\nwbegindocs{52}\nwdocspar 

\begin{figure}[h] \centering

\includegraphics[width=25em,height=30ex]{Pictures/UploadFtpMaster.png} \caption{Upload to FTP-Master - OK?} \end{figure} 

\nwenddocs{}\nwbegincode{53}\sublabel{NW4N9Oy2-3Wp8zk-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-3Wp8zk-1}}}\moddef{Upload2FtpMaster1~{\nwtagstyle{}\subpageref{NW4N9Oy2-3Wp8zk-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-2XJq8-1}}\nwenddeflinemarkup 
    then  

        # Checking whether the .changes file is the right one for the upload target 
        sourceFlag=$(echo $\{UplPaket\} | grep --count '_source.') 
        expFlag=$(grep --line-number ') experimental; urgency=' $\{GitPath\}/debian/changelog \\ 
        | grep '^1:') 
        echo -e "$\{UplPaket\}:\\n$\{expFlag\}\\nsourceFlag: $\{sourceFlag\}" >> $\{log\} 
        # Strip line to isolate release 
        expFlag=$(echo $\{expFlag\} | sed --expression='s/^.*) //' | \\ 
        sed --expression='s/; .*$//')  

        if [ -z "$\{expFlag\}" ] 
        then 
            if [ $\{sourceFlag\} -eq 0 ] 
            then 
                if whiptail --title "Uploading?" \\ 
                --yesno "Do you really want to upload a binary package\\n \\ 
                to ftp-master?" --yes-button "Yes" --no-button "No" 15 60 
                then 
                    Dput2FtpMaster 
                else 
                    echo "Next try to upload" >> $\{log\} 
                    SelectUploadTarget 
                fi 
            else 
                Dput2FtpMaster 
            fi
        else
            if [ $sourceFlag -ge 1 ] 
            then 
                if whiptail --title "Uploading?" \\ 
                --yesno "Do you really want to upload a source package\\n \\ 
                to experimental?" --yes-button "Yes" --no-button "No" 15 60 
                then 
                    Dput2FtpMaster 
                else 
                    echo "Next try to upload" >> $\{log\} 
                    SelectUploadTarget 
                    CreateSignature 
                    UploadUsingDput 
                fi 
            else
                Dput2FtpMaster 
            fi 
        fi 
    fi
 \} 

\LA{}UploadUsingDput~{\nwtagstyle{}\subpageref{NW4N9Oy2-38Lz4Y-1}}\RA{} \nwused{\\{NW4N9Oy2-2XJq8-1}}\nwendcode{}\nwbegindocs{54}\nwdocspar 

In the following function the upload to FTP master is done.  

\nwenddocs{}\nwbegincode{55}\sublabel{NW4N9Oy2-2eHzlG-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-2eHzlG-1}}}\moddef{Dput2FtpMaster~{\nwtagstyle{}\subpageref{NW4N9Oy2-2eHzlG-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-NEf5r-1}}\nwenddeflinemarkup 
function Dput2FtpMaster \{ 
    # Called by Upload2FtpMaster  

    if whiptail --title "Simulate uploading?" \\ 
    --yesno "Should the upload to ftp-master be simulated?" \\ 
    --yes-button "Yes" --no-button "No" 15 60 
    then 
        dput --simulate ftp-master $\{UplPaket\} 
        echo 
        echo "After reading press return!" 
        read x 
    fi  

    if whiptail --title "Uploading to FTP-Master?" \\ 
    --yesno "Everything fine?\\n\\nShould the package be uploaded to ftp-master now?" \\ 
    --yes-button "Yes" --no-button "No" 15 60 
    then 
        if [ $\{Upl\} -eq 1 ] 
        then 
            dput ftp-master $\{UplPaket\} 
            echo "$\{UplPaket\} was uploaded to $\{Upltext\}." >> $\{log\} 
        else 
            Dput2NMU 
        fi 
    fi
 \} 

\LA{}Upload2FtpMaster~{\nwtagstyle{}\subpageref{NW4N9Oy2-2XJq8-1}}\RA{} \nwused{\\{NW4N9Oy2-NEf5r-1}}\nwendcode{}\nwbegindocs{56}\nwdocspar 

This package initially lands on \url{https://incoming.debian.org/debian-buildd/pool/main/} until it is built by the build daemon (builddd) and made available for download. Provision.  

\subsection{Reject a package}  

When a package is rejected by the FTP masters, the subsequent upload of the corrected package should not increment the revision number.   

\section{Upload to mentors.debian.net} 

\nwenddocs{}\nwbegincode{57}\sublabel{NW4N9Oy2-3qFEIZ-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-3qFEIZ-1}}}\moddef{Upload2Mentors~{\nwtagstyle{}\subpageref{NW4N9Oy2-3qFEIZ-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-fT69x-1}}\nwenddeflinemarkup 
function Upload2Mentors \{ 
    # Called by UploadUsingDput 

    if whiptail --title "Simulate uploading?" \\ 
    --yesno "Should the upload to Mentors be simulated?" \\ 
    --yes-button "Yes" --no-button "No" 15 60 
    then 
        dput --simulate mentors $\{UplPaket\} 
        echo 
        echo "After reading press return!" 
        read x 
    fi  

    # repeat question 
    if whiptail --title "Uploading?" \\ 
    --yesno "Should the package be uploaded to Mentors?" \\  
    --yes-button "Yes" --no-button "No" 15 60 
    then 
        dput mentors $\{UplPaket\} 
        echo "$\{UplPaket\} was uploade to $\{Upltext\}." >> $\{log\} 
    fi
 \} 

\LA{}Dput2NMU~{\nwtagstyle{}\subpageref{NW4N9Oy2-NEf5r-1}}\RA{} \nwused{\\{NW4N9Oy2-fT69x-1}}\nwendcode{}\nwbegindocs{58}\nwdocspar 

\section{Upload as \textit{non-maintainer upload}.} 

In the context of fixing release-critical bugs by parties other than the package maintainer, it is common to allow the package maintainer some time to fix the problem. 

\nwenddocs{}\nwbegincode{59}\sublabel{NW4N9Oy2-NEf5r-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-NEf5r-1}}}\moddef{Dput2NMU~{\nwtagstyle{}\subpageref{NW4N9Oy2-NEf5r-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-3qFEIZ-1}}\nwenddeflinemarkup 
function Dput2NMU \{ 
    # Called by Dput2FtpMaster 

    DelayDays=$(whiptail --title "Non-Maintainer-Upload" \\ 
    --radiolist "Days for delay?" 15 60 5 \\ 
    "0" " 5 days of delay" off \\ 
    "1" "10 days of delay" on \\ 
    "2" "15 days of delay" off --cancel-button "Exit" 3>&2 2>&1 1>&3) 

    if [ -z $\{DelayDays\} ] 
    then 
        exit 
    fi 

    case "$\{DelayDays\}" in 
    0) DelDays=5;; 
    1) DelDays=10;; 
    2) DelDays=15;; 
    esac 

    dput ftp-master --delayed $\{DelDays\} $\{UplPaket
\} \} 

\LA{}Dput2FtpMaster~{\nwtagstyle{}\subpageref{NW4N9Oy2-2eHzlG-1}}\RA{} \nwused{\\{NW4N9Oy2-3qFEIZ-1}}\nwendcode{}\nwbegindocs{60}\nwdocspar 

\section{Upload to \textit{people.debian.org}} 

\nwenddocs{}\nwbegincode{61}\sublabel{NW4N9Oy2-1onIoV-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-1onIoV-1}}}\moddef{Upload2PeopleDO~{\nwtagstyle{}\subpageref{NW4N9Oy2-1onIoV-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-1Zg9xf-1}}\nwenddeflinemarkup 
function Upload2PeopleDO \{ 
    # Called by TaskSelect 

    if [ $\{Upl\} -eq 2 ] 
    then 
        # For people.d.o you can not use dput 
        if whiptail --title "Archive on people.d.o" \\ 
        --yesno "Does the directory public_html/$\{OrigName\} \\ 
        already exsist at people.d.o?\\n \\ 
        If not you have to enter the following commands\\n \\ 
        in a separate terminal:\\n\\n \\ 
        ssh <user>@people.debian.org\\n \\ 
        mkdir --parents public_html/$\{OrigName\}" \\ 
        --yes-button "Yes" --no-button "No" 15 60 
        then 
            UploadFilesSelect 
\LA{}Upload2PeopleDO3~{\nwtagstyle{}\subpageref{NW4N9Oy2-Wujn0-1}}\RA{} \nwused{\\{NW4N9Oy2-1Zg9xf-1}}\nwendcode{}\nwbegindocs{62}\nwdocspar 

\nwenddocs{}\nwbegincode{63}\sublabel{NW4N9Oy2-1Zg9xf-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-1Zg9xf-1}}}\moddef{UploadFilesSelect~{\nwtagstyle{}\subpageref{NW4N9Oy2-1Zg9xf-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-38Lz4Y-1}}\nwenddeflinemarkup 
function UploadFilesSelect \{ 
    # Called by Upload2PeopleDO UploadLocal 
    UplFL=$(cat $\{UplPaket\} | grep --after-context=10 'Files: *') 
    UplFL1=$(echo $\{UplFL\} | sed --expression='s/Files: //') 
    i=1 
    while [ $i -lt 6 ] 
    do 
        c=$(expr $\{i\} '*' '5') 
        UplFL2=$\{UplFL2\}" "$(echo $UplFL1 | cut --delimiter=" " -f$\{c\}) 
        i=$(expr $\{i\} '+' '1') 
    done
 \} 

\LA{}Upload2PeopleDO~{\nwtagstyle{}\subpageref{NW4N9Oy2-1onIoV-1}}\RA{} \nwused{\\{NW4N9Oy2-38Lz4Y-1}}\nwendcode{}\nwbegindocs{64}\nwdocspar 

\nwenddocs{}\nwbegincode{65}\sublabel{NW4N9Oy2-Wujn0-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-Wujn0-1}}}\moddef{Upload2PeopleDO3~{\nwtagstyle{}\subpageref{NW4N9Oy2-Wujn0-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-1onIoV-1}}\nwenddeflinemarkup 
            if whiptail --title "Upload file?" \\ 
            --yesno "Should the following files\\n$\{UplFL2\}\\n \\ 
            have to be uploaded?" --yes-button "Yes" \\ 
            --no-button "No" 15 60 
            then 
                if [ -z "$\{pdoaccount\}" ] 
                then 
                    pdoaccount=$(whiptail --title "Account at people.debian.org" \\ 
                    --inputbox "Please insert the name of your account on\\n \\ 
                    people.debian.org" \\ 
                    --cancel-button "Cancel" 15 60 3>&2 2>&1 1>&3) 
                    if [ -z "$\{pdoaccount\}" ] 
                    then 
                        echo "Please insert the name of your account on\\n \\ 
                        people.debian.org" 
                        read pdoaccount 
                    fi 
                    changeflag=1 
                fi  

                if ! whiptail --title "Account name" \\ 
                --yesno "The name of your account on people.debian.org:\\n \\ 
                $\{pdoaccount\}" --yes-button "Yes" --no-button "No" 15 60 
                then 
                    pdoaccount=$(whiptail --title " Account name" \\ 
                    --inputbox "Name of your account on people.debian.org:" \\ 
                    --cancel-button "Cancel" 15 60 3>&2 2>&1 1>&3) 
                    if [ -z "$\{pdoaccount\}" ] 
                    then 
                        echo "Please insert the name of your account on\\n \\ 
                        people.debian.org" 
                        read pdoaccount 
                    fi 
                    changeflag=1 
                fi  

                if [ $changeflag -eq 1 ] 
                then 
                    echo 'pdoaccount='$\{pdoaccount\} >> $\{ConfigPath\}$\{OrigName\} 
                    changeflag=0 
                fi  

                cd $\{ProjectPath\}/$\{OrigName\} 
                if scp -p $\{UplFL2\} \\
                $\{pdoaccount\}@people.debian.org:/home/$\{pdoaccount\}/public_html/$\{OrigName\} 
                then 
                    echo "$\{UplFL2\} were uploaded to p.d.o." >> $\{log\} 
                else 
                    echo "Something went wrong while uploading to p.d.o." >> $\{log\} 
                    echo "Tried to execute this command:" >> $\{log\} 
                    echo "scp -p "$\{UplFL2\}" "$\{pdoaccount\}"@people.debian.org:/home/"\\ 
                    $\{pdoaccount\}"/public_html/"$\{OrigName\} >> $\{log\} 
                fi 
                pdoarchivetext="If the archive on people.d.o should be\\n \\ 
                used too, you have to enter the following commands:\\n \\ 
                ssh <user>@people.debian.org\\n \\ 
                cd public_html/$\{OrigName\}\\n \\ 
                apt-ftparchive packages . > Packages\\n \\ 
                apt-ftparchive sources . > Sources\\n \\ 
                cat Packages | gzip -c > Packages.gz\\n \\ 
                cat Sources | gzip -c > Sources.gz\\n \\ 
                apt-ftparchive release . > Release"  

                if whiptail --title "Archive on people.d.o" \\ 
                --yesno "$\{pdoarchivetext\}\\n\\n \\ 
                Do you like to copy and paste these commands?" \\ 
                --yes-button "Yes" --no-button "No" 15 60 
                then 
                     echo -e $pdoarchivetext echo -e "\\nPlease press any key to continue!" 
                     read x 
                fi 
            fi 
        fi 
    fi
 \} 

\LA{}UpdateLocalRepo~{\nwtagstyle{}\subpageref{NW4N9Oy2-BfToG-1}}\RA{} \nwused{\\{NW4N9Oy2-1onIoV-1}}\nwendcode{}\nwbegindocs{66}\nwdocspar 

\section{Local repository} 

It happens again and again that packages must be built, which are needed for the actual project as dependencies. To bridge the time for going through the new-queue, these can also be provided locally for building in the \textit{chroot}.  

\nwenddocs{}\nwbegincode{67}\sublabel{NW4N9Oy2-3e9Pf3-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-3e9Pf3-1}}}\moddef{UploadLocal~{\nwtagstyle{}\subpageref{NW4N9Oy2-3e9Pf3-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-BfToG-1}}\nwenddeflinemarkup 
function UploadLocal \{ 
    # Called by TaskSelect 
    if [ $\{Upl\} -eq 5 ] 
    then 
        # Provide for local chroot 
        UploadFilesSelect 
        if whiptail --title " Files Uploaded?" \\ 
        --yesno "Should the following files\\n \\ 
        $\{UplFL2\}\\nhave to be uploaded?" 15 60 
        then 
            cd $\{ProjectPath\}/$\{OrigName\} 
            sudo cp $\{UplFL2\} /var/local/repository 
            UpdateLocalRepo 
        fi 
fi
 \} 

\LA{}ChangeEntry~{\nwtagstyle{}\subpageref{nw@notdef}}\RA{} \nwused{\\{NW4N9Oy2-BfToG-1}}\nwendcode{}\nwbegindocs{68}\nwdocspar 

The following function already exists as a shell script under \textit{/usr/local/bin/LocalNewRepo}.  

\nwenddocs{}\nwbegincode{69}\sublabel{NW4N9Oy2-BfToG-1}\nwmargintag{{\nwtagstyle{}\subpageref{NW4N9Oy2-BfToG-1}}}\moddef{UpdateLocalRepo~{\nwtagstyle{}\subpageref{NW4N9Oy2-BfToG-1}}}\endmoddef\nwstartdeflinemarkup\nwusesondefline{\\{NW4N9Oy2-Wujn0-1}}\nwenddeflinemarkup 
function UpdateLocalRepo \{ 
    # Called by UploadLocal 
    cd /var/local/repository  

    # Make package archives writable 
    # (not only for root) 
    sudo chmod o+w Packages 
    sudo chmod o+w Sources 
    sudo chmod o+w Packages.gz 
    sudo chmod o+w Sources.gz 
    sudo chmod o+w Release  

    # Use apt-ftparchive to update package archives sudo apt-ftparchive packages . > Packages  &&    sudo apt-ftparchive sources . > Sources  &&    sudo cat Packages | gzip -c > Packages.gz  &&    sudo cat Sources | gzip -c > Sources.gz  &&    sudo apt-ftparchive release . > Release  

    # Reset rights 
    sudo chmod o-w Packages 
    sudo chmod o-w Sources 
    sudo chmod o-w Packages.gz 
    sudo chmod o-w Sources.gz 
    sudo chmod o-w Release
 \} 

\LA{}UploadLocal~{\nwtagstyle{}\subpageref{NW4N9Oy2-3e9Pf3-1}}\RA{} \nwused{\\{NW4N9Oy2-Wujn0-1}}\nwendcode{} 

\nwixlogsorted{c}{{ChangeEntry}{nw@notdef}{\nwixu{NW4N9Oy2-3e9Pf3-1}}} \nwixlogsorted{c}{{CreateSignature}{NW4N9Oy2-fT69x-1}{\nwixd{NW4N9Oy2-fT69x-1}\nwixu{NW4N9Oy2-3stkYg-1}}} \nwixlogsorted{c}{{Dput2FtpMaster}{NW4N9Oy2-2eHzlG-1}{\nwixd{NW4N9Oy2-2eHzlG-1}\nwixu{NW4N9Oy2-NEf5r-1}}} \nwixlogsorted{c}{{Dput2NMU}{NW4N9Oy2-NEf5r-1}{\nwixu{NW4N9Oy2-3qFEIZ-1}\nwixd{NW4N9Oy2-NEf5r-1}}} \nwixlogsorted{c}{{GettingFingerprint}{NW4N9Oy2-3stkYg-1}{\nwixu{NW4N9Oy2-4SzZ52-1}\nwixd{NW4N9Oy2-3stkYg-1}}} \nwixlogsorted{c}{{PrepareUploading}{NW4N9Oy2-2h4AeG-1}{\nwixd{NW4N9Oy2-2h4AeG-1}}} \nwixlogsorted{c}{{PrepareUploading1}{NW4N9Oy2-4J30By-1}{\nwixu{NW4N9Oy2-2h4AeG-1}\nwixd{NW4N9Oy2-4J30By-1}}} \nwixlogsorted{c}{{PrepareUploading10}{NW4N9Oy2-1eblsS-1}{\nwixu{NW4N9Oy2-eScQ-1}\nwixd{NW4N9Oy2-1eblsS-1}}} \nwixlogsorted{c}{{PrepareUploading11}{NW4N9Oy2-3D7O6O-1}{\nwixu{NW4N9Oy2-1eblsS-1}\nwixd{NW4N9Oy2-3D7O6O-1}}} \nwixlogsorted{c}{{PrepareUploading12}{NW4N9Oy2-bK1xc-1}{\nwixu{NW4N9Oy2-3D7O6O-1}\nwixd{NW4N9Oy2-bK1xc-1}}} \nwixlogsorted{c}{{PrepareUploading15}{NW4N9Oy2-2fuJsq-1}{\nwixu{NW4N9Oy2-bK1xc-1}\nwixd{NW4N9Oy2-2fuJsq-1}}} \nwixlogsorted{c}{{PrepareUploading16}{NW4N9Oy2-XdFGm-1}{\nwixu{NW4N9Oy2-2fuJsq-1}\nwixd{NW4N9Oy2-XdFGm-1}}} \nwixlogsorted{c}{{PrepareUploading2}{NW4N9Oy2-1qKoDG-1}{\nwixu{NW4N9Oy2-4J30By-1}\nwixd{NW4N9Oy2-1qKoDG-1}}} \nwixlogsorted{c}{{PrepareUploading20}{NW4N9Oy2-1f6yvc-1}{\nwixu{NW4N9Oy2-XdFGm-1}\nwixd{NW4N9Oy2-1f6yvc-1}}} \nwixlogsorted{c}{{PrepareUploading3}{NW4N9Oy2-2fQbcs-1}{\nwixu{NW4N9Oy2-1qKoDG-1}\nwixd{NW4N9Oy2-2fQbcs-1}}} \nwixlogsorted{c}{{PrepareUploading4}{NW4N9Oy2-eFVGQ-1}{\nwixu{NW4N9Oy2-2fQbcs-1}\nwixd{NW4N9Oy2-eFVGQ-1}}} \nwixlogsorted{c}{{PrepareUploading5}{NW4N9Oy2-3vUIOc-1}{\nwixu{NW4N9Oy2-eFVGQ-1}\nwixd{NW4N9Oy2-3vUIOc-1}}} \nwixlogsorted{c}{{PrepareUploading6}{NW4N9Oy2-1e83cU-1}{\nwixu{NW4N9Oy2-3vUIOc-1}\nwixd{NW4N9Oy2-1e83cU-1}}} \nwixlogsorted{c}{{PrepareUploading8}{NW4N9Oy2-eScQ-1}{\nwixu{NW4N9Oy2-1e83cU-1}\nwixd{NW4N9Oy2-eScQ-1}}} \nwixlogsorted{c}{{SelectUploadTarget}{NW4N9Oy2-44n7uC-1}{\nwixu{NW4N9Oy2-1f6yvc-1}\nwixd{NW4N9Oy2-44n7uC-1}}} \nwixlogsorted{c}{{SelectUploadTarget1}{NW4N9Oy2-4XRSRb-1}{\nwixu{NW4N9Oy2-44n7uC-1}\nwixd{NW4N9Oy2-4XRSRb-1}}} \nwixlogsorted{c}{{StartTasks}{nw@notdef}{\nwixu{NW4N9Oy2-2fcvCo-1}}} \nwixlogsorted{c}{{TaskSelect10}{NW4N9Oy2-1qX7nC-1}{\nwixu{NW4N9Oy2-47oStO-1}\nwixd{NW4N9Oy2-1qX7nC-1}}} \nwixlogsorted{c}{{TaskSelect11}{NW4N9Oy2-2fcvCo-1}{\nwixu{NW4N9Oy2-1qX7nC-1}\nwixd{NW4N9Oy2-2fcvCo-1}}} \nwixlogsorted{c}{{TaskSelect9}{NW4N9Oy2-47oStO-1}{\nwixd{NW4N9Oy2-47oStO-1}}} \nwixlogsorted{c}{{UpdateLocalRepo}{NW4N9Oy2-BfToG-1}{\nwixu{NW4N9Oy2-Wujn0-1}\nwixd{NW4N9Oy2-BfToG-1}}} \nwixlogsorted{c}{{Upload2FtpMaster}{NW4N9Oy2-2XJq8-1}{\nwixd{NW4N9Oy2-2XJq8-1}\nwixu{NW4N9Oy2-2eHzlG-1}}} \nwixlogsorted{c}{{Upload2FtpMaster1}{NW4N9Oy2-3Wp8zk-1}{\nwixu{NW4N9Oy2-2XJq8-1}\nwixd{NW4N9Oy2-3Wp8zk-1}}} \nwixlogsorted{c}{{Upload2Mentors}{NW4N9Oy2-3qFEIZ-1}{\nwixu{NW4N9Oy2-fT69x-1}\nwixd{NW4N9Oy2-3qFEIZ-1}}} \nwixlogsorted{c}{{Upload2OwnServer}{NW4N9Oy2-1xqyce-1}{\nwixd{NW4N9Oy2-1xqyce-1}\nwixu{NW4N9Oy2-4XRSRb-1}}} \nwixlogsorted{c}{{Upload2PeopleDO}{NW4N9Oy2-1onIoV-1}{\nwixd{NW4N9Oy2-1onIoV-1}\nwixu{NW4N9Oy2-1Zg9xf-1}}} \nwixlogsorted{c}{{Upload2PeopleDO3}{NW4N9Oy2-Wujn0-1}{\nwixu{NW4N9Oy2-1onIoV-1}\nwixd{NW4N9Oy2-Wujn0-1}}} \nwixlogsorted{c}{{Upload2Salsa}{NW4N9Oy2-3M9mGy-1}{\nwixd{NW4N9Oy2-3M9mGy-1}\nwixu{NW4N9Oy2-1xqyce-1}}} \nwixlogsorted{c}{{Upload2Salsa5}{NW4N9Oy2-4SzZ52-1}{\nwixu{NW4N9Oy2-3M9mGy-1}\nwixd{NW4N9Oy2-4SzZ52-1}}} \nwixlogsorted{c}{{UploadFilesSelect}{NW4N9Oy2-1Zg9xf-1}{\nwixu{NW4N9Oy2-38Lz4Y-1}\nwixd{NW4N9Oy2-1Zg9xf-1}}} \nwixlogsorted{c}{{UploadLocal}{NW4N9Oy2-3e9Pf3-1}{\nwixd{NW4N9Oy2-3e9Pf3-1}\nwixu{NW4N9Oy2-BfToG-1}}} \nwixlogsorted{c}{{UploadUsingDput}{NW4N9Oy2-38Lz4Y-1}{\nwixd{NW4N9Oy2-38Lz4Y-1}\nwixu{NW4N9Oy2-3Wp8zk-1}}} \nwbegindocs{70}\nwdocspar 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[fuzzy]In the \textit{chroot environment}, here \textit{/var/cache/pbuilder/base.cow}, add the following to the \textit{/etc/apt/sources.list} file:  

\begin{verbatim} deb [trusted=yes] file:///var/local/repository ./ 
deb-src [trusted=yes] file:///var/local/repository ./ \end{verbatim} 

\nwenddocs{} 