Before reading this post, open the console and run the following commands.
ls /etc/apt/sources.list.d | wc -l
If you suddenly have an inscription
"ls" , .
That means this article is definitely not for you.
If you do not have Debian, Ubuntu or their descendants, but something based on RPM or Gentoo, then this is also not for you, at least for now.
If you get a number less than 5, then you probably will not need what is written further.
Well, if you get a number greater than 10 (or even 24 as I did), then read on and you can save a lot of time.
How the idea came to mind
So, it all started a little less than a year and a half ago, when I upgraded my test ubuntu natty to oneiric, which became a test. There were a lot of mats, as you had to monitor when the ppa repositories switch to a new distribution and what it will be. Someone switched to oneiric, and someone only to natty - it all took quite a lot of time.
Then there was an upgrade to oneiric and precise, an increase in the number of repositories and the number of expletives, installing the system at work from scratch and connecting this stuff to the new system.
As you all probably noticed, third-party repositories are rather difficult to manage: you need to keep track of the keys yourself, for those hosted on a launchpad, you need to change the distribution every six months, it’s rather inconvenient to delete them - you also need to delete the key.
But in fact, the connection of the repository is reduced to adding two files - the list of addresses in sources.list.d and the gpg key in trusted.gpg.d, so why not combine them into a package, installing which you connect the repository, and deleting - disconnect.
The format package turned out to be the simplest, without any dependencies and not requiring anything special to build, but the question remained how to install such packages, so I had to implement the repository also.
')
And what came of it
And it turned out the site
http://pkggen.no-ip.org/ , which is a fairly simple thing - you download and install one package, after which you can install all the packages that are on the site, and if you don’t there is enough (and in the beginning it will be), then after registering you can add your own repositories, and the system will generate packages for them and add them to the repository. PPA repositories are tracked automatically and checked for updates on the launchpad. All repository packages start with a prefix, so that you can search in the general list of them not only by source, but also by name.
Technical implementation
First, the code is open - in the best traditions of OpenSource -
https://github.com/ivan1986/deb-pkg-gen .
Secondly, everything is implemented on Symfony 2 and hosted on Debian. Twitter Bootstrap interface, classic CRUD, paginator and search for editing, the repository is implemented simply with three addresses and ZendCache (otherwise it’s somehow bad). For signatures, the php-gnupg library is used. Since the size of each package is approximately 2.5 kilobytes, it was decided not to bother with the files and store the collected packages directly in the database.