Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Create docs directory rename db.txt into docs/cache_db.txt
Baptiste Daroussin committed 15 years ago
commit 1f86744eecd4afe7189fcb033b2752892cac1a5f
parent 9314810
5 files changed +203 -138
deleted TODO
@@ -1,100 +0,0 @@
-
comamnds:
-
- pkg:
-
	- one command to rule them all
-
	- each time pkg has to query the installed database it will try to first
-
	  read the cache is the cache is too old (check but last mtime of the
-
	  directory) it will regenerate the cache from installed package
-

-
- pkg_*:
-
	this will be shell script their goal is to be 100% compatible with
-
	pkg_install they will call pkg which the good options
-

-
subcommands:
-
- add:
-
	- installs a package if local package is given
-
	- manage http/ftp url to download throught libfetch a package and try to
-
	  install it.
-
	- in the two previous case, if the package as not installed dependencies
-
	  it will try to fetch/find them in the same place the original package
-
	  was.
-
	- it will manage a completely new repository format pkg add bla will
-
	  check in the database of the repository if the is a bla package and
-
	  install it as well as it's dependencies but the dependencies will be
-
	  compute before begining the fetch install process, to be sure
-
	  everything is ok.
-
	- should be able to only take a plist or a manifest in argument
-
	  considering the files are already installed
-

-
- genrepo:
-
	- takes only one argument and generate two cache files (maybe more for
-
	  the time we will be willing to work with UPDATING and MOVED) the first
-
	  repo contain every informations concerning a package except files
-
	  (which will be in the second one) + it will compute and add a sha256
-
	  sum for each package. the cache will be in tcdb format compressed in
-
	  xz format.
-

-
- search:
-
	- will search both the remote repository to gives informations
-
	  to users
-

-
- info: 
-
	- will give to users any informations about local package
-

-
- create:
-
	- will create the package in the new format (+MANIFEST) in txz (tar.xz)
-
	  directly options to create tbz and tgz will be provided.
-
	- it should be able to create a package for a "fakeroot" directory
-
	  taking a plist or a manifest in arguments (the plist is for
-
	  compatibility which bsd.ports.mk
-

-
- delete:
-
	- will delete a package normally to be able to remove the empty
-
	  directories cleanly it will delete every directory (found in the path
-
	  of the files) that are not in the package +MTREE (mtree contains the
-
	  official hier(7)
-

-
- upgrade:
-
	- will compute the remote repository to check is there is new upgrades
-
	  available and apply them.
-

-
- update:
-
	- will fetch the remote repository cache files
-

-
- lint: 
-
	- will check for the given package and warn the user about problems :
-
	* bad prefix
-
	* setuids
-
	* etc
-

-
General behaviour:
-
the manifest contains compatibility keywords: exec, unexec which will be
-
executed as there are in pkg_install but will display a warning to show the user
-
exec/unexec is deprecated
-

-
if install and deinstall scripts are found they will be executed as they were in
-
pkg_install warning for deprecated
-

-
the new manifest format will have:
-
in case of a new install:
-
pre-install
-
post-install
-

-
in case of a pkg delete:
-
pre-uninstall
-
post-uninstall
-

-
in case of an upgrade : 
-
pre-upgrade
-
post-upgrade
-

-
they could be files +PRE-* +POST* etc
-
they could be sh string in the manifest in arrays:
-
"pre-nstall": [
-
        "/usr/sbin/pw useradd foo",
-
],
-

-
they could be both
-

-
some informations could be found here if there is conflicts in the two this file
-
is right :):
-
http://wiki.freebsd.org/Pkg_install2_specs
deleted db.txt
@@ -1,38 +0,0 @@
-
pkgdb.cache HOW TO (Draft)
-
key/value store using tinycdb
-

-
Needs:
-
- loop over all packages
-
- build depend tree for a given package
-
- find extra info for each packages
-
- request a remote database
-

-
key			value
-

-
(char*)"count"		(int)nb_packages
-
[...]
-
(int)N		(char*) package N name
-
[...]
-

-
note that packages are 0-indexed
-

-
(char*)$name			(int)N (package index)
-
(char*)$Nv				(char*)package N version
-
(char*)$Nc				(char*)package N comment
-
(char*)$Nd				(char*)package N desc
-
(char*)$No				(char*)package N origin
-

-
__future__
-

-
(char*)$Np				(char*)package N path
-
		--> fetch from $PACKAGESITE/$path etc (useless ?)
-

-
(char*)$Ns				(char*)package N checksum (for a package)
-
(char*)$ND				(char*)"$dep0-$dep0_version $dep0-$dep0_version..." package N deps
-
						} multiple values for on key ? --> TODO benchmark
-
(char*)$NC				(char*)"$conflict0 $conflict1 ..." package N conflicts
-

-
Why N -> name
-
=> to loop over all packages
-
Why name -> N
-
=> to get package depends without re-looping over all packages
added docs/TODO
@@ -0,0 +1,100 @@
+
comamnds:
+
- pkg:
+
	- one command to rule them all
+
	- each time pkg has to query the installed database it will try to first
+
	  read the cache is the cache is too old (check but last mtime of the
+
	  directory) it will regenerate the cache from installed package
+

+
- pkg_*:
+
	this will be shell script their goal is to be 100% compatible with
+
	pkg_install they will call pkg which the good options
+

+
subcommands:
+
- add:
+
	- installs a package if local package is given
+
	- manage http/ftp url to download throught libfetch a package and try to
+
	  install it.
+
	- in the two previous case, if the package as not installed dependencies
+
	  it will try to fetch/find them in the same place the original package
+
	  was.
+
	- it will manage a completely new repository format pkg add bla will
+
	  check in the database of the repository if the is a bla package and
+
	  install it as well as it's dependencies but the dependencies will be
+
	  compute before begining the fetch install process, to be sure
+
	  everything is ok.
+
	- should be able to only take a plist or a manifest in argument
+
	  considering the files are already installed
+

+
- genrepo:
+
	- takes only one argument and generate two cache files (maybe more for
+
	  the time we will be willing to work with UPDATING and MOVED) the first
+
	  repo contain every informations concerning a package except files
+
	  (which will be in the second one) + it will compute and add a sha256
+
	  sum for each package. the cache will be in tcdb format compressed in
+
	  xz format.
+

+
- search:
+
	- will search both the remote repository to gives informations
+
	  to users
+

+
- info: 
+
	- will give to users any informations about local package
+

+
- create:
+
	- will create the package in the new format (+MANIFEST) in txz (tar.xz)
+
	  directly options to create tbz and tgz will be provided.
+
	- it should be able to create a package for a "fakeroot" directory
+
	  taking a plist or a manifest in arguments (the plist is for
+
	  compatibility which bsd.ports.mk
+

+
- delete:
+
	- will delete a package normally to be able to remove the empty
+
	  directories cleanly it will delete every directory (found in the path
+
	  of the files) that are not in the package +MTREE (mtree contains the
+
	  official hier(7)
+

+
- upgrade:
+
	- will compute the remote repository to check is there is new upgrades
+
	  available and apply them.
+

+
- update:
+
	- will fetch the remote repository cache files
+

+
- lint: 
+
	- will check for the given package and warn the user about problems :
+
	* bad prefix
+
	* setuids
+
	* etc
+

+
General behaviour:
+
the manifest contains compatibility keywords: exec, unexec which will be
+
executed as there are in pkg_install but will display a warning to show the user
+
exec/unexec is deprecated
+

+
if install and deinstall scripts are found they will be executed as they were in
+
pkg_install warning for deprecated
+

+
the new manifest format will have:
+
in case of a new install:
+
pre-install
+
post-install
+

+
in case of a pkg delete:
+
pre-uninstall
+
post-uninstall
+

+
in case of an upgrade : 
+
pre-upgrade
+
post-upgrade
+

+
they could be files +PRE-* +POST* etc
+
they could be sh string in the manifest in arrays:
+
"pre-nstall": [
+
        "/usr/sbin/pw useradd foo",
+
],
+

+
they could be both
+

+
some informations could be found here if there is conflicts in the two this file
+
is right :):
+
http://wiki.freebsd.org/Pkg_install2_specs
added docs/cache_db.txt
@@ -0,0 +1,38 @@
+
pkgdb.cache HOW TO (Draft)
+
key/value store using tinycdb
+

+
Needs:
+
- loop over all packages
+
- build depend tree for a given package
+
- find extra info for each packages
+
- request a remote database
+

+
key			value
+

+
(char*)"count"		(int)nb_packages
+
[...]
+
(int)N		(char*) package N name
+
[...]
+

+
note that packages are 0-indexed
+

+
(char*)$name			(int)N (package index)
+
(char*)$Nv				(char*)package N version
+
(char*)$Nc				(char*)package N comment
+
(char*)$Nd				(char*)package N desc
+
(char*)$No				(char*)package N origin
+

+
__future__
+

+
(char*)$Np				(char*)package N path
+
		--> fetch from $PACKAGESITE/$path etc (useless ?)
+

+
(char*)$Ns				(char*)package N checksum (for a package)
+
(char*)$ND				(char*)"$dep0-$dep0_version $dep0-$dep0_version..." package N deps
+
						} multiple values for on key ? --> TODO benchmark
+
(char*)$NC				(char*)"$conflict0 $conflict1 ..." package N conflicts
+

+
Why N -> name
+
=> to loop over all packages
+
Why name -> N
+
=> to get package depends without re-looping over all packages
added docs/sample_manifest.json
@@ -0,0 +1,65 @@
+
{
+
    "pkg_format_version": "1.0",
+
    "name": "foobar",
+
    "origin": "killapp/foobar",
+
    "version": "1.2.3",
+
    "arch": "i386",
+
    "osrelease":    "8.1",
+
    "osversion":    "801500",
+
    "build_time", : 1282661958,
+
    "comment": "Foo does bar very well!",
+
    "desc": "Foo is a nice software\n\nWWW:\thttp://www.foo-bar.org",
+
    "license": "ISC",
+
    "automatic": false,
+
    "options": [
+
        "WITH_FOO": true,
+
        "WITH_BAR": false
+
    ],
+
    "deps": [
+
        {
+
            "name": "gettext",
+
            "origin": "devel/gettext",
+
            "version": ">=1.2"
+
        },
+
        {
+
            "name": "lua",
+
            "origin": "lang/lua",
+
            "version": "5.1"
+
        }
+
    ],
+
    "conflicts": [
+
    ],
+
    "pre_install": [
+
        "/usr/sbin/pw useradd foo",
+
    ],
+
    "post_install": [
+
        "/sbin/ldconfig -m /usr/local/lib",
+
    ],
+
    "pre_upgrade": [
+
    ],
+
    "post_upgrade": [
+
        "/usr/local/bin/foo_updatedb",
+
    ],
+
    "pre_uninstall": [
+
    ],
+
    "post_uninstall": [
+
        "/sbin/ldconfig -R", 
+
        "/usr/sbin/pw userdel foo",
+
    ],
+
    "unexec": [
+
    ],
+
    "exec" : [
+
    ],
+
    "files": [
+
        {
+
            "path": "bin/foobar",
+
            "md5": "68b329da9893e34099c7d8ad5cb9c940",
+
            "config": false
+
        },
+
        {
+
            "path": "etc/foobar.cfg",
+
            "md5": "68b329da9893e34099c7d8ad5cb9c940",
+
            "config": true
+
        }
+
    ]
+
}