Looking at snapshot files. Not sure if others might be interested.
"Michael D. Setzer II via busybox" <[email protected]> Wed, 15 Apr 2026 08:08:02 +1000
| Newsgroups | gmane.linux.busybox |
|---|---|
| Message-ID | <[email protected]> |
Get following info.
Getting index of snapshot FIles
Download each of snapshot files
Filter out the dup Files
List of non-dup files
2669749 Mar 14 10:20 busybox-20260314.tar.bz2
2671234 Mar 16 10:20 busybox-20260316.tar.bz2
2669360 Mar 17 10:20 busybox-20260317.tar.bz2
2669851 Apr 13 10:20 busybox-20260413.tar.bz2
Script that does it.
#!/bin/bash
clear
mkdir -p /tmp/snap
rm -rf /tmp/snap/a
rm -rf /tmp/snap/b
cd /tmp/snap || exit
rm index.html ./*.bz2 -f
echo "Getting index of snapshot FIles"
wget -P /tmp/snap --max-threads=1 -4 -q https://busybox.net/downloads/snapshots/
echo "Download each of snapshot files"
grep 'bz2' <index.html | cut -f6 -d\" | wget2 -P /tmp/snap --max-threads=2 -q
-4 -i - --base=https://busybox.net/downloads/snapshots/
rm index.html
echo "Filter out the dup Files"
fdupes -dNq . >/dev/null
echo "List of non-dup files"
ls -lrt | cut -b25-200 | grep "bz2"
Downloads the index.html file that includes lines for about 30+
snapshots One line too long so indented them.
The uses wget to download them all
Then uses fdupes to remove the files that are identical. Not sure
why it creates a new snapshot if it is identical to the previous one?
But that is what directory has.
Then it lists the non-dupe files. which is currenly just 4 of them.
Have another script that would run from the /tmp/snap directory
#!/bin/bash
mkdir -p a
tar -xf $1 -C a
mkdir -p b
tar -xf $2 -C b
clear
echo diff of $1 and $2
diff -rpuN a b
Example: /tmp/snap# /home/msetzerii/compbz.sh
busybox-20260317.tar.bz2 busybox-20260413.tar.bz2
And it shows differences between combination of any two of files
diff of busybox-20260317.tar.bz2 and busybox-20260413.tar.bz2
diff -rpuN a/busybox/include/libbb.h b/busybox/include/libbb.h
--- a/busybox/include/libbb.h 2026-03-16 23:49:42.000000000 +1000
+++ b/busybox/include/libbb.h 2026-04-13 00:20:09.000000000
+1000
@@ -728,8 +728,8 @@ typedef struct ioloop_state {
ioloop_state_t *io; \
int read_fd; \
int write_fd; \
- int (*have_buffer_to_read_into)(void *this); \
- int (*have_data_to_write)(void *this); \
+ int (*should_poll_read_fd)(void *this); \
+ int (*should_poll_write_fd)(void *this); \
int (*read)(void *this); \
int (*write)(void *this); \
diff -rpuN a/busybox/libbb/ioloop.c b/busybox/libbb/ioloop.c
--- a/busybox/libbb/ioloop.c 2026-03-16 23:49:42.000000000 +1000
+++ b/busybox/libbb/ioloop.c 2026-04-13 00:20:09.000000000
+1000
@@ -76,19 +76,19 @@ void FAST_FUNC ioloop_close_fd_in_all_co
}
#endif
-// have_data_to_write() - Do we have data to write?
+// should_poll_write_fd() - Should ioloop poll write_fd for
writability?
// May return error if knows that write side is closed, even if it has
free buffer space.
-// > 0: Has data to write (or can generate such data)
+// > 0: Yes, poll write_fd (has data to write, or can generate such
data)
// In this case, write_fd must be valid! (it's a bug if it is < 0, can
crash)
-// 0: No data to write currently
+// 0: No, don't poll write_fd currently
// < 0: error, I probably freed myself (do not use my structure in
this iteration,
// on next iteration, if I indeed freed myself, you won't find me in
the list).
//
-// have_buffer_to_read_into() - Is there a buffer to read into?
+// should_poll_read_fd() - Should ioloop poll read_fd for
readability?
// May return error if knows that write side is closed, even if it has
free buffer space.
-// > 0: Healthy, has buffer space, please poll read_fd
+// > 0: Yes, poll read_fd (has buffer space, healthy)
// In this case, read_fd must be valid! (it's a bug if it is < 0)
-// 0: One of:
+// 0: No, don't poll read_fd. One of:
// Buffer is full (hopefully write() will free some)
// Got error/EOF, want to drain write buffer first
// < 0: Error/EOF, I probably freed myself (do not use my
structure)
@@ -121,26 +121,26 @@ void FAST_FUNC
ioloop_close_fd_in_all_co
// Putting "this connection is dead, close+remove+free" code into
read function
// is often inconvenient: if you got EOF/error on read, you still want
to poll write side
// and try to write out the buffered data to it. Which means read()
can't "remove+free".
-// Instead, you can remember EOF/error and make future
have_buffer_to_read_into() respond 0.
+// Instead, you can remember EOF/error and make future
should_poll_read_fd() respond 0.
// One way is to close (if possible) read_fd, set it to -1 and use as a
flag.
//
// If need to support one-sided close, such as when HTTP/1.x client
sends us
// "GET / HTTP/1.1\r\n\r\n" and closes its writing side with
shutdown(SHUT_WR),
// the idiom is that when read() sees EOF, it sets conn->read_fd to
-1
-// and subsequently have_buffer_to_read_into() always return 0 (no
more attempts to read);
+// and subsequently should_poll_read_fd() always return 0 (no
more attempts to read);
// write() flushes all remaining data to conn->write_fd and then
signals EOF
// to write_fd: shutdown(SHUT_WR) for sockets, close() for pipes
// (how to do this for ptys!?).
-// After this, have_data_to_write() can return 0 if fd has to stay
open (socket)
+// After this, should_poll_write_fd() can return 0 if fd has to stay
open (socket)
// or can return -1 and free itself if fd is closed.
-static ALWAYS_INLINE int have_data_to_write(connection_t
*conn)
+static ALWAYS_INLINE int should_poll_write_fd(connection_t
*conn)
{
- return conn->have_data_to_write(conn);
+ return conn->should_poll_write_fd(conn);
}
-static ALWAYS_INLINE int have_buffer_to_read_into(connection_t
*conn)
+static ALWAYS_INLINE int should_poll_read_fd(connection_t
*conn)
{
- return conn->have_buffer_to_read_into(conn);
+ return conn->should_poll_read_fd(conn);
}
static ALWAYS_INLINE int write_from_buf(connection_t *conn)
{
@@ -177,7 +177,7 @@ int FAST_FUNC ioloop_run(ioloop_state_t
int rcw, rcr;
next = conn->next; /* in case conn is freed */
- rcw = have_data_to_write(conn);
+ rcw = should_poll_write_fd(conn);
if (rcw < 0) {
/* often indicates that conn is gone (freed), do not use it
anymore */
goto next;
@@ -186,7 +186,7 @@ int FAST_FUNC ioloop_run(ioloop_state_t
* the *reader* may decide to abort (return rcr < 0)!
* Check it first:
*/
- rcr = have_buffer_to_read_into(conn);
+ rcr = should_poll_read_fd(conn);
if (rcr < 0)
goto next;
if (rcw > 0) {
diff -rpuN a/busybox/networking/telnet.c
b/busybox/networking/telnet.c
--- a/busybox/networking/telnet.c 2026-03-16 23:49:42.000000000
+1000
+++ b/busybox/networking/telnet.c 2026-04-13
00:20:09.000000000 +1000
@@ -576,7 +576,7 @@ static void show_menu(void)
cookmode();
}
-static int have_buffer_to_read_from_stdin(void *this)
+static int should_poll_read_fd_stdin(void *this)
{
stdin_to_net_t *conn = this;
if (conn->read_fd < 0)
@@ -656,7 +656,7 @@ static int read_from_stdin(void *this)
return count;
}
-static int have_data_to_write_to_net(void *this)
+static int should_poll_write_fd_net(void *this)
{
stdin_to_net_t *conn = this;
if (conn->size == 0 && conn->read_fd < 0) {
@@ -700,7 +700,7 @@ static int write_to_net(void *this)
return count;
}
-static int have_buffer_to_read_from_net(void *this)
+static int should_poll_read_fd_net(void *this)
{
net_to_stdout_t *conn = this;
if (conn->read_fd < 0)
@@ -897,7 +897,7 @@ static int read_from_net(void *this)
return count;
}
-static int have_data_to_write_to_stdout(void *this)
+static int should_poll_write_fd_stdout(void *this)
{
net_to_stdout_t *conn = this;
if (conn->size == 0 && conn->read_fd < 0) {
@@ -988,16 +988,16 @@ int telnet_main(int argc
UNUSED_PARAM, c
signal(SIGPIPE, SIG_IGN);
// Initialize connections
- G.conn_stdin2net.have_buffer_to_read_into =
have_buffer_to_read_from_stdin;
- G.conn_stdin2net.have_data_to_write =
have_data_to_write_to_net;
+ G.conn_stdin2net.should_poll_read_fd =
should_poll_read_fd_stdin;
+ G.conn_stdin2net.should_poll_write_fd =
should_poll_write_fd_net;
G.conn_stdin2net.read = read_from_stdin;
G.conn_stdin2net.write = write_to_net;
if (STDIN_FILENO != 0)
G.conn_stdin2net.read_fd = STDIN_FILENO;
G.conn_stdin2net.write_fd = netfd;
- G.conn_net2stdout.have_buffer_to_read_into =
have_buffer_to_read_from_net;
- G.conn_net2stdout.have_data_to_write =
have_data_to_write_to_stdout;
+ G.conn_net2stdout.should_poll_read_fd =
should_poll_read_fd_net;
+ G.conn_net2stdout.should_poll_write_fd =
should_poll_write_fd_stdout;
G.conn_net2stdout.read = read_from_net;
G.conn_net2stdout.write = write_to_stdout;
G.conn_net2stdout.read_fd = netfd;
diff -rpuN a/busybox/networking/telnetd.c
b/busybox/networking/telnetd.c
--- a/busybox/networking/telnetd.c 2026-03-16
23:49:42.000000000 +1000
+++ b/busybox/networking/telnetd.c 2026-04-13
00:20:09.000000000 +1000
@@ -279,8 +279,8 @@ static void ALWAYS_INLINE
remove_and_fre
// Theory of operation
// (AKA "when should I close fds? when should I detach from
ioloop?").
// The fds are named read_fd and write_fd, but for clarity let's call
them netfd and ptyfd.
-// net_to_pty::have_data_to_write
-// net_to_pty::have_buffer_to_read_into
+// net_to_pty::should_poll_write_fd
+// net_to_pty::should_poll_read_fd
// if ptyfd < 0: //sibling told us ptyfd is down?
// if sibling && sibling->netfd >= 0: netfd = -1; //do not close
netfd, sibling uses it (if sibling exists)!
// close_and_detach;
@@ -308,7 +308,7 @@ static unsigned char read_byte_unescapin
return c;
}
-static int net_to_pty__have_data_to_write(void *this)
+static int net_to_pty__should_poll_write_fd(void *this)
{
//connection_t *conn = this;
net_to_pty_t *ts = this;
@@ -471,7 +471,7 @@ static int net_to_pty__write(void *this)
found = memchr(buf, IAC, wr);
if (found == buf) {
/* The first char is IAC.
- * have_data_to_write() ensures we are only called this way
+ * should_poll_write_fd() ensures we are only called this way
* if there are two IACs.
* It also ensures the buffer is not wrapping within 7 chars.
* Write one IAC. If that works, skip both.
@@ -524,7 +524,7 @@ static int net_to_pty__write(void *this)
}
/* Check if buffer has space to read into */
-static int net_to_pty__have_buffer_to_read_into(void *this)
+static int net_to_pty__should_poll_read_fd(void *this)
{
//connection_t *conn = this;
net_to_pty_t *ts = this;
@@ -619,17 +619,17 @@ static int net_to_pty__read(void *this)
static net_to_pty_t *new_net_to_pty(int from, int to)
{
net_to_pty_t *this = xzalloc(sizeof(*this) + TO_PTY_BUFSIZE);
- this->have_buffer_to_read_into =
net_to_pty__have_buffer_to_read_into;
- this->have_data_to_write =
net_to_pty__have_data_to_write;
- this->read = net_to_pty__read;
- this->write = net_to_pty__write;
+ this->should_poll_read_fd = net_to_pty__should_poll_read_fd;
+ this->should_poll_write_fd =
net_to_pty__should_poll_write_fd;
+ this->read = net_to_pty__read;
+ this->write = net_to_pty__write;
this->read_fd = from;
this->write_fd = to;
/* indexes and size are all 0 */
return this;
}
-static int pty_to_net__have_buffer_to_read_into(void *this)
+static int pty_to_net__should_poll_read_fd(void *this)
{
//connection_t *conn = this;
pty_to_net_t *ts = this;
@@ -725,7 +725,7 @@ static int pty_to_net__read(void *this)
return count;
}
-static int pty_to_net__have_data_to_write(void *this)
+static int pty_to_net__should_poll_write_fd(void *this)
{
pty_to_net_t *ts = this;
if (ts->size == 0) {
@@ -832,10 +832,10 @@ static int pty_to_net__write(void *this)
static pty_to_net_t *new_pty_to_net(int from, int to)
{
pty_to_net_t *this = xzalloc(sizeof(*this) +
TO_NET_BUFSIZE);
- this->have_buffer_to_read_into =
pty_to_net__have_buffer_to_read_into;
- this->have_data_to_write =
pty_to_net__have_data_to_write;
- this->read = pty_to_net__read;
- this->write = pty_to_net__write;
+ this->should_poll_read_fd = pty_to_net__should_poll_read_fd;
+ this->should_poll_write_fd =
pty_to_net__should_poll_write_fd;
+ this->read = pty_to_net__read;
+ this->write = pty_to_net__write;
this->read_fd = from;
this->write_fd = to;
/* indexes and size are all 0 */
@@ -1013,10 +1013,10 @@ static int
accept_conn__return_zero(void
static struct accept_conn *new_accept_conn(int fd)
{
struct accept_conn *this = xzalloc(sizeof(*this));
- this->have_buffer_to_read_into = accept_conn__can_accept;
- this->have_data_to_write = accept_conn__return_zero;
- this->read = accept_conn__accept;
- //this->write = accept_conn__return_zero; //never
called
+ this->should_poll_read_fd = accept_conn__can_accept;
+ this->should_poll_write_fd = accept_conn__return_zero;
+ this->read = accept_conn__accept;
+ //this->write = accept_conn__return_zero; //never
called
this->read_fd = fd;
this->write_fd = -1;
return this;
Don't know who is authorized to make changes?
Assume it is only a limited set of people.
Don't know why no responses about main page issues?
Thanks. Probable be last post, unless see some real response to
messages. Have to assume git 1.38 is actual valid.
+------------------------------------------------------------+
Michael D. Setzer II - Computer Science Instructor (Retired)
mailto:[email protected]
mailto:[email protected]
mailto:[email protected]
Guam - Where America's Day Begins
G4L Disk Imaging Project maintainer
http://sourceforge.net/projects/g4l/
+------------------------------------------------------------+
_______________________________________________
busybox mailing list
[email protected]
https://lists.busybox.net/mailman/listinfo/busybox