mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-13 06:45:24 +01:00
Fix packaging issues
* Bzip2 was manually installed directly into filesystem, so bzip2 package was empty. Fixed by installing it to destdir. bzip2 moves out its binary before installing its own package. * sha256sum from stage0-posix was not checking any checksums because it does not accept piped input. Fixed by using temporary file. * grep was broken for a short time (but with fixed bzip2 package this caused failures) due to touch creating grep file of zero size (egrep symlink was touched). Fixed by implementing touch -h Resolves #156, resolves #166, resolves #167
This commit is contained in:
parent
3e4f823ffb
commit
21f4174dc3
12 changed files with 136 additions and 31 deletions
|
|
@ -44,7 +44,7 @@ c4dfcec63607cf44a4f64a2673892a38c6b5a7aa9821d12c9abe9cf63126ee39 /usr/bin/tr
|
|||
0c7288eb7dfc707723ef9653be06f49b3b458e22b53f8172733870f612fb0135 /usr/bin/wc
|
||||
a92eb5a6e8413bf580718c0fddaac7821a68a8e7918a930c4cb36a2c666d3720 /usr/bin/whoami
|
||||
2b6fc3790a81835001001c5b1e0d7f368720288da55241eef9485888db86edb3 /usr/bin/test
|
||||
b770b43dc01c8403c5c0c9522e4f2bb851dfaaf8d7a1c45e6ae449f45ee5171a /usr/bin/touch
|
||||
042efa219eb798c0308259566fe12b161c8349b9d50fe9e02bb74993a07bf91a /usr/bin/touch
|
||||
19dc29f6b439546fc113286d09bf5ba6c83663e03037225a6884f66790f5820f /usr/bin/true
|
||||
813d000327b025a0eb17d7a1dd1a2608b78dfa383c6a175ec36d39a28f4e2889 /usr/bin/yes
|
||||
9fe71e506ad02f545b55fba003f6fdf91adb28471fc3081fd49100073e51e018 /usr/bin/ls
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ patch -Np0 -i ../../patches/modechange.patch
|
|||
patch -Np0 -i ../../patches/mbstate.patch
|
||||
patch -Np0 -i ../../patches/ls-strcmp.patch
|
||||
patch -Np0 -i ../../patches/touch-getdate.patch
|
||||
patch -Np0 -i ../../patches/touch-dereference.patch
|
||||
|
||||
# Build and install
|
||||
make -f Makefile PREFIX=${prefix}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
cp lib/fnmatch_.h lib/fnmatch.h
|
||||
cp lib/ftw_.h lib/ftw.h
|
||||
cp lib/search_.h lib/search.h
|
||||
touch config.h
|
||||
|
||||
patch -Np0 -i ../../patches/touch-getdate.patch
|
||||
|
||||
# Bison pre-generated file
|
||||
rm lib/getdate.c
|
||||
|
||||
|
|
|
|||
1
sysa/coreutils-5.0/patches-musl/touch-dereference.patch
Symbolic link
1
sysa/coreutils-5.0/patches-musl/touch-dereference.patch
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../patches/touch-dereference.patch
|
||||
1
sysa/coreutils-5.0/patches-musl/touch-getdate.patch
Symbolic link
1
sysa/coreutils-5.0/patches-musl/touch-getdate.patch
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../patches/touch-getdate.patch
|
||||
97
sysa/coreutils-5.0/patches/touch-dereference.patch
Normal file
97
sysa/coreutils-5.0/patches/touch-dereference.patch
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
|
||||
SPDX-FileCopyrightText: 2009 Eric Blake <ebb9@byu.net>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
touch: add -h to change symlink timestamps, where supported
|
||||
|
||||
diff -r -U3 coreutils-5.0.orig/src/touch.c coreutils-5.0/src/touch.c
|
||||
--- src/touch.c 2002-12-20 20:09:22.000000000 +0000
|
||||
+++ src/touch.c 2022-05-16 20:31:37.801988595 +0100
|
||||
@@ -77,6 +77,9 @@
|
||||
/* (-r) If nonzero, use times from a reference file. */
|
||||
static int use_ref;
|
||||
|
||||
+/* (-h) If true, change the times of an existing symlink, if possible. */
|
||||
+static int no_dereference;
|
||||
+
|
||||
/* (-t) If nonzero, date supplied on command line in POSIX format. */
|
||||
static int posix_date;
|
||||
|
||||
@@ -110,6 +113,7 @@
|
||||
{"date", required_argument, 0, 'd'},
|
||||
{"file", required_argument, 0, 'r'}, /* FIXME: phase out --file */
|
||||
{"reference", required_argument, 0, 'r'},
|
||||
+ {"no-dereference", no_argument, NULL, 'h'},
|
||||
{GETOPT_HELP_OPTION_DECL},
|
||||
{GETOPT_VERSION_OPTION_DECL},
|
||||
{0, 0, 0, 0}
|
||||
@@ -138,7 +142,7 @@
|
||||
int fd = -1;
|
||||
int open_errno = 0;
|
||||
|
||||
- if (! no_create)
|
||||
+ if (! (no_create || no_dereference))
|
||||
{
|
||||
/* Try to open FILE, creating it if necessary. */
|
||||
fd = open (file, O_WRONLY | O_CREAT | O_NONBLOCK | O_NOCTTY,
|
||||
@@ -158,7 +162,7 @@
|
||||
the other one. If we have the file descriptor already, use fstat.
|
||||
Otherwise, either we're in no-create mode (and hence didn't call open)
|
||||
or FILE is inaccessible or a directory, so we have to use stat. */
|
||||
- if (fd != -1 ? fstat (fd, &sbuf) : stat (file, &sbuf))
|
||||
+ if (fd != -1 ? fstat (fd, &sbuf) : (no_dereference ? lstat (file, &sbuf) : stat (file, &sbuf)))
|
||||
{
|
||||
if (open_errno)
|
||||
error (0, open_errno, _("creating %s"), quote (file));
|
||||
@@ -223,7 +227,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (no_create && errno == ENOENT)
|
||||
+ if ((no_create || no_dereference) && errno == ENOENT)
|
||||
return 0;
|
||||
error (0, errno, _("setting times of %s"), quote (file));
|
||||
}
|
||||
@@ -254,6 +258,9 @@
|
||||
-c, --no-create do not create any files\n\
|
||||
-d, --date=STRING parse STRING and use it instead of current time\n\
|
||||
-f (ignored)\n\
|
||||
+ -h, --no-dereference affect each symbolic link instead of any referenced\n\
|
||||
+ file (useful only on systems that can change the\n\
|
||||
+ timestamps of a symlink)\n\
|
||||
-m change only the modification time\n\
|
||||
"), stdout);
|
||||
fputs (_("\
|
||||
@@ -289,7 +296,7 @@
|
||||
|
||||
change_times = no_create = use_ref = posix_date = flexible_date = 0;
|
||||
|
||||
- while ((c = getopt_long (argc, argv, "acd:fmr:t:", longopts, NULL)) != -1)
|
||||
+ while ((c = getopt_long (argc, argv, "acd:fhmr:t:", longopts, NULL)) != -1)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
@@ -315,6 +322,10 @@
|
||||
case 'f':
|
||||
break;
|
||||
|
||||
+ case 'h':
|
||||
+ no_dereference = true;
|
||||
+ break;
|
||||
+
|
||||
case 'm':
|
||||
change_times |= CH_MTIME;
|
||||
break;
|
||||
@@ -358,7 +369,10 @@
|
||||
|
||||
if (use_ref)
|
||||
{
|
||||
- if (stat (ref_file, &ref_stats))
|
||||
+ /* Don't use (no_dereference ? lstat : stat) (args), since stat
|
||||
+ might be an object-like macro. */
|
||||
+ if (no_dereference ? lstat (ref_file, &ref_stats)
|
||||
+ : stat (ref_file, &ref_stats))
|
||||
error (EXIT_FAILURE, errno,
|
||||
_("failed to get attributes of %s"), quote (ref_file));
|
||||
date_set++;
|
||||
Loading…
Add table
Add a link
Reference in a new issue