diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2012-12-22 14:14:48 +0400 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2012-12-22 14:14:48 +0400 |
commit | 8630db2b55c251c22a3140e72de44af8c0b2a08d (patch) | |
tree | db8fde821cf40023cc5ffe68b9a58b2b2d50bcba /pkgs/build-support/upstream-updater | |
parent | 248d160f7cb38f1c9ab68ae8f3a883e7af0eb9cb (diff) | |
download | nixlib-8630db2b55c251c22a3140e72de44af8c0b2a08d.tar nixlib-8630db2b55c251c22a3140e72de44af8c0b2a08d.tar.gz nixlib-8630db2b55c251c22a3140e72de44af8c0b2a08d.tar.bz2 nixlib-8630db2b55c251c22a3140e72de44af8c0b2a08d.tar.lz nixlib-8630db2b55c251c22a3140e72de44af8c0b2a08d.tar.xz nixlib-8630db2b55c251c22a3140e72de44af8c0b2a08d.tar.zst nixlib-8630db2b55c251c22a3140e72de44af8c0b2a08d.zip |
More specific tracing of a relatively tricky replace once; account for default.nix being present everywhere.
Diffstat (limited to 'pkgs/build-support/upstream-updater')
-rwxr-xr-x | pkgs/build-support/upstream-updater/update-walker.sh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/build-support/upstream-updater/update-walker.sh b/pkgs/build-support/upstream-updater/update-walker.sh index 3935f2a43ed3..c4dc7713f504 100755 --- a/pkgs/build-support/upstream-updater/update-walker.sh +++ b/pkgs/build-support/upstream-updater/update-walker.sh @@ -152,8 +152,7 @@ full_path () { target () { CURRENT_TARGET="$1" - test -e "$CURRENT_TARGET" || - { [ "$CURRENT_TARGET" = "${CURRENT_TARGET#/}" ] && CURRENT_TARGET="$CONFIG_DIR/$CURRENT_TARGET"; } + { [ "$CURRENT_TARGET" = "${CURRENT_TARGET#/}" ] && CURRENT_TARGET="$CONFIG_DIR/$CURRENT_TARGET"; } echo "Target set to: $CURRENT_TARGET" } @@ -190,6 +189,12 @@ replace_once () { replacement="$3" instance="${4:-1}" + echo "Replacing once:" + echo "file: [[$file]]" + echo "regexp: [[$regexp]]" + echo "replacement: [[$replacement]]" + echo "instance: [[$instance]]" + position="$(line_position "$file" "$regexp" "$instance")" sed -re "${position}s $regexp $replacement " -i "$file" } @@ -204,7 +209,7 @@ set_var_value () { quote='"' let "$no_quotes" && quote="" - replace_once "$file" "${var} *= *.*" "${var} = ${quote}${value}${quote};" + replace_once "$file" "${var} *= *.*" "${var} = ${quote}${value}${quote};" "$instance" } do_regenerate () { |