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 B107ADC6644 for ; Tue, 9 Feb 2016 09:36:30 +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 7732EDC025E for ; Tue, 9 Feb 2016 09:36:29 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2F4E920F9A for ; Tue, 9 Feb 2016 04:36:29 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Tue, 09 Feb 2016 04:36:29 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=celos.net; h=date :from:in-reply-to:message-id:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=1E34hE5R5zEQtxe3CytuRF24qoo=; b=3+0mpF LaVeSfWnzsyG9H6AavT3r+ozHCKhhLlSGT8nzi6NyXZ7lARO4kE31IVoHoiIVQkf VS4Ufn9qKn99NrFasEbEQc6KCoV52x4wI/6VjPK2lCuVCQn2fbMatviaUxOmBO8w 7OoxLrpb3Q5mDqTnsp53JmD9LHWxgMfQrXyuQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:in-reply-to:message-id :references:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=1E34 hE5R5zEQtxe3CytuRF24qoo=; b=M2FnBJ4raOMLFQ6uJYmcEcngvpIijHpjKGL6 7JyYYjumZSNJgwkXIwHtatuRg5UXA3KustkDLZm9qLumd/ZlmYf81tcSgfG11Ft1 et7dxU/zo9Znyh8FSz5E/PeF/H+tomx1U2/PNTnMtwK9kVQjkcw4WFENdMYhCckZ JbwsUrw= X-Sasl-enc: Jj803RPmA/r/i51UTp4pbWCiunW82UzTvPBpZkkFwWIk 1455010588 Received: from haven.flat11.uk.com (haven.mjwhite.net [109.74.205.77]) by mail.messagingengine.com (Postfix) with ESMTPA id BAE9DC0001D for ; Tue, 9 Feb 2016 04:36:28 -0500 (EST) From: Mark White To: alpine-aports@lists.alpinelinux.org Subject: [alpine-aports] [PATCH v2] testing/i3wm: expand tilde in config path Date: Tue, 9 Feb 2016 09:36:28 +0000 Message-Id: <1455010588-29779-1-git-send-email-mark@celos.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1454967500-24549-1-git-send-email-mark@celos.net> References: <1454967500-24549-1-git-send-email-mark@celos.net> 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 default use of literal "$HOME/~/.config/i3". fixes #5078 --- Changes v1 -> v2: - increment pkgrel (forgot, oops) testing/i3wm/APKBUILD | 8 ++++---- testing/i3wm/musl.patch | 46 ++++++++++++++++++++++++++++++++++------------ 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/testing/i3wm/APKBUILD b/testing/i3wm/APKBUILD index 57597b6..03a4368 100644 --- a/testing/i3wm/APKBUILD +++ b/testing/i3wm/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Natanael Copa pkgname=i3wm pkgver=4.11 -pkgrel=0 +pkgrel=1 pkgdesc="A tiling window manager" url="http://i3wm.org" arch="all" @@ -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 ---