Merge pull request #111 from Gottox/no-build-date
xbps-create: do not add a build-date property to packages.
This commit is contained in:
5
NEWS
5
NEWS
@@ -27,6 +27,11 @@ xbps-0.48 (???):
|
|||||||
extra alphanumeric characters in the `reverts' object. Added a new testcase
|
extra alphanumeric characters in the `reverts' object. Added a new testcase
|
||||||
to verify its correctness.
|
to verify its correctness.
|
||||||
|
|
||||||
|
* xbps-create(1): do not add a build-date property to packages.
|
||||||
|
|
||||||
|
* xbps-rindex(1): use mtime of file instead of the build-date field in the
|
||||||
|
package to set build-date in the repo index.
|
||||||
|
|
||||||
xbps-0.47 (2015-07-18):
|
xbps-0.47 (2015-07-18):
|
||||||
|
|
||||||
* When executing pkg configuration, override the umask with sane defaults.
|
* When executing pkg configuration, override the umask with sane defaults.
|
||||||
|
@@ -585,24 +585,6 @@ process_archive(struct archive *ar,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
set_build_date(void)
|
|
||||||
{
|
|
||||||
char outstr[64];
|
|
||||||
time_t t;
|
|
||||||
struct tm *tmp;
|
|
||||||
|
|
||||||
t = time(NULL);
|
|
||||||
tmp = localtime(&t);
|
|
||||||
assert(tmp);
|
|
||||||
|
|
||||||
if (strftime(outstr, sizeof(outstr)-1, "%F %R %Z", tmp) == 0)
|
|
||||||
die("failed to set build-date object (strftime):");
|
|
||||||
|
|
||||||
if (!xbps_dictionary_set_cstring(pkg_propsd, "build-date", outstr))
|
|
||||||
die("failed to add build-date object:");
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
@@ -778,7 +760,6 @@ main(int argc, char **argv)
|
|||||||
xbps_dictionary_set_cstring_nocopy(pkg_propsd, "version", version);
|
xbps_dictionary_set_cstring_nocopy(pkg_propsd, "version", version);
|
||||||
xbps_dictionary_set_cstring_nocopy(pkg_propsd, "pkgver", pkgver);
|
xbps_dictionary_set_cstring_nocopy(pkg_propsd, "pkgver", pkgver);
|
||||||
xbps_dictionary_set_cstring_nocopy(pkg_propsd, "short_desc", desc);
|
xbps_dictionary_set_cstring_nocopy(pkg_propsd, "short_desc", desc);
|
||||||
set_build_date();
|
|
||||||
|
|
||||||
/* Optional properties */
|
/* Optional properties */
|
||||||
if (homepage)
|
if (homepage)
|
||||||
|
@@ -37,6 +37,24 @@
|
|||||||
#include <xbps.h>
|
#include <xbps.h>
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
|
static int
|
||||||
|
set_build_date(const xbps_dictionary_t pkgd, time_t timestamp)
|
||||||
|
{
|
||||||
|
char outstr[64];
|
||||||
|
struct tm tmp;
|
||||||
|
|
||||||
|
if (!localtime_r(×tamp, &tmp))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (strftime(outstr, sizeof(outstr)-1, "%F %R %Z", &tmp) == 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (!xbps_dictionary_set_cstring(pkgd, "build-date", outstr))
|
||||||
|
return -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
index_add(struct xbps_handle *xhp, int args, int argmax, char **argv, bool force)
|
index_add(struct xbps_handle *xhp, int args, int argmax, char **argv, bool force)
|
||||||
{
|
{
|
||||||
@@ -188,6 +206,12 @@ index_add(struct xbps_handle *xhp, int args, int argmax, char **argv, bool force
|
|||||||
rv = EINVAL;
|
rv = EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
if (set_build_date(binpkgd, st.st_mtime) < 0) {
|
||||||
|
free(pkgver);
|
||||||
|
free(pkgname);
|
||||||
|
rv = EINVAL;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
/* Remove unneeded objects */
|
/* Remove unneeded objects */
|
||||||
xbps_dictionary_remove(binpkgd, "pkgname");
|
xbps_dictionary_remove(binpkgd, "pkgname");
|
||||||
xbps_dictionary_remove(binpkgd, "version");
|
xbps_dictionary_remove(binpkgd, "version");
|
||||||
|
@@ -14,7 +14,6 @@ _xbps_properties=(
|
|||||||
architecture
|
architecture
|
||||||
archive-compression-type
|
archive-compression-type
|
||||||
automatic-install
|
automatic-install
|
||||||
build-date
|
|
||||||
build-options
|
build-options
|
||||||
conf_files
|
conf_files
|
||||||
conflicts
|
conflicts
|
||||||
|
@@ -45,7 +45,6 @@ _xbps_complete() {
|
|||||||
local props='architecture
|
local props='architecture
|
||||||
archive-compression-type
|
archive-compression-type
|
||||||
automatic-install
|
automatic-install
|
||||||
build-date
|
|
||||||
build-options
|
build-options
|
||||||
conf_files
|
conf_files
|
||||||
conflicts
|
conflicts
|
||||||
|
@@ -29,10 +29,6 @@ digraph pkg_props_dictionary {
|
|||||||
instsize -> instsize_value;
|
instsize -> instsize_value;
|
||||||
instsize_value [style=filled,fillcolor="yellowgreen",label="389120"];
|
instsize_value [style=filled,fillcolor="yellowgreen",label="389120"];
|
||||||
instsize [label="installed_size"];
|
instsize [label="installed_size"];
|
||||||
main -> builddate [label="string"];
|
|
||||||
builddate [label="build_date"];
|
|
||||||
builddate -> builddate_value;
|
|
||||||
builddate_value [style=filled,fillcolor="yellowgreen",label="Friday 27 May, 2011, 06:58:13 UTC"];
|
|
||||||
main -> short_desc [label="string"]
|
main -> short_desc [label="string"]
|
||||||
short_desc -> shortdesc_val;
|
short_desc -> shortdesc_val;
|
||||||
shortdesc_val [style=filled,fillcolor="yellowgreen",label="The XBPS package system utilities"];
|
shortdesc_val [style=filled,fillcolor="yellowgreen",label="The XBPS package system utilities"];
|
||||||
|
Reference in New Issue
Block a user