X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 08D80DC8634 for ; Mon, 8 Feb 2016 21:38:23 +0000 (UTC) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id BADD7DC1AAA for ; Mon, 8 Feb 2016 21:38:22 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 35CAC20744 for ; Mon, 8 Feb 2016 16:38:21 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Mon, 08 Feb 2016 16:38:21 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=celos.net; h=date :from:message-id:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh= BZp25cpLAJ8dObRj/2chijy2V54=; b=0+kjpg6ehfr+rvbAnXxlAkmlsiVh2Otw u7BJuuR06+FocoknQ1Ux8Nir8WUIyV1j4Ox7xkL7iBS9v+hGcnCZQpZjSUGz55Z8 k7KvSkkJl0ozlnejdyghVnWw9BEuZGOAHfQ/CNOt9i1xZJ+023eHE0kWeay1I8iq 6z81q4Lr+f0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-sasl-enc:x-sasl-enc; s=smtpout; bh=BZp25cpLAJ8dObRj/2chijy2V5 4=; b=tMe3fWV8YLjZR7jcAhcooY+dKz6oJ5HQT5wm2IGOb4maJCOKIoaQsxmBsa ilULgZjH5MhRrTrD2kI7iMMD1f8LAv5eaoCk7kmxzOA5rhu3pa/GAJrnkFdB5cDA 44DuJdOW6FeIIKNoW5TLvhp6fOU4gHx6ezmn91isKgMhH9FOY= X-Sasl-enc: ow8Oywjx1AhbHRIt6JAcl73L10lcDmuzkt2cmA+y8YBl 1454967500 Received: from haven.flat11.uk.com (haven.mjwhite.net [109.74.205.77]) by mail.messagingengine.com (Postfix) with ESMTPA id C31B9680145 for ; Mon, 8 Feb 2016 16:38:20 -0500 (EST) From: Mark White To: alpine-aports@lists.alpinelinux.org Subject: [alpine-aports] [PATCH] testing/i3wm: expand tilde in config path Date: Mon, 8 Feb 2016 21:38:20 +0000 Message-Id: <1454967500-24549-1-git-send-email-mark@celos.net> X-Mailer: git-send-email 1.7.10.4 X-Virus-Scanned: ClamAV using ClamSMTP X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Expand ~ to $HOME if path begins with "~/". Not a complete GLOB_TILDE, but fixes current use of literal "$HOME/~/.config/i3" by default. fixes #5078 --- testing/i3wm/APKBUILD | 6 +++--- testing/i3wm/musl.patch | 46 ++++++++++++++++++++++++++++++++++------------ 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/testing/i3wm/APKBUILD b/testing/i3wm/APKBUILD index 57597b6..5089cc8 100644 --- a/testing/i3wm/APKBUILD +++ b/testing/i3wm/APKBUILD @@ -42,8 +42,8 @@ package() { } md5sums="6b003955333a90cb831516f8dbf6e57d i3-4.11.tar.bz2 -c111abf5d38d2ad356923047a47f6a65 musl.patch" +aa998beb0b9a83d2910508768ac7faae musl.patch" sha256sums="78ce1e06fbd92fd63765bbe23faa7b8f929c17f99ed623f7abf2e568169d982f i3-4.11.tar.bz2 -626886ec7edfa768b4ab8cb9eaef4b3944e0a7cac2bb6748b7ce2622c409d08a musl.patch" +b7d084c53addc71fda13ccb8b3dcca2a32d9ca1590a28bf3be1a0c61870d3817 musl.patch" sha512sums="76d45be9006973dd4093fd21ea1c83742b7977c7698e133ce8f9e7826d97d1631fbe6c3ea4a7eb3d989027f98e12738158e72ec450b0df3dddd28f912ff49a4f i3-4.11.tar.bz2 -b3d2947f95b83f4421b54899d6411d93124828fcb06d6777330db523b8a101ab425bc3201c1aaed00206b468320c85617a6e0657427a7a1aec4d671082aa6494 musl.patch" +8ce7d00371c43b93dabbe0dadf9caf7c58a68f4a0079f5a9b9552c15c55bfa0df16d7e87a281595af2ac5254632ba28ccf82a467cea16159b41490f6f2910299 musl.patch" diff --git a/testing/i3wm/musl.patch b/testing/i3wm/musl.patch index 56feaa9..82ad619 100644 --- a/testing/i3wm/musl.patch +++ b/testing/i3wm/musl.patch @@ -1,7 +1,7 @@ -diff -upr i3-4.11.orig/i3bar/src/main.c i3-4.11/i3bar/src/main.c ---- i3-4.11.orig/i3bar/src/main.c 2015-10-06 22:45:01.791199587 +0200 -+++ i3-4.11/i3bar/src/main.c 2015-10-06 22:45:52.921029327 +0200 -@@ -45,14 +45,7 @@ void debuglog(char *fmt, ...) { +diff -urp i3-4.11/i3bar/src/main.c i3-4.11.new/i3bar/src/main.c +--- i3-4.11/i3bar/src/main.c 2015-09-30 07:55:10.000000000 +0100 ++++ i3-4.11.new/i3bar/src/main.c 2016-02-08 20:03:41.777392482 +0000 +@@ -45,14 +45,20 @@ void debuglog(char *fmt, ...) { * */ char *expand_path(char *path) { @@ -9,24 +9,37 @@ diff -upr i3-4.11.orig/i3bar/src/main.c i3-4.11/i3bar/src/main.c - if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0) { - ELOG("glob() failed\n"); - exit(EXIT_FAILURE); -- } ++ char *home, *expanded; ++ ++ if (strncmp(path, "~/", 2) == 0) { ++ home = getenv("HOME"); ++ if (home != NULL) { ++ /* new length: sum - 1 (omit '~') + 1 (for '\0') */ ++ expanded = scalloc(strlen(home)+strlen(path), 1); ++ strcpy(expanded, home); ++ strcat(expanded, path+1); ++ return expanded; ++ } + } - char *result = sstrdup(globbuf.gl_pathc > 0 ? globbuf.gl_pathv[0] : path); - globfree(&globbuf); - return result; ++ + return sstrdup(path); } void print_usage(char *elf_name) { -diff -upr i3-4.11.orig/libi3/resolve_tilde.c i3-4.11/libi3/resolve_tilde.c ---- i3-4.11.orig/libi3/resolve_tilde.c 2015-10-06 22:45:01.801199553 +0200 -+++ i3-4.11/libi3/resolve_tilde.c 2015-10-06 22:46:32.874229612 +0200 -@@ -19,27 +19,5 @@ +diff -urp i3-4.11/libi3/resolve_tilde.c i3-4.11.new/libi3/resolve_tilde.c +--- i3-4.11/libi3/resolve_tilde.c 2015-09-30 07:55:10.000000000 +0100 ++++ i3-4.11.new/libi3/resolve_tilde.c 2016-02-08 20:03:47.849230953 +0000 +@@ -19,27 +19,18 @@ * */ char *resolve_tilde(const char *path) { - static glob_t globbuf; - char *head, *tail, *result; -- ++ char *home, *expanded; + - tail = strchr(path, '/'); - head = sstrndup(path, tail ? (size_t)(tail - path) : strlen(path)); - @@ -43,9 +56,18 @@ diff -upr i3-4.11.orig/libi3/resolve_tilde.c i3-4.11/libi3/resolve_tilde.c - strncpy(result, head, strlen(head)); - if (tail) - strncat(result, tail, strlen(tail)); -- } ++ if (strncmp(path, "~/", 2) == 0) { ++ home = getenv("HOME"); ++ if (home != NULL) { ++ /* new length: sum - 1 (omit '~') + 1 (for '\0') */ ++ expanded = scalloc(strlen(home)+strlen(path), 1); ++ strcpy(expanded, home); ++ strcat(expanded, path+1); ++ return expanded; ++ } + } - globfree(&globbuf); -- + - return result; + return sstrdup(path); } -- 1.7.10.4 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---