\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Lars Vogdt (kl\_eisbaer)} \pdfinfo{ /Title (osc-open-build-service-command-line-client.pdf) /Creator (Cheatography) /Author (Lars Vogdt (kl\_eisbaer)) /Subject (OSC - Open Build Service Command Line Client Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{173F4F} \definecolor{LightBackground}{HTML}{F7F9F9} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{OSC - Open Build Service Command Line Client Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Lars Vogdt (kl\_eisbaer)} via \textcolor{DarkBackground}{\uline{cheatography.com/23929/cs/5379/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Lars Vogdt (kl\_eisbaer) \\ \uline{cheatography.com/kl-eisbaer} \\ \uline{\seqsplit{www}.suse.com/} \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 31st October, 2015.\\ Updated 13th May, 2016.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Create or edit a package}} \tn % Row 0 \SetRowColor{LightBackground} `osc co home:you` & Check out you(r) home project. \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `cd home:you` & Change into the new directory. \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `osc mkpac ctris` & Create new package named {\emph{ctris}}. \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} `cd ctris` & Change into the new package directory. \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} `vi ctris.spec` & Start writing the new spec file. \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} `wget -q \seqsplit{http://www.hackl.dhs.org/data/download/download.php?file=ctris-0.42.tar.bz2} -O ctris-0.42.tar.bz2` & Download the sources into the directory. (Note: checksum/signature validation should also be done as next step, if any of them are provided.) \tn % Row Count 18 (+ 8) % Row 6 \SetRowColor{LightBackground} `osc addremove` & Mark files to be added and/or removed from your package directory. \tn % Row Count 22 (+ 4) % Row 7 \SetRowColor{white} `osc ci -m "First checkin of the ctris package"` & Submit your files/changes back to the remote build instance. \tn % Row Count 25 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Editing or creating a (new) package (meta data) in project {\emph{\$PRJ}} with the name {\emph{\$PKG}} can also be done via the command: \newline `osc meta pkg \$PRJ \$PKG -e` \newline everywhere in the filesystem. \newline \newline To work with the sources locally, a checkout via \newline `osc co \$PRJ \$PKG` \newline is needed.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Branch a package}} \tn % Row 0 \SetRowColor{LightBackground} `osc branch home:lrupp ctris` & Creates a branch of the package below your home project. \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} `osc co \seqsplit{home:you:branches:home:lrupp/ctris`} & Check out the branched package. \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} `cd \seqsplit{home:you:branches:home:lrupp/ctris`} & Change into the new directory. \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} `vi ctris.spec` & Do changes in spec file (or other files). \tn % Row Count 11 (+ 3) % Row 4 \SetRowColor{LightBackground} `wget -q \seqsplit{http://www.hackl.dhs.org/data/download/download.php?file=ctris-0.42.tar.bz2} -O ctris-0.42.tar.bz2` & Download newer source tarballs (as example). \tn % Row Count 17 (+ 6) % Row 5 \SetRowColor{white} `osc build ctris.spec` & Do a test build of the package. \tn % Row Count 19 (+ 2) % Row 6 \SetRowColor{LightBackground} `rm ctris-0.41.tar.bz2` & Cleanup before submitting, please. ;-) \tn % Row Count 21 (+ 2) % Row 7 \SetRowColor{white} `osc vc` & Add a new package changelog entry. \tn % Row Count 23 (+ 2) % Row 8 \SetRowColor{LightBackground} `osc ci -m "updated package to latest upstream version"` & Submit your files/changes to the remote build instance. \tn % Row Count 26 (+ 3) % Row 9 \SetRowColor{white} `osc results` & Check the build results of your changes. \tn % Row Count 28 (+ 2) % Row 10 \SetRowColor{LightBackground} `osc sr -m "Hi! I updated your package to the latest version. Have fun!"` & Create a submit request against the original project. \tn % Row Count 32 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Branch a package (cont)}} \tn % Row 11 \SetRowColor{LightBackground} `osc request -M` & Check the current status of your own requests. \tn % Row Count 3 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{You might also check tools like {\emph{quilt}} for fixing packages, but this is not the topic of this cheat sheet. \newline \newline Maintenance updates for openSUSE follow a slightly different workflow. Please check \seqsplit{https://en.opensuse.org/Portal:Maintenance} for details.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Building a package}} \tn % Row 0 \SetRowColor{LightBackground} `osc meta prj -e` & Either use the WebUI or edit the project configuration manually and add a build target repository. \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} `osc build` & Builds a package with the default values (for distribution and architecture) from the file {\emph{\textasciitilde{}/.oscrc}}. \tn % Row Count 11 (+ 6) % Row 2 \SetRowColor{LightBackground} `osc build Fedora\_22 x86\_64` & Builds a package with given repository and architecture. \tn % Row Count 14 (+ 3) % Row 3 \SetRowColor{white} `osc lbl | less` & Shows the build log of a local build (pipe into pager to allow scrolling and searching). \tn % Row Count 19 (+ 5) % Row 4 \SetRowColor{LightBackground} `osc chroot` & Jump into the chroot environment of the current local build. Might be useful for debugging and/or fixing a package. \tn % Row Count 25 (+ 6) % Row 5 \SetRowColor{white} `osc ci -m "fixed package build for Fedora"` & Submit your files/changes to the remote build instance. \tn % Row Count 28 (+ 3) % Row 6 \SetRowColor{LightBackground} `osc results` & Shows the build results of a package or project. \tn % Row Count 31 (+ 3) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Building a package (cont)}} \tn % Row 7 \SetRowColor{LightBackground} `osc prjresults` & Shows project-wide build results. \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Building a package locally saves time, as the public instances need to find a free schedule for building, while the local machine can start the build immediately. As the build is done in a chroot environment, the OS installation on the local machine will not be affected. \newline \newline Please remember that the public build instances do neither allow network access nor root permissions during build.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Collaborating on packages}} \tn % Row 0 \SetRowColor{LightBackground} `osc request list home:lrupp` & Check for (open) submit requests against a repository. \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} `osc request show -d \$ID` & Deeply inspect submit request with id \$ID (show diff). \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} `osc request accept \$ID -m "Thank you for your contribution :-)"` & Accept a pending request. \tn % Row Count 10 (+ 4) % Row 3 \SetRowColor{white} `osc request decline \$ID -m "Sorry, but you forgot to add missing files"` & Decline a pending request. \tn % Row Count 14 (+ 4) % Row 4 \SetRowColor{LightBackground} `osc request supersede -m "He did it better than me - use his submit request please" \$ID \$SUPERSEDING\_ID` & Superseede a pending submit request with another one. \tn % Row Count 20 (+ 6) % Row 5 \SetRowColor{white} `osc branch -N -M \seqsplit{openSUSE:Backports:SLE-12:Update/glibc7`} & Create a branch pointing to a not yet existing package for a project and package in maintenance mode like the package hub project. \tn % Row Count 27 (+ 7) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.2 cm} x{4.8 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Working with meta informatoin}} \tn % Row 0 \SetRowColor{LightBackground} `osc meta prj \$PRJ` & Show meta informatoin about a project. \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} `osc meta pkg \$PRJ \$PKG` & Show meta information about a package. \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} `osc meta user \$USER` & Show information about a user. \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} `osc meta prjconf \$PRJ` & Show meta information about a project. \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} `osc \seqsplit{updatepacmetafromspec`} & Update package meta data with metadata taken from spec file. \tn % Row Count 11 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{osc comes with a very useful `-{}-help` option and man page. Please refer to this material if you want to get more information. \newline \newline \{\{fa-check\}\} \seqsplit{https://en.opensuse.org/openSUSE:OSC} \newline \{\{fa-check\}\} \seqsplit{https://github.com/openSUSE/osc}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}