[gentoo-commits] repo/gentoo:master commit in: dev-libs/libnl/, dev-libs/libnl/files/

2022-04-21 Thread Sam James
commit: 4d6d5918a4ed8600271110fcc9e3fe5e96062af6
Author: Sam James  gentoo  org>
AuthorDate: Thu Apr 21 23:01:49 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Apr 21 23:01:59 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d6d5918

dev-libs/libnl: keyword 3.6.0 (w/ test fixes)

Signed-off-by: Sam James  gentoo.org>

 .../files/libnl-3.6.0-test-fixes-sandbox.patch | 160 +
 dev-libs/libnl/libnl-3.6.0.ebuild  |   8 +-
 2 files changed, 164 insertions(+), 4 deletions(-)

diff --git a/dev-libs/libnl/files/libnl-3.6.0-test-fixes-sandbox.patch 
b/dev-libs/libnl/files/libnl-3.6.0-test-fixes-sandbox.patch
new file mode 100644
index ..deb60069955c
--- /dev/null
+++ b/dev-libs/libnl/files/libnl-3.6.0-test-fixes-sandbox.patch
@@ -0,0 +1,160 @@
+https://github.com/thom311/libnl/issues/308
+https://github.com/thom311/libnl/commit/85e3c5d423a0ab8f8414f892998323c886484725
+https://github.com/thom311/libnl/commit/ec712a4514e667b6f7fc3a54a10d4d4f65d1b5c7
+https://github.com/thom311/libnl/commit/7577266c03ddbf42257f6c43f42e5837a2671038
+
+From 85e3c5d423a0ab8f8414f892998323c886484725 Mon Sep 17 00:00:00 2001
+From: Thomas Haller 
+Date: Thu, 21 Apr 2022 08:39:51 +0200
+Subject: [PATCH] tests: add _assert_nltst_netns() helper
+
+--- a/tests/nl-test-util.c
 b/tests/nl-test-util.c
+@@ -25,6 +25,14 @@ struct nltst_netns {
+ 
+ 
/*/
+ 
++#define _assert_nltst_netns(nsdata)   
 \
++  do {   \
++  const struct nltst_netns *_nsdata = (nsdata);  \
++  
 \
++  ck_assert_ptr_nonnull(_nsdata);\
++  ck_assert_int_eq(_nsdata->canary, _CANARY);\
++  } while (0)
++
+ static struct {
+   struct nltst_netns *nsdata;
+ } _netns_fixture_global;
+@@ -34,12 +42,12 @@ void nltst_netns_fixture_setup(void)
+   ck_assert(!_netns_fixture_global.nsdata);
+ 
+   _netns_fixture_global.nsdata = nltst_netns_enter();
+-  ck_assert(_netns_fixture_global.nsdata);
++  _assert_nltst_netns(_netns_fixture_global.nsdata);
+ }
+ 
+ void nltst_netns_fixture_teardown(void)
+ {
+-  ck_assert(_netns_fixture_global.nsdata);
++  _assert_nltst_netns(_netns_fixture_global.nsdata);
+   _nl_clear_pointer(&_netns_fixture_global.nsdata, nltst_netns_leave);
+ }
+ 
+From ec712a4514e667b6f7fc3a54a10d4d4f65d1b5c7 Mon Sep 17 00:00:00 2001
+From: Thomas Haller 
+Date: Thu, 21 Apr 2022 08:41:03 +0200
+Subject: [PATCH] tests: cleanup unshare_user() and use _nltst_fclose()
+
+--- a/tests/nl-test-util.c
 b/tests/nl-test-util.c
+@@ -65,24 +65,27 @@ static void unshare_user(void)
+   _nltst_assert_errno(r == 0);
+ 
+   /* Since Linux 3.19 we have to disable setgroups() in order to map 
users.
+- * Just proceed if the file is not there. */
++   * Just proceed if the file is not there. */
+   f = fopen("/proc/self/setgroups", "we");
+   if (f) {
+-  fprintf(f, "deny");
+-  fclose(f);
++  r = fprintf(f, "deny");
++  _nltst_assert_errno(r > 0);
++  _nltst_fclose(f);
+   }
+ 
+   /* Map current UID to root in NS to be created. */
+   f = fopen("/proc/self/uid_map", "we");
+-  ck_assert(f);
+-  fprintf(f, "0 %d 1", uid);
+-  fclose(f);
++  _nltst_assert_errno(f);
++  r = fprintf(f, "0 %d 1", uid);
++  _nltst_assert_errno(r > 0);
++  _nltst_fclose(f);
+ 
+   /* Map current GID to root in NS to be created. */
+   f = fopen("/proc/self/gid_map", "we");
+-  ck_assert(f);
+-  fprintf(f, "0 %d 1", gid);
+-  fclose(f);
++  _nltst_assert_errno(f);
++  r = fprintf(f, "0 %d 1", gid);
++  _nltst_assert_errno(r > 0);
++  _nltst_fclose(f);
+ }
+ 
+ struct nltst_netns *nltst_netns_enter(void)
+--- a/tests/nl-test-util.h
 b/tests/nl-test-util.h
+@@ -34,6 +34,14 @@
+   _nltst_assert_errno(_r == 0);  \
+   } while (0)
+ 
++#define _nltst_fclose(f)  
 \
++  do {   \
++  int _r;\
++  
 \
++  _r = fclose((f));  \
++  _nltst_assert_errno(_r == 0);  \
++  } while (0)
++
+ 
/*/
+ 
+ void nltst_netns_fixture_setup(void);
+From 7577266c03ddbf42257f6c43f42e5837a2671038 

[gentoo-commits] repo/gentoo:master commit in: dev-libs/libnl/, dev-libs/libnl/files/

2022-04-15 Thread Sam James
commit: c7d8da15ca9547f2a88df43fa995e335e7a0c7fd
Author: Sam James  gentoo  org>
AuthorDate: Sat Apr 16 02:07:53 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Apr 16 02:09:24 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7d8da15

dev-libs/libnl: add 3.6.0 (unkeyworded)

Unkeyworded for now until test failure investigated (reported
upstream).

Bug: https://github.com/thom311/libnl/issues/308
Signed-off-by: Sam James  gentoo.org>

 dev-libs/libnl/Manifest|   1 +
 .../libnl/files/libnl-3.6.0-static-tests.patch |  37 +++
 dev-libs/libnl/libnl-3.6.0.ebuild  | 107 +
 3 files changed, 145 insertions(+)

diff --git a/dev-libs/libnl/Manifest b/dev-libs/libnl/Manifest
index a9a95c9c88d1..94fe71f27f45 100644
--- a/dev-libs/libnl/Manifest
+++ b/dev-libs/libnl/Manifest
@@ -1 +1,2 @@
 DIST libnl-3.5.0.tar.gz 967835 BLAKE2B 
cf21c1ffa89799b91bf4bddb8833d5af5c62eb1c53a078ee55a2888bd8439e1ae6db8886c9c4f937297962faac6873b4cf5211ee3d1e5354d96b5dc545a6fc2d
 SHA512 
9c94c09bac34297493b3ea482713d7c0865d2839b5042e5c7d1ed008e2402ab63df35a18e272f40b2cce27d0c31dc733fe7e4b2d376e7ca847a2b0d5e90de50c
+DIST libnl-3.6.0.tar.gz 981921 BLAKE2B 
4fbc1f6284dfbf0aaa855dfc3bb9774327254718257cf162c14574ece6b0da20f03a587830b21a2481d1da6e9c90482d71d8f9308f1eeafa605c90d0847a838c
 SHA512 
7d1190ce94f43f5b18b1f7909221ca034d4ea5c8ed5735dbd27224d03e7f95d3c4e8ccdb611e33b58007729a21bfc0e23adc8758b112c712355664d87a81ce1b

diff --git a/dev-libs/libnl/files/libnl-3.6.0-static-tests.patch 
b/dev-libs/libnl/files/libnl-3.6.0-static-tests.patch
new file mode 100644
index ..be406705e1d7
--- /dev/null
+++ b/dev-libs/libnl/files/libnl-3.6.0-static-tests.patch
@@ -0,0 +1,37 @@
+From: Thomas Haller 
+Date: Fri, 15 Apr 2022 13:29:49 +0200
+Subject: [PATCH] build: avoid building check-direct with --disable-static
+
+"check-direct" needs to statically link with the libraries, because
+it wants to test internal ABI, which is hidden in the share libraries.
+When configuring with "--disable-static", static libs are not build
+and the test tool cannot be build.
+
+Just skip the test in that case.
+
+https://github.com/thom311/libnl/issues/306
+--- a/Makefile.am
 b/Makefile.am
+@@ -984,8 +984,10 @@ tests_check_all_LDADD = \
+   $(NULL)
+ 
+ if WITH_CHECK
++if ENABLE_STATIC
+ check_programs += tests/check-direct
+ endif
++endif
+ 
+ tests_check_direct_SOURCES = \
+   tests/check-direct.c \
+--- a/configure.ac
 b/configure.ac
+@@ -107,6 +107,8 @@ else
+ AC_CHECK_LIB([pthread], [pthread_mutex_lock], [], 
AC_MSG_ERROR([libpthread is required]))
+ fi
+ 
++AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" != "no"])
++
+ AC_ARG_ENABLE([debug],
+   AS_HELP_STRING([--disable-debug], [Do not include debugging 
statements]),
+   [enable_debug="$enableval"], [enable_debug="yes"])
+

diff --git a/dev-libs/libnl/libnl-3.6.0.ebuild 
b/dev-libs/libnl/libnl-3.6.0.ebuild
new file mode 100644
index ..5c1aeb096def
--- /dev/null
+++ b/dev-libs/libnl/libnl-3.6.0.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+DISTUTILS_OPTIONAL=1
+inherit autotools distutils-r1 multilib-minimal
+
+LIBNL_P=${P/_/-}
+LIBNL_DIR=${PV/_/}
+LIBNL_DIR=${LIBNL_DIR//./_}
+
+DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel 
interfaces"
+HOMEPAGE="https://www.infradead.org/~tgr/libnl/ 
https://github.com/thom311/libnl;
+SRC_URI="https://github.com/thom311/${PN}/releases/download/${PN}${LIBNL_DIR}/${P/_rc/-rc}.tar.gz;
+S="${WORKDIR}/${LIBNL_P}"
+
+LICENSE="LGPL-2.1 utils? ( GPL-2 )"
+SLOT="3"
+# Test failure: https://github.com/thom311/libnl/issues/308
+#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="+debug python test utils"
+RESTRICT="!test? ( test )"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}"
+BDEPEND="${RDEPEND}
+   sys-devel/bison
+   sys-devel/flex
+   python? ( dev-lang/swig )
+   test? ( dev-libs/check )"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DOCS=( ChangeLog )
+
+MULTILIB_WRAPPED_HEADERS=(
+   # we do not install CLI stuff for non-native
+   /usr/include/libnl3/netlink/cli/addr.h
+   /usr/include/libnl3/netlink/cli/class.h
+   /usr/include/libnl3/netlink/cli/cls.h
+   /usr/include/libnl3/netlink/cli/ct.h
+   /usr/include/libnl3/netlink/cli/exp.h
+   /usr/include/libnl3/netlink/cli/link.h
+   /usr/include/libnl3/netlink/cli/neigh.h
+   /usr/include/libnl3/netlink/cli/qdisc.h
+   /usr/include/libnl3/netlink/cli/route.h
+   /usr/include/libnl3/netlink/cli/rule.h
+   /usr/include/libnl3/netlink/cli/tc.h
+   /usr/include/libnl3/netlink/cli/utils.h
+)
+
+PATCHES=(
+   

[gentoo-commits] repo/gentoo:master commit in: dev-libs/libnl/, dev-libs/libnl/files/

2020-09-20 Thread Jeroen Roovers
commit: 517511aef659389b22436c428726f022d1f74c9b
Author: Jeroen Roovers  gentoo  org>
AuthorDate: Sun Sep 20 13:00:52 2020 +
Commit: Jeroen Roovers  gentoo  org>
CommitDate: Sun Sep 20 13:01:30 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=517511ae

dev-libs/libnl: Fix python byte-compiling

Package-Manager: Portage-3.0.7, Repoman-3.0.1
Fixes: 78ae57786c33fa78e0932185e30a8a0ab9faa75f
Signed-off-by: Jeroen Roovers  gentoo.org>

 dev-libs/libnl/files/libnl--2to3.patch | 42 ++
 dev-libs/libnl/libnl-.ebuild   | 28 +++--
 2 files changed, 61 insertions(+), 9 deletions(-)

diff --git a/dev-libs/libnl/files/libnl--2to3.patch 
b/dev-libs/libnl/files/libnl--2to3.patch
new file mode 100644
index 000..66a16406d78
--- /dev/null
+++ b/dev-libs/libnl/files/libnl--2to3.patch
@@ -0,0 +1,42 @@
+--- a/python/netlink/route/links/bridge.py
 b/python/netlink/route/links/bridge.py
+@@ -6,7 +6,7 @@
+ 
+ """
+ 
+-from __future__ import absolute_import
++
+ 
+ from ... import core as netlink
+ from ..  import capi as capi
+@@ -19,10 +19,10 @@
+ 
+ def bridge_assert_ext_info(self):
+ if self._has_ext_info == False:
+-print """
++print("""
+ Please update your kernel to be able to call this method.
+ Your current kernel bridge version is too old to support this 
extention.
+-"""
++""")
+ raise RuntimeWarning()
+ 
+ def port_state2str(self, state):
+--- a/doc/resolve-asciidoc-refs.py
 b/doc/resolve-asciidoc-refs.py
+@@ -22,4 +22,4 @@
+ 
+ rc = re.compile('|'.join(map(re.escape, sorted(refs, reverse=True
+ for line in open(sys.argv[1], 'r'):
+-  print rc.sub(translate, line),
++  print(rc.sub(translate, line), end=' ')
+--- a/doc/doxygen-link.py
 b/doc/doxygen-link.py
+@@ -1,6 +1,6 @@
+ #!/usr/bin/env python
+ 
+-from __future__ import print_function
++
+ import fileinput
+ import re
+ import sys

diff --git a/dev-libs/libnl/libnl-.ebuild 
b/dev-libs/libnl/libnl-.ebuild
index 52f318b2f91..cf078de887a 100644
--- a/dev-libs/libnl/libnl-.ebuild
+++ b/dev-libs/libnl/libnl-.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6,7,8} )
 DISTUTILS_OPTIONAL=1
-inherit autotools distutils-r1 git-r3 libtool multilib multilib-minimal
+inherit autotools distutils-r1 git-r3 multilib-minimal
 
 DESCRIPTION="Libraries providing APIs to netlink protocol based Linux kernel 
interfaces"
 HOMEPAGE="http://www.infradead.org/~tgr/libnl/ 
https://github.com/thom311/libnl;
@@ -23,19 +23,16 @@ DEPEND="
 "
 BDEPEND="
${RDEPEND}
-   python? ( dev-lang/swig )
sys-devel/bison
sys-devel/flex
+   python? ( dev-lang/swig )
 "
-
 REQUIRED_USE="
python? ( ${PYTHON_REQUIRED_USE} )
 "
-
 DOCS=(
ChangeLog
 )
-
 MULTILIB_WRAPPED_HEADERS=(
# we do not install CLI stuff for non-native
/usr/include/libnl3/netlink/cli/addr.h
@@ -51,6 +48,9 @@ MULTILIB_WRAPPED_HEADERS=(
/usr/include/libnl3/netlink/cli/tc.h
/usr/include/libnl3/netlink/cli/utils.h
 )
+PATCHES=(
+   "${FILESDIR}"/${PN}--2to3.patch
+)
 
 src_prepare() {
default
@@ -58,8 +58,9 @@ src_prepare() {
eautoreconf
 
if use python; then
-   cd "${S}"/python || die
+   pushd "${S}"/python > /dev/null || die
distutils-r1_src_prepare
+   popd > /dev/null || die
fi
 
# out-of-source build broken
@@ -72,15 +73,17 @@ multilib_src_configure() {
$(multilib_native_use_enable utils cli) \
$(use_enable debug) \
$(use_enable static-libs static) \
-   $(use_enable threads)
+   $(use_enable threads) \
+   --disable-doc
 }
 
 multilib_src_compile() {
default
 
if multilib_is_native_abi && use python; then
-   cd python || die
+   pushd python > /dev/null || die
distutils-r1_src_compile
+   popd > /dev/null || die
fi
 }
 
@@ -90,8 +93,15 @@ multilib_src_install() {
if multilib_is_native_abi && use python; then
# Unset DOCS= since distutils-r1.eclass interferes
local DOCS=()
-   cd python || die
+
+   pushd python > /dev/null || die
+
distutils-r1_src_install
+
+   # For no obvious reason this is not done automatically
+   python_foreach_impl python_optimize
+
+   popd > /dev/null || die
fi
 }
 



[gentoo-commits] repo/gentoo:master commit in: dev-libs/libnl/, dev-libs/libnl/files/

2015-08-18 Thread Jeroen Roovers
commit: c4456f9d089d84626a4ecb2a506dc9afaa77680f
Author: Jeroen Roovers jer AT gentoo DOT org
AuthorDate: Wed Aug 19 05:10:06 2015 +
Commit: Jeroen Roovers jer AT gentoo DOT org
CommitDate: Wed Aug 19 05:10:06 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4456f9d

Old.

Package-Manager: portage-2.2.20.1

 dev-libs/libnl/Manifest|   2 -
 dev-libs/libnl/files/libnl-3.2.23-python.patch |  26 ---
 dev-libs/libnl/files/libnl-3.2.23-utils.h  |  41 --
 dev-libs/libnl/libnl-3.2.23.ebuild |  82 
 dev-libs/libnl/libnl-3.2.24-r1.ebuild  | 102 -
 dev-libs/libnl/libnl-3.2.24.ebuild |  80 ---
 6 files changed, 333 deletions(-)

diff --git a/dev-libs/libnl/Manifest b/dev-libs/libnl/Manifest
index fa99e15..8825f09 100644
--- a/dev-libs/libnl/Manifest
+++ b/dev-libs/libnl/Manifest
@@ -1,5 +1,3 @@
 DIST libnl-1.1.4.tar.gz 1174974 SHA256 
4f80c21fe5bbcdde6e72b59b4f98306063a41421f909887c34e58d93e746d063 SHA512 
25e26ddcc16540346ea34815ab6ac094177e5cee2eb3d843c4f8b30cd9d83390a3e87cb46046dc3bd9ae4d21f77e57bb3827c2cfc588eb18afe049921f2030b4
 WHIRLPOOL 
eab5547dce7b11c86123fbcc9cd8e00100c7e78f48a4a9fef40f80f89407ea705b701f8f0eb7df63997866f17b0cf0924b43c69b29fa1f1b016fe997371b950e
-DIST libnl-3.2.23.tar.gz 766271 SHA256 
8cc2cda9aa8cbbad384b9bb1ba0f6777ed9bf65e1cc3170d8c2ba5b3ee12f2b3 SHA512 
b56dde135bf8e2a48bb7bb885351cf557b6a88c67dbc012c3c3f4008b8c6066f18442de772e7f8a41d6da8c80d4a38664393f131732870deae9da090b53045d8
 WHIRLPOOL 
ef3f35edc77b7de1657e5ddd0f26e2e316d31ffb46353ab6c7345df5ff9b6d757b2d62fbaa5c58f4a7f5ed13859b00759971b22a069e381af519a82ffa8eb7a4
-DIST libnl-3.2.24.tar.gz 802068 SHA256 
fb8d6e5dc8af5b85bc6d00a71582a68a01e6a3f7d1664d4a646e289a99dd6816 SHA512 
d42c131d0be3bddfd65b9353f7193d355a0b5a7f0c32ee3db67ceeb9da2b04030f2dbc0d51f7f7cddbcc15fcc596b380e0c846dbe1c52212e50d06b7ee12fb10
 WHIRLPOOL 
a90e9dcd08c7a2fb2bc883dd4f8b09e21afd55b10573bada84d1fb6425f5a9adff90bfd0c7572aef437719cfaaa106e5cc4b4aeed081d62e6723ba31c15f0edf
 DIST libnl-3.2.25.tar.gz 832513 SHA256 
8beb7590674957b931de6b7f81c530b85dc7c1ad8fbda015398bc1e8d1ce8ec5 SHA512 
3f9649577e9282cf41d2d4894aaecb2d53b4a1c51f9e674a6fb73393e9482f9f45e6f0ffa5815e606f972916e369774bfd85141a96c0e3d9d4ead3adea796286
 WHIRLPOOL 
f151776fa1d1b9d23416408a315c0aa900928fa902322a0f4df3c90631ef54f281cf0cae6f69ec878a76f03a609f5fa2eb52d4c03db502c9972a70d864cdaf97
 DIST libnl-3.2.26.tar.gz 896005 SHA256 
1323ff6cea47efe9f988893b09840942a8c36131f472a9f3b96eb68d8f8d7555 SHA512 
5ab4a3a40244d71e0c8c50fcef30a67f814509d508e9537c85f2d710578a8a61513e7f26b2c0c29a9817484ca6ecd005e53b4f9054cd878274ae3b439abbe516
 WHIRLPOOL 
84854749fc312c867d9eec1e4d91bbeb5a132f79c004c5db0504a7d60136a2f39263b4efd4b0d1cd2e07f6cd363cc5e68f93089cb9b9dd58a45f416338c41a6f

diff --git a/dev-libs/libnl/files/libnl-3.2.23-python.patch 
b/dev-libs/libnl/files/libnl-3.2.23-python.patch
deleted file mode 100644
index 559376b..000
--- a/dev-libs/libnl/files/libnl-3.2.23-python.patch
+++ /dev/null
@@ -1,26 +0,0 @@
 a/python/setup.py.in
-+++ b/python/setup.py.in
-@@ -9,6 +9,7 @@
-  sources = ['netlink/capi.i'],
-include_dirs = include,
-swig_opts = opts,
-+   library_dirs=['@top_builddir@/lib/.libs'],
-libraries = ['nl-3'],
-   )
- 
-@@ -16,6 +17,7 @@
-  sources = ['netlink/route/capi.i'],
-include_dirs = include,
-swig_opts = opts,
-+   library_dirs=['@top_builddir@/lib/.libs'],
-libraries = ['nl-3', 'nl-route-3'],
-   )
- 
-@@ -23,6 +25,7 @@
-sources = ['netlink/genl/capi.i'],
-include_dirs = include,
-swig_opts = opts,
-+   library_dirs=['@top_builddir@/lib/.libs'],
-libraries = ['nl-3', 'nl-genl-3'],
-   )
- 

diff --git a/dev-libs/libnl/files/libnl-3.2.23-utils.h 
b/dev-libs/libnl/files/libnl-3.2.23-utils.h
deleted file mode 100644
index 7836c30..000
--- a/dev-libs/libnl/files/libnl-3.2.23-utils.h
+++ /dev/null
@@ -1,41 +0,0 @@
-struct list_head {
-   struct list_head *next;
-};
-
-#define LIST_HEAD(name) \
-   struct list_head name = { (name) }
-
-static inline int list_empty(const struct list_head *head)
-{
-   return head-next == head;
-}
-
-static inline void list_add(struct list_head *new, struct list_head *head)
-{
-   new-next = head-next;
-   head-next = new;
-}
-
-static inline void list_del(struct list_head *entry, struct list_head *prev)
-{
-   prev-next = entry-next;
-   entry-next = entry;
-}
-
-#define list_for_each_safe(pos, n, head) \
-   for (n = (head), pos = (head)-next; pos !=