From d063e63bbb9fda4a1fc174f83987ba9249001d18 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 20 Nov 2012 04:21:26 +0100 Subject: [PATCH] xbps-create: new option -G, --source-revisions; mainly for xbps-src use. --- bin/xbps-create/main.c | 10 +++++++++- bin/xbps-create/xbps-create.8 | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/xbps-create/main.c b/bin/xbps-create/main.c index 4a41a45a..df302eb9 100644 --- a/bin/xbps-create/main.c +++ b/bin/xbps-create/main.c @@ -522,10 +522,11 @@ set_build_date(void) int main(int argc, char **argv) { - const char *shortopts = "A:B:C:D:F:H:hl:M:m:n:P:pqR:S:s:V"; + const char *shortopts = "A:B:C:D:F:G:H:hl:M:m:n:P:pqR:S:s:V"; const struct option longopts[] = { { "architecture", required_argument, NULL, 'A' }, { "built-with", required_argument, NULL, 'B' }, + { "source-revisions", required_argument, NULL, 'G' }, { "conflicts", required_argument, NULL, 'C' }, { "dependencies", required_argument, NULL, 'D' }, { "config-files", required_argument, NULL, 'F' }, @@ -549,6 +550,7 @@ main(int argc, char **argv) const char *conflicts, *deps, *homepage, *license, *maint, *bwith; const char *provides, *pkgver, *replaces, *desc, *ldesc; const char *arch, *config_files, *mutable_files, *version; + const char *srcrevs = NULL; char *pkgname, *binpkg, *tname, *p, cwd[PATH_MAX-1]; bool quiet = false, preserve = false; int c, pkg_fd; @@ -578,6 +580,9 @@ main(int argc, char **argv) case 'F': config_files = optarg; break; + case 'G': + srcrevs = optarg; + break; case 'h': usage(); break; @@ -677,6 +682,9 @@ main(int argc, char **argv) if (bwith) prop_dictionary_set_cstring_nocopy(pkg_propsd, "packaged-with", bwith); + if (srcrevs) + prop_dictionary_set_cstring_nocopy(pkg_propsd, + "source-revisions", srcrevs); if (preserve) prop_dictionary_set_bool(pkg_propsd, "preserve", true); diff --git a/bin/xbps-create/xbps-create.8 b/bin/xbps-create/xbps-create.8 index b423a1fb..8b521c3b 100644 --- a/bin/xbps-create/xbps-create.8 +++ b/bin/xbps-create/xbps-create.8 @@ -1,4 +1,4 @@ -.Dd November 6, 2012 +.Dd November 20, 2012 .Os Void Linux .Dt xbps-create 8 .Sh NAME @@ -34,6 +34,9 @@ blank. Example: .It Fl F, Fl -config-files Ar list A list of configuration files this package provides, separated by a single blank. +.It Fl G, Fl --source-revisions Ar string +This justs sets a string with the git revisions of the sourcepkg that +was used to build this binary package. It is set automatically by xbps-src. .It Fl H, Fl -homepage Ar string The package homepage string. .It Fl h, Fl -help