gnewsense-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnewsense-dev] How to write a gen script


From: Sam Geeraerts
Subject: [Gnewsense-dev] How to write a gen script
Date: Tue, 26 Dec 2017 23:15:12 +0100

I've assigned the task for apt [1] to myself. I wrote part of the
gen-script [2] and annotated it with comments to make it more clear what
the intention is. Let's walk through it.

Apt has 2 issues: it should have an example sources.list for gNewsense
and it points users to the non-free component of the packages
repository (which we don't have of course). I wrote some code to fix
the first issue.

A gen-script starts by reading Builder's configuration. This lives in a
file called config. It contains most of the variables that are needed
to turn Debian into gNewSense, e.g. the name of the distribution
("gNewSense"). You can override these values using a file called
config.local. This is read by config. I've attached a small
config.local. It contains more than necessary, but I wanted to show all
the variables that are used in the apt script.

The script then flushes the working folder and downloads the source
package. That automatically unpacks it to a folder called
apt-1.0.9.8.4. It installs all the packages that are needed to build
apt and then descends into the unpacked source.

The steps so far are the same for any gen-script. After that the real
work starts.

The vendor specific information lives in the "vendor" folder. You can
follow along with Debian's Git web interface [3]. There we create a
"gnewsense" folder and add files "apt-vendor.ent" and
"sources.list.in". The first sets some information about repository
keyrings. The second is an example sources.list file. Both are created
using a here file.

Then we add a new entry to the package's changelog (debian/changelog).
This is what the dch command is for. We give it the name of our release
using option -D. We also extract the last used version string and
extend it with our own. So "1.0.9.8.4" becomes "1.0.9.8.4gnewsense1".
In the comment we give a short description of the change we made.

Then finally the package gets built.

You can run a gen-script without the rest of Builder. A minimal setup
would have gen-apt, config and config.local. The config.local file
should at least contain the DPKGOPTS line. You should make sure BASEDIR
exists. Then you should be able to run the gen-script as root on a
Jessie system. I've not yet tested my script, but you can already try
it to give you an idea of what it does.

I hope this clarified how gen-scripts work. If there are any questions,
please ask. I would love to see some of you trying this out for
yourself.

[1] https://savannah.nongnu.org/task/index.php?14784
[2]
http://bzr.savannah.gnu.org/lh/gnewsense/builder_samgee/view/head:/gen-apt
[3] https://anonscm.debian.org/cgit/apt/apt.git/tree/?h=debian/jessie

Attachment: config.local
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]